diff options
author | Philippe Guibert <philippe.guibert@6wind.com> | 2019-12-16 13:34:00 +0100 |
---|---|---|
committer | Philippe Guibert <philippe.guibert@6wind.com> | 2021-04-09 18:29:58 +0200 |
commit | 541025d6ffe2bee713cef8d5572a15d2b3dc5d11 (patch) | |
tree | c6c3ca7d13cdf247d344a597902f750f932a3b38 /zebra/zapi_msg.c | |
parent | zebra: fixes NDA_DST in netlink_neigh_update() function (diff) | |
download | frr-541025d6ffe2bee713cef8d5572a15d2b3dc5d11.tar.xz frr-541025d6ffe2bee713cef8d5572a15d2b3dc5d11.zip |
zebra: handler for configuring neighbor table
neighbor table api in zebra is added. a netlink api is created for that.
the handler is called from the api defined in the previous commit.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Diffstat (limited to '')
-rw-r--r-- | zebra/zapi_msg.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c index 909b3b8ac..e880a6d7b 100644 --- a/zebra/zapi_msg.c +++ b/zebra/zapi_msg.c @@ -3279,6 +3279,28 @@ stream_failure: return; } +static inline void zebra_configure_arp(ZAPI_HANDLER_ARGS) +{ + struct stream *s; + int fam; + ifindex_t idx; + struct interface *ifp; + ns_id_t ns_id; + + s = msg; + STREAM_GETC(s, fam); + if (fam != AF_INET && fam != AF_INET6) + return; + STREAM_GETL(s, idx); + ifp = if_lookup_by_index_per_ns(zvrf->zns, idx); + if (!ifp) + return; + ns_id = zvrf->zns->ns_id; + kernel_configure_arp(ifp, fam, ns_id); +stream_failure: + return; +} + static inline void zebra_neigh_add(ZAPI_HANDLER_ARGS) { struct stream *s; @@ -3513,6 +3535,7 @@ void (*const zserv_handlers[])(ZAPI_HANDLER_ARGS) = { [ZEBRA_NEIGH_DEL] = zebra_neigh_del, [ZEBRA_NHRP_NEIGH_REGISTER] = zebra_neigh_register, [ZEBRA_NHRP_NEIGH_UNREGISTER] = zebra_neigh_unregister, + [ZEBRA_CONFIGURE_ARP] = zebra_configure_arp, }; /* |