zebra: use AF_INET for protocol family

When looking up the conversion from kernel protocol to
internal protocol family make sure we use the correct
AF_INET( what the kernel uses ) instead of AFI_IP (which
is what FRR uses ).

Routes from OSPF will show up from the kernel as OSPF6 instead of
OSPF.  Which will cause mayhem

Ticket: CM-33306
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
Donald Sharp 2021-02-16 15:54:08 -05:00
parent 0fec6da172
commit d6816f68bd

View File

@ -288,8 +288,8 @@ static inline int proto2zebra(int proto, int family, bool is_nexthop)
proto = ZEBRA_ROUTE_BGP;
break;
case RTPROT_OSPF:
proto = (family == AFI_IP) ? ZEBRA_ROUTE_OSPF
: ZEBRA_ROUTE_OSPF6;
proto = (family == AF_INET) ? ZEBRA_ROUTE_OSPF
: ZEBRA_ROUTE_OSPF6;
break;
case RTPROT_ISIS:
proto = ZEBRA_ROUTE_ISIS;