<sigh> Hit send too soon. To finish off my point. If we ever get smart and move the #defines to an enum then the switch statement would allow us to catch missed new states via compiler warnings.
donald On Wed, Jan 6, 2016 at 8:52 AM, Donald Sharp <[email protected]> wrote: > Then > > switch (vty->node) > { > case ....: > case ....: > return AFI_IP6; > default: > return AFI_IP; > } > > donald > > On Wed, Jan 6, 2016 at 8:48 AM, Lou Berger <[email protected]> wrote: > >> Donald, >> Thanks for the review. See below. >> >> On 1/6/2016 8:31 AM, Donald Sharp wrote: >> > Comments Inline.... >> > >> > >> > On Thu, Dec 24, 2015 at 1:10 PM, Lou Berger <[email protected] >> > <mailto:[email protected]>> wrote: >> > >> > This is part of the core VPN and Encap SAFI changes. >> > >> > diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c >> > index 5330a22..20aaec6 100644 >> > --- a/bgpd/bgp_vty.c >> > +++ b/bgpd/bgp_vty.c >> > @@ -56,8 +56,15 @@ extern struct in_addr router_id_zebra; >> > afi_t >> > bgp_node_afi (struct vty *vty) >> > { >> > - if (vty->node == BGP_IPV6_NODE || vty->node == BGP_IPV6M_NODE) >> > - return AFI_IP6; >> > + switch (vty->node) >> > + { >> > + case BGP_IPV6_NODE: >> > + case BGP_IPV6M_NODE: >> > + case BGP_VPNV6_NODE: >> > + return AFI_IP6; >> > + break; >> > + } >> > + >> > return AFI_IP; >> > } >> > >> > >> > The return AFI_IP should be inside of the switch statement with the >> > correct cases. >> > >> >> Why? The current code basically = default to v4. >> >> > >> > >> > @@ -66,6 +73,8 @@ bgp_node_afi (struct vty *vty) >> > safi_t >> > bgp_node_safi (struct vty *vty) >> > { >> > + if (vty->node == BGP_VPNV6_NODE) >> > + return SAFI_MPLS_VPN; >> > if (vty->node == BGP_VPNV4_NODE) >> > return SAFI_MPLS_VPN; >> > >> > >> > Should this be a switch statement as well? >> > >> >> Yes. will update patch. >> >> > Everything else looks good, though. >> > >> > donald >> Thanks, >> Lou >> >> >
_______________________________________________ Quagga-dev mailing list [email protected] https://lists.quagga.net/mailman/listinfo/quagga-dev
