diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2016-04-19 23:31:33 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2016-04-19 23:31:33 +0000 |
commit | 6d2f1ab40f2fa8813b579aeea7a0d7dd97e47a12 (patch) | |
tree | a638069aaa6df457777af54cd5a1364704af3e4c /sys/net/if_vlan_var.h | |
parent | 94f05de63943d09787168fee12c4337b5b688329 (diff) |
make setting a vlan interfaces lladdr more likely to work
the recent vlan code sets the vlan interfaces mac address to the
parent interfaces mac address when it is brought up, and resets it
when the vlan interface is brought down.
now, if you set a mac address manually (eg, ifconfig vlanX lladdr
f0:0b:a7:ba:2b:00), vlan(4) ignores the parents mac address and
never resets its own.
to make this work, setting a custom lladdr on a vlan interface makes
the parent interface promisc so the packets wont be filtered by the
hardware interface.
setting the mac address to 00:00:00:00:00:00 resets this behavior
and makes the interface inherit the parents mac again.
issue reported by and fix tested by paul de weerd
Diffstat (limited to 'sys/net/if_vlan_var.h')
-rw-r--r-- | sys/net/if_vlan_var.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/net/if_vlan_var.h b/sys/net/if_vlan_var.h index ea479f57bcf..9361a9f33bd 100644 --- a/sys/net/if_vlan_var.h +++ b/sys/net/if_vlan_var.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_vlan_var.h,v 1.35 2016/04/15 04:34:10 dlg Exp $ */ +/* $OpenBSD: if_vlan_var.h,v 1.36 2016/04/19 23:31:32 dlg Exp $ */ /* * Copyright 1998 Massachusetts Institute of Technology @@ -81,7 +81,8 @@ struct ifvlan { #define ifv_tag ifv_mib.ifvm_tag #define ifv_prio ifv_mib.ifvm_prio #define ifv_type ifv_mib.ifvm_type -#define IFVF_PROMISC 0x01 +#define IFVF_PROMISC 0x01 /* the parent should be made promisc */ +#define IFVF_LLADDR 0x02 /* don't inherit the parents mac */ struct mbuf *vlan_inject(struct mbuf *, uint16_t, uint16_t); #endif /* _KERNEL */ |