modernize backfire 10.03 so it can be operational again
[openwrt-10.03/.git] / package / quagga / patches-upstream / 400-vpnv4_stat_fix.patch
1 From d1854f883508bb8d3637a85dbbb05e0c704552da Mon Sep 17 00:00:00 2001
2 From: Donald Sharp <sharpd@cumulusnetworks.com>
3 Date: Tue, 26 Jan 2016 04:38:53 +0000
4 Subject: bgpd: Fix 'show bgp ipv4 vpnv4 statistics' cli.
5
6 When attempting to use the 'show bgp ipv4 vpnv4 statistics' cli, the safi
7 choosen is BGP_MPLS_LABELED_VPN which is #defined to 128.  The afi/safi
8 combination is fed to bgp->rib, which limits the size of the safi to BGP_SAFI_MAX
9 which is #defined to 5.   The correct value to use is BGP_MPLS_VPN
10
11 The bgp code differentiates between the actual safi value for BGP_MPLS_LABELED_VPN
12 used defined by RFC 4364, to a internal SAFI value used to limit array size.
13
14 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
15 Tested-by: NetDEF CI System <cisystem@netdef.org>
16 ---
17 --- a/bgpd/bgp_route.c
18 +++ b/bgpd/bgp_route.c
19 @@ -11794,7 +11794,8 @@ bgp_table_stats (struct vty *vty, struct
20    
21    if (!bgp->rib[afi][safi])
22      {
23 -      vty_out (vty, "%% No RIB exists for the AFI/SAFI%s", VTY_NEWLINE);
24 +      vty_out (vty, "%% No RIB exists for the specified AFI(%d)/SAFI(%d) %s",
25 +               afi, safi, VTY_NEWLINE);
26        return CMD_WARNING;
27      }
28    
29 @@ -11908,7 +11909,7 @@ bgp_table_stats_vty (struct vty *vty, co
30             safi = SAFI_UNICAST;
31             break;
32         case 'v':
33 -           safi =  SAFI_MPLS_LABELED_VPN;
34 +           safi =  SAFI_MPLS_VPN;
35             break;
36         case 'e':
37             safi = SAFI_ENCAP;