summaryrefslogtreecommitdiffstats
path: root/sbin/ifconfig/ifbridge.c
diff options
context:
space:
mode:
authorthompsa <thompsa@FreeBSD.org>2006-11-09 06:32:38 +0000
committerthompsa <thompsa@FreeBSD.org>2006-11-09 06:32:38 +0000
commite6cf955ad4f3c344435f4523de9215f577f8c646 (patch)
treecf54c5483f37944549b7a3563be875b05ec80027 /sbin/ifconfig/ifbridge.c
parent2294e5e2a949e36f69b95aeea4f26f4a817f0e57 (diff)
downloadFreeBSD-src-e6cf955ad4f3c344435f4523de9215f577f8c646.zip
FreeBSD-src-e6cf955ad4f3c344435f4523de9215f577f8c646.tar.gz
Add a new address cache type called sticky. On an interface marked sticky any
address learned by the bridge is made permanent, the address will not age out and most importantly will not migrate to another interface. This can be used to stop mac address poisoning or clients roaming in much the same way as static entries without the hassle of preloading the table.
Diffstat (limited to 'sbin/ifconfig/ifbridge.c')
-rw-r--r--sbin/ifconfig/ifbridge.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/sbin/ifconfig/ifbridge.c b/sbin/ifconfig/ifbridge.c
index 3f708b2..1100aab 100644
--- a/sbin/ifconfig/ifbridge.c
+++ b/sbin/ifconfig/ifbridge.c
@@ -321,6 +321,20 @@ unsetbridge_learn(const char *val, int d, int s, const struct afswtch *afp)
}
static void
+setbridge_sticky(const char *val, int d, int s, const struct afswtch *afp)
+{
+
+ do_bridgeflag(s, val, IFBIF_STICKY, 1);
+}
+
+static void
+unsetbridge_sticky(const char *val, int d, int s, const struct afswtch *afp)
+{
+
+ do_bridgeflag(s, val, IFBIF_STICKY, 0);
+}
+
+static void
setbridge_span(const char *val, int d, int s, const struct afswtch *afp)
{
struct ifbreq req;
@@ -639,6 +653,8 @@ static struct cmd bridge_cmds[] = {
DEF_CMD_ARG("-discover", unsetbridge_discover),
DEF_CMD_ARG("learn", setbridge_learn),
DEF_CMD_ARG("-learn", unsetbridge_learn),
+ DEF_CMD_ARG("sticky", setbridge_sticky),
+ DEF_CMD_ARG("-sticky", unsetbridge_sticky),
DEF_CMD_ARG("span", setbridge_span),
DEF_CMD_ARG("-span", unsetbridge_span),
DEF_CMD_ARG("stp", setbridge_stp),
OpenPOWER on IntegriCloud