Skip to content

Commit 1dfc386

Browse files
committed
Fix for nexthop as IPv4 mapped IPv6 address
1. Macro name change to IS_MAPPED_IPV6. 2. Minor change in zebra/rt_netlink.c on a conditional statement. Signed-off-by: Kaushik <kaushik@niralnetworks.com>
1 parent 32d7ac0 commit 1dfc386

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

bgpd/bgp_nht.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -552,8 +552,7 @@ static int make_prefix(int afi, struct bgp_path_info *pi, struct prefix *p)
552552
p->u.prefix4 = p_orig->u.prefix4;
553553
p->prefixlen = p_orig->prefixlen;
554554
} else {
555-
if (IS_MAPPED_IPV6(
556-
&pi->attr->mp_nexthop_global)) {
555+
if (IS_MAPPED_IPV6(&pi->attr->mp_nexthop_global)) {
557556
ipv4_mapped_ipv6_to_ipv4(
558557
&pi->attr->mp_nexthop_global, &ipv4);
559558
p->u.prefix4 = ipv4;

zebra/rt_netlink.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1048,7 +1048,7 @@ static void _netlink_route_nl_add_gateway_info(uint8_t route_family,
10481048
} else {
10491049

10501050
if (!(nexthop->rparent
1051-
&& IS_MAPPED_IPV6(&nexthop->rparent->gate.ipv6))) {
1051+
&& IS_MAPPED_IPV6(&nexthop->rparent->gate.ipv6))) {
10521052
if (gw_family == AF_INET)
10531053
addattr_l(nlmsg, req_size, RTA_GATEWAY,
10541054
&nexthop->gate.ipv4, bytelen);

0 commit comments

Comments
 (0)