From 541025d6ffe2bee713cef8d5572a15d2b3dc5d11 Mon Sep 17 00:00:00 2001 From: Philippe Guibert Date: Mon, 16 Dec 2019 13:34:00 +0100 Subject: 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 --- zebra/zapi_msg.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'zebra/zapi_msg.c') 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, }; /* -- cgit v1.2.3