|
| 1 | +diff --git a/zebra/zebra_fpm.c b/zebra/zebra_fpm.c |
| 2 | +index 7b0611bf9..b5582ea35 100644 |
| 3 | +--- a/zebra/zebra_fpm.c |
| 4 | ++++ b/zebra/zebra_fpm.c |
| 5 | +@@ -288,6 +288,9 @@ static void zfpm_start_connect_timer(const char *reason); |
| 6 | + static void zfpm_start_stats_timer(void); |
| 7 | + static void zfpm_mac_info_del(struct fpm_mac_info_t *fpm_mac); |
| 8 | + |
| 9 | ++static const char ipv4_ll_buf[16] = "169.254.0.1"; |
| 10 | ++union g_addr ipv4ll_gateway; |
| 11 | ++ |
| 12 | + /* |
| 13 | + * zfpm_thread_should_yield |
| 14 | + */ |
| 15 | +@@ -1988,6 +1991,9 @@ static int zfpm_init(struct thread_master *master) |
| 16 | + zfpm_stats_init(&zfpm_g->last_ivl_stats); |
| 17 | + zfpm_stats_init(&zfpm_g->cumulative_stats); |
| 18 | + |
| 19 | ++ memset(&ipv4ll_gateway, 0, sizeof(ipv4ll_gateway)); |
| 20 | ++ inet_pton(AF_INET, ipv4_ll_buf, &ipv4ll_gateway.ipv4); |
| 21 | ++ |
| 22 | + install_node(&zebra_node); |
| 23 | + install_element(ENABLE_NODE, &show_zebra_fpm_stats_cmd); |
| 24 | + install_element(ENABLE_NODE, &clear_zebra_fpm_stats_cmd); |
| 25 | +diff --git a/zebra/zebra_fpm_netlink.c b/zebra/zebra_fpm_netlink.c |
| 26 | +index 60ea7f97e..0f8ba5413 100644 |
| 27 | +--- a/zebra/zebra_fpm_netlink.c |
| 28 | ++++ b/zebra/zebra_fpm_netlink.c |
| 29 | +@@ -221,7 +221,12 @@ static int netlink_route_info_add_nh(struct netlink_route_info *ri, |
| 30 | + |
| 31 | + if (nexthop->type == NEXTHOP_TYPE_IPV6 |
| 32 | + || nexthop->type == NEXTHOP_TYPE_IPV6_IFINDEX) { |
| 33 | +- nhi.gateway = &nexthop->gate; |
| 34 | ++ /* Special handling for IPv4 route with IPv6 Link Local next hop |
| 35 | ++ */ |
| 36 | ++ if (ri->af == AF_INET) |
| 37 | ++ nhi.gateway = &ipv4ll_gateway; |
| 38 | ++ else |
| 39 | ++ nhi.gateway = &nexthop->gate; |
| 40 | + } |
| 41 | + |
| 42 | + if (nexthop->type == NEXTHOP_TYPE_IFINDEX) { |
| 43 | +diff --git a/zebra/zebra_fpm_private.h b/zebra/zebra_fpm_private.h |
| 44 | +index c169ee8c2..13415c7e1 100644 |
| 45 | +--- a/zebra/zebra_fpm_private.h |
| 46 | ++++ b/zebra/zebra_fpm_private.h |
| 47 | +@@ -97,6 +97,8 @@ extern int zfpm_netlink_encode_mac(struct fpm_mac_info_t *mac, char *in_buf, |
| 48 | + |
| 49 | + extern struct route_entry *zfpm_route_for_update(rib_dest_t *dest); |
| 50 | + |
| 51 | ++extern union g_addr ipv4ll_gateway; |
| 52 | ++ |
| 53 | + #ifdef __cplusplus |
| 54 | + } |
| 55 | + #endif |
0 commit comments