From a31ee03bbe5d140c7e3ace91cc33e5841b3120f2 Mon Sep 17 00:00:00 2001 From: Akhilesh Samineni <47657796+AkhileshSamineni@users.noreply.github.com> Date: Tue, 20 Jul 2021 20:23:34 +0530 Subject: [PATCH] FRR patches to support IPv6 Link local enhancements. (#5584) As per HLD - Azure/SONiC#625 FRR Patches: 0009-Link-local-scope-was-not-set-while-binding-socket-for-bgp-ipv6-link-local-neighbors.patch Files modified : bgpd_network.c and bgpd/bgp_zebra.c Fix for : Link local scope was not set while binding socket with local address causing socket errors for bgp ipv6 link local neighbors. 0010-VRF-interface-lookup-was-still-done-in-the-default-vrf.patch Files modified : staticd/static_zebra.c Fix for : VRF interface lookup was still done in the default-vrf which was causing the interface lookup to fail. Due to this static-route pointing to link-local was not getting installed. 0011-Changes-to-send-ipv6-link-local-address-as-nexthop-to-fpmsyncd.patch Files modified : zebra/zebra_fpm_netlink.c Fix for : Made changes to send ipv6 address as nexthop to fpmsyncd. Depends on: Azure/sonic-utilities#1159 Azure/sonic-swss#1463 Signed-off-by: Akhilesh Samineni akhilesh.samineni@broadcom.com --- ...et-for-bgp-ipv6-link-local-neighbors.patch | 44 +++++++++++++++++++ src/sonic-frr/patch/series | 1 + 2 files changed, 45 insertions(+) create mode 100644 src/sonic-frr/patch/0009-Link-local-scope-was-not-set-while-binding-socket-for-bgp-ipv6-link-local-neighbors.patch diff --git a/src/sonic-frr/patch/0009-Link-local-scope-was-not-set-while-binding-socket-for-bgp-ipv6-link-local-neighbors.patch b/src/sonic-frr/patch/0009-Link-local-scope-was-not-set-while-binding-socket-for-bgp-ipv6-link-local-neighbors.patch new file mode 100644 index 0000000000..82a1b26fb9 --- /dev/null +++ b/src/sonic-frr/patch/0009-Link-local-scope-was-not-set-while-binding-socket-for-bgp-ipv6-link-local-neighbors.patch @@ -0,0 +1,44 @@ +From 4b45abcdb107c8c5d58fd63a2616c54c800305b3 Mon Sep 17 00:00:00 2001 +From: Akhilesh Samineni +Date: Mon, 5 Apr 2021 13:21:40 -0700 +Subject: [PATCH] Link local scope was not set while binding socket with local + address causing socket errors for bgp ipv6 link local neighbors. + +--- + bgpd/bgp_network.c | 5 +++++ + bgpd/bgp_zebra.c | 3 +++ + 2 files changed, 8 insertions(+) + +diff --git a/bgpd/bgp_network.c b/bgpd/bgp_network.c +index 6a5c2c4b3..d7047a154 100644 +--- a/bgpd/bgp_network.c ++++ b/bgpd/bgp_network.c +@@ -556,6 +556,11 @@ static int bgp_update_address(struct interface *ifp, const union sockunion *dst, + return 1; + + prefix2sockunion(sel, addr); ++ ++ if (IN6_IS_ADDR_LINKLOCAL(&addr->sin6.sin6_addr)) { ++ addr->sin6.sin6_scope_id = ifp->ifindex; ++ } ++ + return 0; + } + +diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c +index e42d6ee26..8e9fa8903 100644 +--- a/bgpd/bgp_zebra.c ++++ b/bgpd/bgp_zebra.c +@@ -814,6 +814,9 @@ bool bgp_zebra_nexthop_set(union sockunion *local, union sockunion *remote, + ? peer->conf_if + : peer->ifname, + peer->bgp->vrf_id); ++ else if (peer->update_if) ++ ifp = if_lookup_by_name(peer->update_if, ++ peer->bgp->vrf_id); + } else if (peer->update_if) + ifp = if_lookup_by_name(peer->update_if, + peer->bgp->vrf_id); +-- +2.18.0 + diff --git a/src/sonic-frr/patch/series b/src/sonic-frr/patch/series index 29d3508149..2837a79f24 100644 --- a/src/sonic-frr/patch/series +++ b/src/sonic-frr/patch/series @@ -6,3 +6,4 @@ 0007-frr-remove-frr-log-outchannel-to-var-log-frr.log.patch 0008-Add-support-of-bgp-l3vni-evpn.patch 0009-Add-bgp-bestpath-peer-type-multipath-relax.patch +0009-Link-local-scope-was-not-set-while-binding-socket-for-bgp-ipv6-link-local-neighbors.patch