-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix IPv4 routes with IPv6 link local next hops installed in FPM #8740
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
fae1092
Description: Currently IPv4 routes with IPv6 link local next hops are
nkelapur 1675cf8
Description: Currently IPv4 routes with IPv6 link local next hops are
nkelapur 9a841dd
Merge branch 'master' into master
nkelapur cb89cba
Delete 0010-Ipv4-Link-local-address-for-Ipv6-linl-local-nexthop.patch
nkelapur 78d703e
Update series
nkelapur File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
55 changes: 55 additions & 0 deletions
55
src/sonic-frr/patch/0011-Ipv4-Link-local-address-for-Ipv6-linl-local-nexthop.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
diff --git a/zebra/zebra_fpm.c b/zebra/zebra_fpm.c | ||
index 7b0611bf9..b5582ea35 100644 | ||
--- a/zebra/zebra_fpm.c | ||
+++ b/zebra/zebra_fpm.c | ||
@@ -288,6 +288,9 @@ static void zfpm_start_connect_timer(const char *reason); | ||
static void zfpm_start_stats_timer(void); | ||
static void zfpm_mac_info_del(struct fpm_mac_info_t *fpm_mac); | ||
|
||
+static const char ipv4_ll_buf[16] = "169.254.0.1"; | ||
+union g_addr ipv4ll_gateway; | ||
+ | ||
/* | ||
* zfpm_thread_should_yield | ||
*/ | ||
@@ -1988,6 +1991,9 @@ static int zfpm_init(struct thread_master *master) | ||
zfpm_stats_init(&zfpm_g->last_ivl_stats); | ||
zfpm_stats_init(&zfpm_g->cumulative_stats); | ||
|
||
+ memset(&ipv4ll_gateway, 0, sizeof(ipv4ll_gateway)); | ||
+ inet_pton(AF_INET, ipv4_ll_buf, &ipv4ll_gateway.ipv4); | ||
+ | ||
install_node(&zebra_node); | ||
install_element(ENABLE_NODE, &show_zebra_fpm_stats_cmd); | ||
install_element(ENABLE_NODE, &clear_zebra_fpm_stats_cmd); | ||
diff --git a/zebra/zebra_fpm_netlink.c b/zebra/zebra_fpm_netlink.c | ||
index 60ea7f97e..0f8ba5413 100644 | ||
--- a/zebra/zebra_fpm_netlink.c | ||
+++ b/zebra/zebra_fpm_netlink.c | ||
@@ -221,7 +221,12 @@ static int netlink_route_info_add_nh(struct netlink_route_info *ri, | ||
|
||
if (nexthop->type == NEXTHOP_TYPE_IPV6 | ||
|| nexthop->type == NEXTHOP_TYPE_IPV6_IFINDEX) { | ||
- nhi.gateway = &nexthop->gate; | ||
+ /* Special handling for IPv4 route with IPv6 Link Local next hop | ||
+ */ | ||
+ if (ri->af == AF_INET) | ||
+ nhi.gateway = &ipv4ll_gateway; | ||
+ else | ||
+ nhi.gateway = &nexthop->gate; | ||
} | ||
|
||
if (nexthop->type == NEXTHOP_TYPE_IFINDEX) { | ||
diff --git a/zebra/zebra_fpm_private.h b/zebra/zebra_fpm_private.h | ||
index c169ee8c2..13415c7e1 100644 | ||
--- a/zebra/zebra_fpm_private.h | ||
+++ b/zebra/zebra_fpm_private.h | ||
@@ -97,6 +97,8 @@ extern int zfpm_netlink_encode_mac(struct fpm_mac_info_t *mac, char *in_buf, | ||
|
||
extern struct route_entry *zfpm_route_for_update(rib_dest_t *dest); | ||
|
||
+extern union g_addr ipv4ll_gateway; | ||
+ | ||
#ifdef __cplusplus | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the purpose for this
g_addr ipv4ll_gateway
?