diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/net/if_ethersubr.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index 7534a603006..5d013140805 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ethersubr.c,v 1.37 2000/06/02 15:44:56 jason Exp $ */ +/* $OpenBSD: if_ethersubr.c,v 1.38 2000/09/07 04:48:58 deraadt Exp $ */ /* $NetBSD: if_ethersubr.c,v 1.19 1996/05/07 02:40:30 thorpej Exp $ */ /* @@ -850,6 +850,19 @@ ether_ifattach(ifp) register struct ifaddr *ifa; register struct sockaddr_dl *sdl; + /* + * Any interface which provides a MAC address which is obviously + * invalid gets whacked, so that users will notice. + */ + if (ETHER_IS_MULTICAST(((struct arpcom *)ifp)->ac_enaddr)) { + ((struct arpcom *)ifp)->ac_enaddr[0] = 0x00; + ((struct arpcom *)ifp)->ac_enaddr[1] = 0xfe; + ((struct arpcom *)ifp)->ac_enaddr[2] = 0xe1; + ((struct arpcom *)ifp)->ac_enaddr[3] = 0xba; + ((struct arpcom *)ifp)->ac_enaddr[4] = 0xd0; + ((struct arpcom *)ifp)->ac_enaddr[5] = (u_char)arc4random(); + } + ifp->if_type = IFT_ETHER; ifp->if_addrlen = 6; ifp->if_hdrlen = 14; |