diff options
author | Andrew Thompson <thompsa@FreeBSD.org> | 2006-11-09 06:32:38 +0000 |
---|---|---|
committer | Andrew Thompson <thompsa@FreeBSD.org> | 2006-11-09 06:32:38 +0000 |
commit | 3df7fad0cfacfde79974d7963938924212aee329 (patch) | |
tree | cf54c5483f37944549b7a3563be875b05ec80027 /sbin/ifconfig/ifbridge.c | |
parent | afe898bca2850b1aa5aece0e0a0b3826348dc775 (diff) |
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.
Notes
Notes:
svn path=/head/; revision=164112
Diffstat (limited to 'sbin/ifconfig/ifbridge.c')
-rw-r--r-- | sbin/ifconfig/ifbridge.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/sbin/ifconfig/ifbridge.c b/sbin/ifconfig/ifbridge.c index 3f708b2c2eb8..1100aab26b86 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), |