From ef008d2f8dc8f7160d8a3d24a15f2fad79ef3242 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Tue, 3 Mar 2015 08:48:11 +0100 Subject: *: use long long to print time_t Since we can't assume time_t to be long, int, or even long long, this consistently uses %lld/long long (or %llu/unsigned long long in a few cases) to print time_t/susecond_t values. This should fix a bunch of warnings, on NetBSD in particular. (Unfortunately, there seems to be no "PRId64" style printing macro for time_t...) Signed-off-by: David Lamparter --- bgpd/bgp_damp.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'bgpd') diff --git a/bgpd/bgp_damp.c b/bgpd/bgp_damp.c index 0ffafb7a..1da1e696 100644 --- a/bgpd/bgp_damp.c +++ b/bgpd/bgp_damp.c @@ -529,15 +529,15 @@ bgp_config_write_damp (struct vty *vty) && bgp_damp_cfg.reuse_limit == DEFAULT_REUSE && bgp_damp_cfg.suppress_value == DEFAULT_SUPPRESS && bgp_damp_cfg.max_suppress_time == bgp_damp_cfg.half_life*4) - vty_out (vty, " bgp dampening %ld%s", - bgp_damp_cfg.half_life/60, + vty_out (vty, " bgp dampening %lld%s", + bgp_damp_cfg.half_life/60LL, VTY_NEWLINE); else - vty_out (vty, " bgp dampening %ld %d %d %ld%s", - bgp_damp_cfg.half_life/60, + vty_out (vty, " bgp dampening %lld %d %d %lld%s", + bgp_damp_cfg.half_life/60LL, bgp_damp_cfg.reuse_limit, bgp_damp_cfg.suppress_value, - bgp_damp_cfg.max_suppress_time/60, + bgp_damp_cfg.max_suppress_time/60LL, VTY_NEWLINE); } -- cgit v1.2.3 From eed3c48d3a7d2dae2cae2f2f250deffb843754a6 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Tue, 3 Mar 2015 08:51:53 +0100 Subject: *: use void * for printing pointers On higher warning levels, compilers expect %p printf arguments to be void *. Since format string / argument warnings can be useful otherwise, let's get rid of this noise by sprinkling casts to void * over printf calls. Signed-off-by: David Lamparter --- bgpd/bgp_aspath.c | 2 +- bgpd/bgp_vty.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'bgpd') diff --git a/bgpd/bgp_aspath.c b/bgpd/bgp_aspath.c index cfa9bc14..191a9e7b 100644 --- a/bgpd/bgp_aspath.c +++ b/bgpd/bgp_aspath.c @@ -1913,7 +1913,7 @@ aspath_show_all_iterator (struct hash_backet *backet, struct vty *vty) as = (struct aspath *) backet->data; - vty_out (vty, "[%p:%u] (%ld) ", backet, backet->key, as->refcnt); + vty_out (vty, "[%p:%u] (%ld) ", (void *)backet, backet->key, as->refcnt); vty_out (vty, "%s%s", as->str, VTY_NEWLINE); } diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index e6a36605..00d766d6 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -8235,7 +8235,7 @@ community_show_all_iterator (struct hash_backet *backet, struct vty *vty) struct community *com; com = (struct community *) backet->data; - vty_out (vty, "[%p] (%ld) %s%s", backet, com->refcnt, + vty_out (vty, "[%p] (%ld) %s%s", (void *)backet, com->refcnt, community_str (com), VTY_NEWLINE); } -- cgit v1.2.3 From b7d5021bfa161f797cbfb1e92bf5b94327fb1b71 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Tue, 3 Mar 2015 08:53:18 +0100 Subject: *: remove stray extra semicolons Some places had extra semicolons where none belong. Remove them. Signed-off-by: David Lamparter --- bgpd/bgp_routemap.c | 2 +- bgpd/bgp_table.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'bgpd') diff --git a/bgpd/bgp_routemap.c b/bgpd/bgp_routemap.c index 857781fe..be3c2eec 100644 --- a/bgpd/bgp_routemap.c +++ b/bgpd/bgp_routemap.c @@ -3163,7 +3163,7 @@ ALIAS (set_aspath_prepend, "Transform BGP AS_PATH attribute\n" "Prepend to the as-path\n" "Use the peer's AS-number\n" - "Number of times to insert"); + "Number of times to insert") DEFUN (no_set_aspath_prepend, no_set_aspath_prepend_cmd, diff --git a/bgpd/bgp_table.h b/bgpd/bgp_table.h index 04a1d379..209a18c9 100644 --- a/bgpd/bgp_table.h +++ b/bgpd/bgp_table.h @@ -55,7 +55,7 @@ struct bgp_node * @see bgp_node_to_rnode * @see bgp_node_from_rnode */ - ROUTE_NODE_FIELDS; + ROUTE_NODE_FIELDS struct bgp_adj_out *adj_out; -- cgit v1.2.3 From 21401f3215be26dcb0f787105f5907745498e966 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Tue, 3 Mar 2015 08:55:26 +0100 Subject: *: fix signedness mix-ups Signed-off-by: David Lamparter --- bgpd/bgp_aspath.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bgpd') diff --git a/bgpd/bgp_aspath.c b/bgpd/bgp_aspath.c index 191a9e7b..0aec3ef1 100644 --- a/bgpd/bgp_aspath.c +++ b/bgpd/bgp_aspath.c @@ -1378,7 +1378,7 @@ static struct aspath * aspath_add_asns (struct aspath *aspath, as_t asno, u_char type, unsigned num) { struct assegment *assegment = aspath->segments; - int i; + unsigned i; if (assegment && assegment->type == type) { -- cgit v1.2.3 From ab90fc04a57b7b1d93ccddb8c9fbbf339a7ffc4c Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Tue, 3 Mar 2015 09:07:25 +0100 Subject: *: add/cleanup initialisers There were some (inconsequential) warnings about uninitialised use of variables. Also, in one case, sub-structs were mixed in initialisation, which doesn't quite work as intended. Signed-off-by: David Lamparter --- bgpd/bgp_routemap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bgpd') diff --git a/bgpd/bgp_routemap.c b/bgpd/bgp_routemap.c index be3c2eec..95f1dff4 100644 --- a/bgpd/bgp_routemap.c +++ b/bgpd/bgp_routemap.c @@ -131,7 +131,7 @@ route_match_peer (void *rule, struct prefix *prefix, route_map_object_t type, void *object) { union sockunion *su; - union sockunion su_def = { .sa.sa_family = AF_INET, + union sockunion su_def = { .sin.sin_family = AF_INET, .sin.sin_addr.s_addr = INADDR_ANY }; struct peer_group *group; struct peer *peer; -- cgit v1.2.3 From b1672ce858cc9c16fd7cc67b673aa241d9583a59 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Sun, 19 Apr 2015 15:17:02 +0200 Subject: bgpd: fix ecommunity_token initialiser This pulls up ecommunity_token_unknown to be the first enum value (at 0), and uses that as initialiser to get rid of the uninitialised use warning. Signed-off-by: David Lamparter --- bgpd/bgp_ecommunity.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bgpd') diff --git a/bgpd/bgp_ecommunity.c b/bgpd/bgp_ecommunity.c index 482e76b7..04957d41 100644 --- a/bgpd/bgp_ecommunity.c +++ b/bgpd/bgp_ecommunity.c @@ -281,10 +281,10 @@ ecommunity_finish (void) /* Extended Communities token enum. */ enum ecommunity_token { + ecommunity_token_unknown = 0, ecommunity_token_rt, ecommunity_token_soo, ecommunity_token_val, - ecommunity_token_unknown }; /* Get next Extended Communities token from the string. */ @@ -511,7 +511,7 @@ struct ecommunity * ecommunity_str2com (const char *str, int type, int keyword_included) { struct ecommunity *ecom = NULL; - enum ecommunity_token token; + enum ecommunity_token token = ecommunity_token_unknown; struct ecommunity_val eval; int keyword = 0; -- cgit v1.2.3 From d43f8b39b075fe60e0c8fdb33b07b284d3fae503 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Tue, 3 Mar 2015 08:54:54 +0100 Subject: bgpd, zebra: fix struct/pointer sizeof mixups Two places were taking sizeof(pointer) instead of the sizeof(struct), while performing operations on the struct. Both are initialisation functions; I guess we haven't seen fallout since they weren't critical. Fix anyway. [v2: fix mistake that actually broke bgpd RS workqueue init] Signed-off-by: David Lamparter --- bgpd/bgp_route.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'bgpd') diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index e7357e54..cd2737c8 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -1666,9 +1666,10 @@ bgp_process_queue_init (void) bm->process_main_queue->spec.max_retries = 0; bm->process_main_queue->spec.hold = 50; - memcpy (bm->process_rsclient_queue, bm->process_main_queue, - sizeof (struct work_queue *)); bm->process_rsclient_queue->spec.workfunc = &bgp_process_rsclient; + bm->process_rsclient_queue->spec.del_item_data = &bgp_processq_del; + bm->process_rsclient_queue->spec.max_retries = 0; + bm->process_rsclient_queue->spec.hold = 50; } void -- cgit v1.2.3 From 94bad67cd8fe7ad023a40547a1153a414d70fa0a Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Tue, 3 Mar 2015 08:52:22 +0100 Subject: bgpd: don't use #ifdef inside macro args Using #ifdef inside preprocessor macro argument lists is not guaranteed to work. In reality it mostly does, but we don't need these ifdefs for HAVE_IPV6 anymore, so let's get rid of the warning nonetheless. Signed-off-by: David Lamparter --- bgpd/bgp_route.c | 59 +------------------------------------------------------- 1 file changed, 1 insertion(+), 58 deletions(-) (limited to 'bgpd') diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index cd2737c8..1ea4d216 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -7906,19 +7906,13 @@ ALIAS (show_ip_bgp_ipv4_community, DEFUN (show_bgp_view_afi_safi_community_all, show_bgp_view_afi_safi_community_all_cmd, -#ifdef HAVE_IPV6 "show bgp view WORD (ipv4|ipv6) (unicast|multicast) community", -#else - "show bgp view WORD ipv4 (unicast|multicast) community", -#endif SHOW_STR BGP_STR "BGP view\n" "View name\n" "Address family\n" -#ifdef HAVE_IPV6 "Address family\n" -#endif "Address Family modifier\n" "Address Family modifier\n" "Display routes matching the communities\n") @@ -7935,31 +7929,20 @@ DEFUN (show_bgp_view_afi_safi_community_all, return CMD_WARNING; } -#ifdef HAVE_IPV6 afi = (strncmp (argv[1], "ipv6", 4) == 0) ? AFI_IP6 : AFI_IP; safi = (strncmp (argv[2], "m", 1) == 0) ? SAFI_MULTICAST : SAFI_UNICAST; -#else - afi = AFI_IP; - safi = (strncmp (argv[1], "m", 1) == 0) ? SAFI_MULTICAST : SAFI_UNICAST; -#endif return bgp_show (vty, bgp, afi, safi, bgp_show_type_community_all, NULL); } DEFUN (show_bgp_view_afi_safi_community, show_bgp_view_afi_safi_community_cmd, -#ifdef HAVE_IPV6 "show bgp view WORD (ipv4|ipv6) (unicast|multicast) community (AA:NN|local-AS|no-advertise|no-export)", -#else - "show bgp view WORD ipv4 (unicast|multicast) community (AA:NN|local-AS|no-advertise|no-export)", -#endif SHOW_STR BGP_STR "BGP view\n" "View name\n" "Address family\n" -#ifdef HAVE_IPV6 "Address family\n" -#endif "Address family modifier\n" "Address family modifier\n" "Display routes matching the communities\n" @@ -7971,32 +7954,20 @@ DEFUN (show_bgp_view_afi_safi_community, int afi; int safi; -#ifdef HAVE_IPV6 afi = (strncmp (argv[1], "ipv6", 4) == 0) ? AFI_IP6 : AFI_IP; safi = (strncmp (argv[2], "m", 1) == 0) ? SAFI_MULTICAST : SAFI_UNICAST; return bgp_show_community (vty, argv[0], argc-3, &argv[3], 0, afi, safi); -#else - afi = AFI_IP; - safi = (strncmp (argv[1], "m", 1) == 0) ? SAFI_MULTICAST : SAFI_UNICAST; - return bgp_show_community (vty, argv[0], argc-2, &argv[2], 0, afi, safi); -#endif } ALIAS (show_bgp_view_afi_safi_community, show_bgp_view_afi_safi_community2_cmd, -#ifdef HAVE_IPV6 "show bgp view WORD (ipv4|ipv6) (unicast|multicast) community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export)", -#else - "show bgp view WORD ipv4 (unicast|multicast) community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export)", -#endif SHOW_STR BGP_STR "BGP view\n" "View name\n" "Address family\n" -#ifdef HAVE_IPV6 "Address family\n" -#endif "Address family modifier\n" "Address family modifier\n" "Display routes matching the communities\n" @@ -8011,19 +7982,13 @@ ALIAS (show_bgp_view_afi_safi_community, ALIAS (show_bgp_view_afi_safi_community, show_bgp_view_afi_safi_community3_cmd, -#ifdef HAVE_IPV6 "show bgp view WORD (ipv4|ipv6) (unicast|multicast) community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export)", -#else - "show bgp view WORD ipv4 (unicast|multicast) community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export)", -#endif SHOW_STR BGP_STR "BGP view\n" "View name\n" "Address family\n" -#ifdef HAVE_IPV6 "Address family\n" -#endif "Address family modifier\n" "Address family modifier\n" "Display routes matching the communities\n" @@ -8042,19 +8007,13 @@ ALIAS (show_bgp_view_afi_safi_community, ALIAS (show_bgp_view_afi_safi_community, show_bgp_view_afi_safi_community4_cmd, -#ifdef HAVE_IPV6 "show bgp view WORD (ipv4|ipv6) (unicast|multicast) community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export)", -#else - "show bgp view WORD ipv4 (unicast|multicast) community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export)", -#endif SHOW_STR BGP_STR "BGP view\n" "View name\n" "Address family\n" -#ifdef HAVE_IPV6 "Address family\n" -#endif "Address family modifier\n" "Address family modifier\n" "Display routes matching the communities\n" @@ -10200,19 +10159,13 @@ DEFUN (show_ip_bgp_ipv4_neighbor_received_routes, DEFUN (show_bgp_view_afi_safi_neighbor_adv_recd_routes, show_bgp_view_afi_safi_neighbor_adv_recd_routes_cmd, -#ifdef HAVE_IPV6 "show bgp view WORD (ipv4|ipv6) (unicast|multicast) neighbors (A.B.C.D|X:X::X:X) (advertised-routes|received-routes)", -#else - "show bgp view WORD ipv4 (unicast|multicast) neighbors (A.B.C.D|X:X::X:X) (advertised-routes|received-routes)", -#endif SHOW_STR BGP_STR "BGP view\n" "View name\n" "Address family\n" -#ifdef HAVE_IPV6 "Address family\n" -#endif "Address family modifier\n" "Address family modifier\n" "Detailed information on TCP and BGP neighbor connections\n" @@ -10226,24 +10179,14 @@ DEFUN (show_bgp_view_afi_safi_neighbor_adv_recd_routes, int in; struct peer *peer; -#ifdef HAVE_IPV6 - peer = peer_lookup_in_view (vty, argv[0], argv[3]); -#else - peer = peer_lookup_in_view (vty, argv[0], argv[2]); -#endif + peer = peer_lookup_in_view (vty, argv[0], argv[3]); if (! peer) return CMD_WARNING; -#ifdef HAVE_IPV6 afi = (strncmp (argv[1], "ipv6", 4) == 0) ? AFI_IP6 : AFI_IP; safi = (strncmp (argv[2], "m", 1) == 0) ? SAFI_MULTICAST : SAFI_UNICAST; in = (strncmp (argv[4], "r", 1) == 0) ? 1 : 0; -#else - afi = AFI_IP; - safi = (strncmp (argv[1], "m", 1) == 0) ? SAFI_MULTICAST : SAFI_UNICAST; - in = (strncmp (argv[3], "r", 1) == 0) ? 1 : 0; -#endif return peer_adj_routes (vty, peer, afi, safi, in); } -- cgit v1.2.3 From 8c9cd85631b77fac0bc30ffb9f23b29c466d31c4 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Sun, 19 Apr 2015 14:40:02 +0200 Subject: bgpd: random() returns long bgpd was using unsigned to store a probability value to be used with random(). That, however, returns long, running into some warnings (and worst case, if RAND_MAX > UINT_MAX, won't work correctly. Just use long to shuffle the value around. Signed-off-by: David Lamparter --- bgpd/bgp_routemap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'bgpd') diff --git a/bgpd/bgp_routemap.c b/bgpd/bgp_routemap.c index 95f1dff4..33f802c1 100644 --- a/bgpd/bgp_routemap.c +++ b/bgpd/bgp_routemap.c @@ -826,12 +826,12 @@ route_match_probability (void *rule, struct prefix *prefix, r = (long) rand(); #endif - switch (*(unsigned *) rule) + switch (*(long *) rule) { case 0: break; case RAND_MAX: return RMAP_MATCH; default: - if (r < *(unsigned *) rule) + if (r < *(long *) rule) { return RMAP_MATCH; } @@ -843,7 +843,7 @@ route_match_probability (void *rule, struct prefix *prefix, static void * route_match_probability_compile (const char *arg) { - unsigned *lobule; + long *lobule; unsigned perc; #if _SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE >= 500 @@ -853,7 +853,7 @@ route_match_probability_compile (const char *arg) #endif perc = atoi (arg); - lobule = XMALLOC (MTYPE_ROUTE_MAP_COMPILED, sizeof (unsigned)); + lobule = XMALLOC (MTYPE_ROUTE_MAP_COMPILED, sizeof (long)); switch (perc) { -- cgit v1.2.3 From d689d1a0c69726330d69b2dd412fdb8dcb23394b Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Tue, 3 Mar 2015 13:54:30 +0100 Subject: bgpd: fix SNMP write support This code - dating back to the initial import in 2002 - probably never worked. Calling asn_parse_int seems to always have been wrong, and in the meantime, there no longer is a "struct variable *" argument for write_method. If anyone tried to use it, it'd probably have crashed. (I didn't try.) Fix this up so it actually works. It's the only place in Quagga where a SNMP write is actually supported, so it's an odd one out anyway, but heh. Signed-off-by: David Lamparter --- bgpd/bgp_snmp.c | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) (limited to 'bgpd') diff --git a/bgpd/bgp_snmp.c b/bgpd/bgp_snmp.c index 79aaa03a..0f4aeec8 100644 --- a/bgpd/bgp_snmp.c +++ b/bgpd/bgp_snmp.c @@ -337,38 +337,42 @@ bgp_peer_lookup_next (struct in_addr *src) return NULL; } +/* 1.3.6.1.2.1.15.3.1.x = 10 */ +#define PEERTAB_NAMELEN 10 + static struct peer * bgpPeerTable_lookup (struct variable *v, oid name[], size_t *length, struct in_addr *addr, int exact) { struct peer *peer = NULL; + size_t namelen = v ? v->namelen : PEERTAB_NAMELEN; int len; if (exact) { /* Check the length. */ - if (*length - v->namelen != sizeof (struct in_addr)) + if (*length - namelen != sizeof (struct in_addr)) return NULL; - oid2in_addr (name + v->namelen, IN_ADDR_SIZE, addr); + oid2in_addr (name + namelen, IN_ADDR_SIZE, addr); peer = peer_lookup_addr_ipv4 (addr); return peer; } else { - len = *length - v->namelen; + len = *length - namelen; if (len > 4) len = 4; - oid2in_addr (name + v->namelen, len, addr); + oid2in_addr (name + namelen, len, addr); peer = bgp_peer_lookup_next (addr); if (peer == NULL) return NULL; - oid_copy_addr (name + v->namelen, addr, sizeof (struct in_addr)); - *length = sizeof (struct in_addr) + v->namelen; + oid_copy_addr (name + namelen, addr, sizeof (struct in_addr)); + *length = sizeof (struct in_addr) + namelen; return peer; } @@ -379,14 +383,12 @@ bgpPeerTable_lookup (struct variable *v, oid name[], size_t *length, static int write_bgpPeerTable (int action, u_char *var_val, u_char var_val_type, size_t var_val_len, - u_char *statP, oid *name, size_t length, - struct variable *v) + u_char *statP, oid *name, size_t length) { struct in_addr addr; struct peer *peer; long intval; - size_t bigsize = SNMP_MAX_LEN; - + if (var_val_type != ASN_INTEGER) { return SNMP_ERR_WRONGTYPE; @@ -396,21 +398,21 @@ write_bgpPeerTable (int action, u_char *var_val, return SNMP_ERR_WRONGLENGTH; } - if (! asn_parse_int(var_val, &bigsize, &var_val_type, - &intval, sizeof(long))) - { - return SNMP_ERR_WRONGENCODING; - } + intval = *(long *)var_val; memset (&addr, 0, sizeof (struct in_addr)); - peer = bgpPeerTable_lookup (v, name, &length, &addr, 1); + peer = bgpPeerTable_lookup (NULL, name, &length, &addr, 1); if (! peer) return SNMP_ERR_NOSUCHNAME; - printf ("val: %ld\n", intval); + if (action != SNMP_MSG_INTERNAL_SET_COMMIT) + return SNMP_ERR_NOERROR; - switch (v->magic) + zlog_info ("%s: SNMP write .%ld = %ld", + peer->host, (long)name[PEERTAB_NAMELEN - 1], intval); + + switch (name[PEERTAB_NAMELEN - 1]) { case BGPPEERADMINSTATUS: #define BGP_PeerAdmin_stop 1 -- cgit v1.2.3 From 53780e30c90ae393467afaf3ccff9e3791df5133 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Tue, 3 Mar 2015 09:07:09 +0100 Subject: bgpd: drop unused static variable Signed-off-by: David Lamparter --- bgpd/bgp_attr.c | 1 - 1 file changed, 1 deletion(-) (limited to 'bgpd') diff --git a/bgpd/bgp_attr.c b/bgpd/bgp_attr.c index be316daa..5c832edc 100644 --- a/bgpd/bgp_attr.c +++ b/bgpd/bgp_attr.c @@ -72,7 +72,6 @@ static const struct message attr_flag_str[] = /* bgp_attr_flags_diagnose() relies on this bit being last in this list */ { BGP_ATTR_FLAG_EXTLEN, "Extended Length" }, }; -static const size_t attr_flag_str_max = array_size(attr_flag_str); static struct hash *cluster_hash; -- cgit v1.2.3 From c0bedebfe9ca1a1ded02f1f481762dd41defa63e Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Tue, 3 Mar 2015 10:00:43 +0100 Subject: build: add --enable-werror This allows enabling -Werror in a consistent way. Note that this is different from just specifiying it in CFLAGS, since that would either break configure tests (if done on ./configure), or would override configure's CFLAGS (if done on make). Using --enable-werror instead provides a new WERROR variable that is additionally used during make with a consistent set of warning flags. The tests/ directory is exempt. (Rationale being, better to have more tests than pedantically complain about them.) Signed-off-by: David Lamparter --- bgpd/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bgpd') diff --git a/bgpd/Makefile.am b/bgpd/Makefile.am index 42f1f488..92fa10cd 100644 --- a/bgpd/Makefile.am +++ b/bgpd/Makefile.am @@ -4,7 +4,7 @@ AM_CPPFLAGS = -I.. -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_builddir)/lib DEFS = @DEFS@ -DSYSCONFDIR=\"$(sysconfdir)/\" INSTALL_SDATA=@INSTALL@ -m 600 -AM_CFLAGS = $(PICFLAGS) +AM_CFLAGS = $(PICFLAGS) $(WERROR) AM_LDFLAGS = $(PILDFLAGS) noinst_LIBRARIES = libbgp.a -- cgit v1.2.3 From 6ed810d986df5d843c89166fee6b73a71222b7bd Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Tue, 21 Apr 2015 10:13:07 +0200 Subject: *: fix more initialisers (for BSD) FreeBSD and NetBSD spew a few more warnings about variable initialisers. Found with OSR's/NetDEF's fancy new CI system. Signed-off-by: David Lamparter --- bgpd/bgp_routemap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bgpd') diff --git a/bgpd/bgp_routemap.c b/bgpd/bgp_routemap.c index 33f802c1..416a3e51 100644 --- a/bgpd/bgp_routemap.c +++ b/bgpd/bgp_routemap.c @@ -131,8 +131,8 @@ route_match_peer (void *rule, struct prefix *prefix, route_map_object_t type, void *object) { union sockunion *su; - union sockunion su_def = { .sin.sin_family = AF_INET, - .sin.sin_addr.s_addr = INADDR_ANY }; + union sockunion su_def = { .sin = { .sin_family = AF_INET, + .sin_addr.s_addr = INADDR_ANY } }; struct peer_group *group; struct peer *peer; struct listnode *node, *nnode; -- cgit v1.2.3