From 124ea2434658b5a1d7bf44af3b32e943e47209d4 Mon Sep 17 00:00:00 2001 From: acoul Date: Tue, 7 Dec 2010 17:44:19 +0000 Subject: [PATCH] net/quagga: fix uClibc-0.9.32/pthreads issues, refresh patches git-svn-id: svn://svn.openwrt.org/openwrt/packages@24311 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- net/quagga/Makefile | 7 +- net/quagga/patches/000-upstream-afi_t_safi_t.patch | 161 +++++++++++++++++++++ net/quagga/patches/000-upstream-bogus_cond.patch | 2 +- net/quagga/patches/000-upstream-clock_fix.patch | 7 +- net/quagga/patches/000-upstream-set_null.patch | 2 +- net/quagga/patches/001-fix_ipctl_forwarding.patch | 12 +- 6 files changed, 175 insertions(+), 16 deletions(-) create mode 100644 net/quagga/patches/000-upstream-afi_t_safi_t.patch diff --git a/net/quagga/Makefile b/net/quagga/Makefile index 051177fd6..59c11a633 100644 --- a/net/quagga/Makefile +++ b/net/quagga/Makefile @@ -15,7 +15,7 @@ ifneq ($(CONFIG_QUAGGA_OLD),) PATCH_DIR:=./patches-old else PKG_VERSION:=0.99.17 - PKG_RELEASE:=4 + PKG_RELEASE:=5 PKG_MD5SUM:=37b9022adca04b03863d2d79787e643f endif @@ -160,6 +160,8 @@ CONFIG_PACKAGE_quagga-ripngd:=m CONFIG_PACKAGE_quagga-vtysh:=m endif +TARGET_LDFLAGS += -lpthread + CONFIGURE_ARGS+= \ --localstatedir=/var/run/quagga \ --sysconfdir=/etc/quagga/ \ @@ -178,6 +180,9 @@ CONFIGURE_ARGS+= \ $(call autoconf_bool,CONFIG_PACKAGE_quagga-ripngd,ripngd) \ $(call autoconf_bool,CONFIG_PACKAGE_quagga-vtysh,vtysh) \ +MAKE_FLAGS += \ + CFLAGS="$(TARGET_CFLAGS) -D_GNU_SOURCE" + define Build/Configure (cd $(PKG_BUILD_DIR); rm -rf config.{cache,status}; \ autoconf \ diff --git a/net/quagga/patches/000-upstream-afi_t_safi_t.patch b/net/quagga/patches/000-upstream-afi_t_safi_t.patch new file mode 100644 index 000000000..eb2e1a74c --- /dev/null +++ b/net/quagga/patches/000-upstream-afi_t_safi_t.patch @@ -0,0 +1,161 @@ +From 4c9641ba4df276080c670e03f65b1d442660a50f Mon Sep 17 00:00:00 2001 +From: Michael Lambert +Date: Thu, 22 Jul 2010 13:20:55 -0400 +Subject: [PATCH] bgpd, lib: adopt afi_t and safi_t in several places + +* bgpd/bgp_attr.c, bgpd/bgp_open.h, bgpd/bgp_route.c, lib/prefix.c, + lib/prefix.h: Various integer types were being used where, if we + had strict type checking, afi_t and safi_t would be required. + +Signed-off-by: G.Balaji +(cherry picked from commit c8af35ffa2dc79ff7d7ff00b1b61f1f50a100ab6) +--- + bgpd/bgp_attr.c | 8 ++++---- + bgpd/bgp_open.h | 8 ++++---- + bgpd/bgp_route.c | 16 ++++++++-------- + lib/prefix.c | 4 ++-- + lib/prefix.h | 4 ++-- + 5 files changed, 20 insertions(+), 20 deletions(-) + +--- a/bgpd/bgp_attr.c ++++ b/bgpd/bgp_attr.c +@@ -1301,8 +1301,8 @@ int + bgp_mp_reach_parse (struct peer *peer, bgp_size_t length, struct attr *attr, + struct bgp_nlri *mp_update) + { +- u_int16_t afi; +- u_char safi; ++ afi_t afi; ++ safi_t safi; + bgp_size_t nlri_len; + size_t start; + int ret; +@@ -1436,8 +1436,8 @@ bgp_mp_unreach_parse (struct peer *peer, + struct bgp_nlri *mp_withdraw) + { + struct stream *s; +- u_int16_t afi; +- u_char safi; ++ afi_t afi; ++ safi_t safi; + u_int16_t withdraw_len; + int ret; + +--- a/bgpd/bgp_open.h ++++ b/bgpd/bgp_open.h +@@ -31,9 +31,9 @@ struct capability_header + /* Generic MP capability data */ + struct capability_mp_data + { +- u_int16_t afi; ++ afi_t afi; + u_char reserved; +- u_char safi; ++ safi_t safi; + }; + + #pragma pack(1) +@@ -55,8 +55,8 @@ struct capability_as4 + + struct graceful_restart_af + { +- u_int16_t afi; +- u_char safi; ++ afi_t afi; ++ safi_t safi; + u_char flag; + }; + +--- a/bgpd/bgp_route.c ++++ b/bgpd/bgp_route.c +@@ -3518,8 +3518,8 @@ bgp_static_update (struct bgp *bgp, stru + } + + static void +-bgp_static_update_vpnv4 (struct bgp *bgp, struct prefix *p, u_int16_t afi, +- u_char safi, struct prefix_rd *prd, u_char *tag) ++bgp_static_update_vpnv4 (struct bgp *bgp, struct prefix *p, afi_t afi, ++ safi_t safi, struct prefix_rd *prd, u_char *tag) + { + struct bgp_node *rn; + struct bgp_info *new; +@@ -3599,8 +3599,8 @@ bgp_check_local_routes_rsclient (struct + } + + static void +-bgp_static_withdraw_vpnv4 (struct bgp *bgp, struct prefix *p, u_int16_t afi, +- u_char safi, struct prefix_rd *prd, u_char *tag) ++bgp_static_withdraw_vpnv4 (struct bgp *bgp, struct prefix *p, afi_t afi, ++ safi_t safi, struct prefix_rd *prd, u_char *tag) + { + struct bgp_node *rn; + struct bgp_info *ri; +@@ -3653,7 +3653,7 @@ bgp_pathlimit_update_parents (struct bgp + route should be installed as valid. */ + static int + bgp_static_set (struct vty *vty, struct bgp *bgp, const char *ip_str, +- u_int16_t afi, u_char safi, const char *rmap, int backdoor, ++ afi_t afi, safi_t safi, const char *rmap, int backdoor, + u_char ttl) + { + int ret; +@@ -3798,7 +3798,7 @@ bgp_static_set (struct vty *vty, struct + /* Configure static BGP network. */ + static int + bgp_static_unset (struct vty *vty, struct bgp *bgp, const char *ip_str, +- u_int16_t afi, u_char safi) ++ afi_t afi, safi_t safi) + { + int ret; + struct prefix p; +@@ -7622,7 +7622,7 @@ DEFUN (show_ipv6_mbgp_community_all, + + static int + bgp_show_community (struct vty *vty, int argc, const char **argv, int exact, +- u_int16_t afi, u_char safi) ++ afi_t afi, safi_t safi) + { + struct community *com; + struct buffer *b; +@@ -8622,7 +8622,7 @@ ALIAS (show_ipv6_mbgp_community_exact, + + static int + bgp_show_community_list (struct vty *vty, const char *com, int exact, +- u_int16_t afi, u_char safi) ++ afi_t afi, safi_t safi) + { + struct community_list *list; + +--- a/lib/prefix.c ++++ b/lib/prefix.c +@@ -41,7 +41,7 @@ static const u_char maskbit[] = {0x00, 0 + + /* Address Famiy Identifier to Address Family converter. */ + int +-afi2family (int afi) ++afi2family (afi_t afi) + { + if (afi == AFI_IP) + return AF_INET; +@@ -52,7 +52,7 @@ afi2family (int afi) + return 0; + } + +-int ++afi_t + family2afi (int family) + { + if (family == AF_INET) +--- a/lib/prefix.h ++++ b/lib/prefix.h +@@ -144,8 +144,8 @@ prefix6_bit (const struct in6_addr *pref + } + + /* Prototypes. */ +-extern int afi2family (int); +-extern int family2afi (int); ++extern int afi2family (afi_t); ++extern afi_t family2afi (int); + + extern struct prefix *prefix_new (void); + extern void prefix_free (struct prefix *); diff --git a/net/quagga/patches/000-upstream-bogus_cond.patch b/net/quagga/patches/000-upstream-bogus_cond.patch index c35ffdb7d..eddf5c450 100644 --- a/net/quagga/patches/000-upstream-bogus_cond.patch +++ b/net/quagga/patches/000-upstream-bogus_cond.patch @@ -1,6 +1,6 @@ --- a/zebra/zserv.c +++ b/zebra/zserv.c -@@ -451,7 +451,7 @@ zsend_route_multipath (int cmd, struct zserv *client, struct prefix *p, +@@ -451,7 +451,7 @@ zsend_route_multipath (int cmd, struct z } /* Metric */ diff --git a/net/quagga/patches/000-upstream-clock_fix.patch b/net/quagga/patches/000-upstream-clock_fix.patch index 58fea85a6..f2d7db604 100644 --- a/net/quagga/patches/000-upstream-clock_fix.patch +++ b/net/quagga/patches/000-upstream-clock_fix.patch @@ -10,11 +10,9 @@ Subject: [PATCH] bgpd: fix printed value of last-update timestamp bgpd/bgp_route.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) -diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c -index 2391f74..1cfc451 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c -@@ -6145,7 +6145,8 @@ route_vty_out_detail (struct vty *vty, struct bgp *bgp, struct prefix *p, +@@ -6145,7 +6145,8 @@ route_vty_out_detail (struct vty *vty, s bgp_damp_info_vty (vty, binfo); /* Line 7 display Uptime */ @@ -24,6 +22,3 @@ index 2391f74..1cfc451 100644 } vty_out (vty, "%s", VTY_NEWLINE); } --- -1.7.2.3 - diff --git a/net/quagga/patches/000-upstream-set_null.patch b/net/quagga/patches/000-upstream-set_null.patch index 3d0eaebd8..7ba101994 100644 --- a/net/quagga/patches/000-upstream-set_null.patch +++ b/net/quagga/patches/000-upstream-set_null.patch @@ -1,6 +1,6 @@ --- a/bgpd/bgp_packet.c +++ b/bgpd/bgp_packet.c -@@ -177,10 +177,11 @@ bgp_update_packet (struct peer *peer, afi_t afi, safi_t safi) +@@ -177,10 +177,11 @@ bgp_update_packet (struct peer *peer, af if (rn->prn) prd = (struct prefix_rd *) &rn->prn->p; diff --git a/net/quagga/patches/001-fix_ipctl_forwarding.patch b/net/quagga/patches/001-fix_ipctl_forwarding.patch index e9a986410..d757312da 100644 --- a/net/quagga/patches/001-fix_ipctl_forwarding.patch +++ b/net/quagga/patches/001-fix_ipctl_forwarding.patch @@ -5,14 +5,12 @@ http://svn.gnumonks.org/trunk/grouter/build/src/quagga/quagga/quagga-0.99.1-forw Signed-off-by: Thomas Petazzoni -Index: quagga-0.99.16/zebra/ipforward_sysctl.c -=================================================================== ---- quagga-0.99.16.orig/zebra/ipforward_sysctl.c 2010-06-20 23:40:45.000000000 +0200 -+++ quagga-0.99.16/zebra/ipforward_sysctl.c 2010-06-20 23:41:37.000000000 +0200 +--- a/zebra/ipforward_sysctl.c ++++ b/zebra/ipforward_sysctl.c @@ -31,6 +31,15 @@ - + #define MIB_SIZ 4 - + +/* Fix for recent (2.6.14) kernel headers */ +#ifndef IPCTL_FORWARDING +#define IPCTL_FORWARDING NET_IPV4_FORWARD @@ -23,5 +21,5 @@ Index: quagga-0.99.16/zebra/ipforward_sysctl.c +#endif + extern struct zebra_privs_t zserv_privs; - + /* IPv4 forwarding control MIB. */ -- 2.11.0