Skip to content

Commit

Permalink
Fix for nexthop as IPv4 mapped IPv6 address
Browse files Browse the repository at this point in the history
1. Indentation resolved on conflict merge.

Signed-off-by: Kaushik <kaushik@niralnetworks.com>
  • Loading branch information
KaushikNiral committed Jul 29, 2020
1 parent 8f826f1 commit bc64f54
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
22 changes: 11 additions & 11 deletions zebra/rt_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -1051,19 +1051,19 @@ static bool _netlink_route_add_gateway_info(uint8_t route_family,
bytelen + 2))
return false;
} else {
if (!(nexthop->rparent
if (!(nexthop->rparent
&& IS_MAPPED_IPV6(&nexthop->rparent->gate.ipv6))) {
if (gw_family == AF_INET) {
if (!nl_attr_put(nlmsg, req_size, RTA_GATEWAY,
&nexthop->gate.ipv4, bytelen))
return false;
} else {
if (!nl_attr_put(nlmsg, req_size, RTA_GATEWAY,
&nexthop->gate.ipv6, bytelen))
return false;
}
}
}
if (!nl_attr_put(nlmsg, req_size, RTA_GATEWAY,
&nexthop->gate.ipv4, bytelen))
return false;
} else {
if (!nl_attr_put(nlmsg, req_size, RTA_GATEWAY,
&nexthop->gate.ipv6, bytelen))
return false;
}
}
}
return true;
}

Expand Down
6 changes: 3 additions & 3 deletions zebra/zebra_fpm_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -427,10 +427,10 @@ static int netlink_route_info_encode(struct netlink_route_info *ri,
ipv4_to_ipv4_mapped_ipv6(&ipv6,
nhi->gateway->ipv4);
nl_attr_put(&req->n, in_buf_len, RTA_GATEWAY,
&ipv6, bytelen);
&ipv6, bytelen);
} else
nl_attr_put(&req->n, in_buf_len, RTA_GATEWAY,
nhi->gateway, bytelen);
nl_attr_put(&req->n, in_buf_len, RTA_GATEWAY,
nhi->gateway, bytelen);
}

if (nhi->if_index) {
Expand Down

0 comments on commit bc64f54

Please sign in to comment.