summaryrefslogtreecommitdiff
path: root/zebra/zapi_msg.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2020-01-20 16:53:34 -0500
committerDonald Sharp <sharpd@cumulusnetworks.com>2020-01-22 17:10:20 -0500
commit54bea4e5379e6b4e9fd7db52d5e5a3780aae349c (patch)
tree5b1edd83c0a67f56ad72080ed444f12de5232017 /zebra/zapi_msg.c
parentabe5af17744fa1775430aed978ac058dd011a4e1 (diff)
zebra: Re-add onlink flag due to loss in earlier commit
commit: 0eb97b860dc94329cf9add9f8f3d3a2c7f539568 Removed this chunk of code in zebra: - if (ifp) - if (connected_is_unnumbered(ifp)) - SET_FLAG(nexthop->flags, NEXTHOP_FLAG_ONLINK); Effectively if we had a NEXTHOP_TYPE_IPV4_IFINDEX we would auto set the onlink flag. This commit dropped it for some reason. Add it back in an intelligent manner. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'zebra/zapi_msg.c')
-rw-r--r--zebra/zapi_msg.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c
index db54e6f25b..e3feddba52 100644
--- a/zebra/zapi_msg.c
+++ b/zebra/zapi_msg.c
@@ -65,6 +65,7 @@
#include "zebra/zapi_msg.h"
#include "zebra/zebra_errors.h"
#include "zebra/zebra_mlag.h"
+#include "zebra/connected.h"
/* Encoding helpers -------------------------------------------------------- */
@@ -1419,6 +1420,7 @@ static void zread_route_add(ZAPI_HANDLER_ARGS)
int i, ret;
vrf_id_t vrf_id;
struct ipaddr vtep_ip;
+ struct interface *ifp;
s = msg;
if (zapi_route_decode(s, &api) < 0) {
@@ -1511,6 +1513,9 @@ static void zread_route_add(ZAPI_HANDLER_ARGS)
&api_nh->gate.ipv4, NULL, ifindex,
api_nh->vrf_id);
+ ifp = if_lookup_by_index(ifindex, api_nh->vrf_id);
+ if (ifp && connected_is_unnumbered(ifp))
+ SET_FLAG(nexthop->flags, NEXTHOP_FLAG_ONLINK);
/* Special handling for IPv4 routes sourced from EVPN:
* the nexthop and associated MAC need to be installed.
*/