summaryrefslogtreecommitdiff
path: root/zebra/interface.c
diff options
context:
space:
mode:
authorLouis Scalbert <louis.scalbert@6wind.com>2024-01-11 11:24:20 +0100
committerLouis Scalbert <louis.scalbert@6wind.com>2024-01-24 10:05:29 +0100
commit2ee43c873eab781bdb7b226ebb0f8a7df32b214e (patch)
tree0c44aef991892f754c8dd5353329932f9e629f1f /zebra/interface.c
parent03d6a6d137aacc0bdc4dae2bd8d02c7afde37dd5 (diff)
lib,zebra: add zapi message to control noarp flag
Add a ZAPI message to control the setting of the IFF_NOARP flag. Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Diffstat (limited to 'zebra/interface.c')
-rw-r--r--zebra/interface.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/zebra/interface.c b/zebra/interface.c
index 4c6fc8c36a..9be4b469e7 100644
--- a/zebra/interface.c
+++ b/zebra/interface.c
@@ -3662,6 +3662,27 @@ DEFUN (show_interface_desc_vrf_all,
return CMD_SUCCESS;
}
+void if_arp(struct interface *ifp, bool enable)
+{
+ int ret;
+
+ if (!CHECK_FLAG(ifp->status, ZEBRA_INTERFACE_ACTIVE))
+ return;
+
+ if (enable)
+ ret = if_unset_flags(ifp, IFF_NOARP);
+ else
+ ret = if_set_flags(ifp, IFF_NOARP);
+
+ if (ret < 0) {
+ zlog_debug("Can't %sset noarp flag on interface %s",
+ enable ? "" : "un", ifp->name);
+ return;
+ }
+
+ if_refresh(ifp);
+}
+
int if_multicast_set(struct interface *ifp)
{
struct zebra_if *if_data;