From: David Lamparter Date: Tue, 3 Mar 2015 07:52:22 +0000 (+0100) Subject: bgpd: don't use #ifdef inside macro args X-Git-Tag: frr-2.0-rc1~636 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=63b75cdd34d01838049af3cd61b0bd760f44cafe;p=mirror%2Ffrr.git 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 (cherry picked from commit 94bad67cd8fe7ad023a40547a1153a414d70fa0a) Conflicts: bgpd/bgp_route.c --- diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 74969e0ec7..171b5c7add 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -9567,18 +9567,12 @@ ALIAS (show_ip_bgp_ipv4_community, DEFUN (show_bgp_instance_afi_safi_community_all, show_bgp_instance_afi_safi_community_all_cmd, -#ifdef HAVE_IPV6 "show bgp " BGP_INSTANCE_CMD " (ipv4|ipv6) (unicast|multicast) community", -#else - "show bgp " BGP_INSTANCE_CMD " ipv4 (unicast|multicast) community", -#endif SHOW_STR BGP_STR BGP_INSTANCE_HELP_STR "Address family\n" -#ifdef HAVE_IPV6 "Address family\n" -#endif "Address Family modifier\n" "Address Family modifier\n" "Display routes matching the communities\n") @@ -9595,30 +9589,19 @@ DEFUN (show_bgp_instance_afi_safi_community_all, return CMD_WARNING; } -#ifdef HAVE_IPV6 afi = (strncmp (argv[2], "ipv6", 4) == 0) ? AFI_IP6 : AFI_IP; safi = (strncmp (argv[3], "m", 1) == 0) ? SAFI_MULTICAST : SAFI_UNICAST; -#else - afi = AFI_IP; - safi = (strncmp (argv[2], "m", 1) == 0) ? SAFI_MULTICAST : SAFI_UNICAST; -#endif return bgp_show (vty, bgp, afi, safi, bgp_show_type_community_all, NULL, 0); } DEFUN (show_bgp_instance_afi_safi_community, show_bgp_instance_afi_safi_community_cmd, -#ifdef HAVE_IPV6 "show bgp " BGP_INSTANCE_CMD " (ipv4|ipv6) (unicast|multicast) community (AA:NN|local-AS|no-advertise|no-export)", -#else - "show bgp " BGP_INSTANCE_CMD " ipv4 (unicast|multicast) community (AA:NN|local-AS|no-advertise|no-export)", -#endif SHOW_STR BGP_STR BGP_INSTANCE_HELP_STR "Address family\n" -#ifdef HAVE_IPV6 "Address family\n" -#endif "Address family modifier\n" "Address family modifier\n" "Display routes matching the communities\n" @@ -9630,31 +9613,19 @@ DEFUN (show_bgp_instance_afi_safi_community, int afi; int safi; -#ifdef HAVE_IPV6 afi = (strncmp (argv[2], "ipv6", 4) == 0) ? AFI_IP6 : AFI_IP; safi = (strncmp (argv[3], "m", 1) == 0) ? SAFI_MULTICAST : SAFI_UNICAST; return bgp_show_community (vty, argv[1], argc-4, &argv[4], 0, afi, safi); -#else - afi = AFI_IP; - safi = (strncmp (argv[2], "m", 1) == 0) ? SAFI_MULTICAST : SAFI_UNICAST; - return bgp_show_community (vty, argv[1], argc-3, &argv[3], 0, afi, safi); -#endif } ALIAS (show_bgp_instance_afi_safi_community, show_bgp_instance_afi_safi_community2_cmd, -#ifdef HAVE_IPV6 "show bgp " BGP_INSTANCE_CMD " (ipv4|ipv6) (unicast|multicast) community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export)", -#else - "show bgp " BGP_INSTANCE_CMD " 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_INSTANCE_HELP_STR "Address family\n" -#ifdef HAVE_IPV6 "Address family\n" -#endif "Address family modifier\n" "Address family modifier\n" "Display routes matching the communities\n" @@ -9669,18 +9640,12 @@ ALIAS (show_bgp_instance_afi_safi_community, ALIAS (show_bgp_instance_afi_safi_community, show_bgp_instance_afi_safi_community3_cmd, -#ifdef HAVE_IPV6 "show bgp " BGP_INSTANCE_CMD " (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 " BGP_INSTANCE_CMD " 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_INSTANCE_HELP_STR "Address family\n" -#ifdef HAVE_IPV6 "Address family\n" -#endif "Address family modifier\n" "Address family modifier\n" "Display routes matching the communities\n" @@ -9699,18 +9664,12 @@ ALIAS (show_bgp_instance_afi_safi_community, ALIAS (show_bgp_instance_afi_safi_community, show_bgp_instance_afi_safi_community4_cmd, -#ifdef HAVE_IPV6 "show bgp " BGP_INSTANCE_CMD " (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 " BGP_INSTANCE_CMD " 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_INSTANCE_HELP_STR "Address family\n" -#ifdef HAVE_IPV6 "Address family\n" -#endif "Address family modifier\n" "Address family modifier\n" "Display routes matching the communities\n" @@ -12389,18 +12348,12 @@ ALIAS (show_ip_bgp_ipv4_neighbor_received_routes, DEFUN (show_bgp_instance_afi_safi_neighbor_adv_recd_routes, show_bgp_instance_afi_safi_neighbor_adv_recd_routes_cmd, -#ifdef HAVE_IPV6 "show bgp " BGP_INSTANCE_CMD " (ipv4|ipv6) (unicast|multicast) neighbors (A.B.C.D|X:X::X:X|WORD) (advertised-routes|received-routes) {json}", -#else - "show bgp " BGP_INSTANCE_CMD " ipv4 (unicast|multicast) neighbors (A.B.C.D|X:X::X:X|WORD) (advertised-routes|received-routes) {json}", -#endif SHOW_STR BGP_STR BGP_INSTANCE_HELP_STR "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"