Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 May 2017 11:05:57 +0530
From:      "Kristof Provost" <kristof@sigsegv.be>
To:        "Ravi Pokala" <rpokala@FreeBSD.org>
Cc:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r318160 - in head: sbin/ifconfig sys/net sys/sys
Message-ID:  <3F09C117-5017-481D-AAB2-7C64FF23B395@sigsegv.be>
In-Reply-To: <201705102213.v4AMDlE2074710@repo.freebsd.org>
References:  <201705102213.v4AMDlE2074710@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 11 May 2017, at 3:43, Ravi Pokala wrote:
> Author: rpokala
> Date: Wed May 10 22:13:47 2017
> New Revision: 318160
> URL: https://svnweb.freebsd.org/changeset/base/318160
>
> Log:
>   Persistently store NIC's hardware MAC address, and add a way to 
> retrive it
>

> Modified: head/sys/net/if_ethersubr.c
> ==============================================================================
> --- head/sys/net/if_ethersubr.c	Wed May 10 21:42:16 2017	(r318159)
> +++ head/sys/net/if_ethersubr.c	Wed May 10 22:13:47 2017	(r318160)
> @@ -916,6 +916,8 @@ ether_ifattach(struct ifnet *ifp, const
>  	sdl->sdl_alen = ifp->if_addrlen;
>  	bcopy(lla, LLADDR(sdl), ifp->if_addrlen);
>
> +	bcopy(lla, ifp->if_hw_addr, ifp->if_addrlen);
> +
>  	bpfattach(ifp, DLT_EN10MB, ETHER_HDR_LEN);
>  	if (ng_ether_attach_p != NULL)
>  		(*ng_ether_attach_p)(ifp);
>

This seems to cause panics when I create a bridge interface:

#10 0xffffffff80ef9304 in bcopy () at 
/usr/src/sys/amd64/amd64/support.S:139
#11 0xffffffff80b57a80 in ether_ifattach (ifp=0xfffff80035663000, 
lla=0xfffff800090e13f8 "\002k") at /usr/src/sys/net/if_ethersubr.c:919
#12 0xffffffff8325dc67 in bridge_clone_create (ifc=<value optimized 
out>, unit=<value optimized out>, params=<value optimized out>) at 
/usr/src/sys/net/if_bridge.c:704
#13 0xffffffff80b54f54 in if_clone_createif (ifc=0xfffff80035081500, 
name=0xfffffe03e7936780 "bridge0", len=<value optimized out>, 
params=0x0) at /usr/src/sys/net/if_clone.c:685
#14 0xffffffff80b50833 in ifioctl (so=<value optimized out>, 
cmd=3223349628, data=<value optimized out>, td=<value optimized out>) at 
/usr/src/sys/net/if.c:2794
#15 0xffffffff80abc00d in kern_ioctl (td=<value optimized out>, 
fd=<value optimized out>, com=<value optimized out>, data=<value 
optimized out>) at file.h:323
#16 0xffffffff80abbccf in sys_ioctl (td=<value optimized out>, 
uap=0xfffffe03e7936930) at /usr/src/sys/kern/sys_generic.c:745
#17 0xffffffff80efc059 in amd64_syscall (td=0xfffff80009114000, 
traced=0) at subr_syscall.c:136
#18 0xffffffff80edd09b in Xfast_syscall () at 
/usr/src/sys/amd64/amd64/exception.S:396

ifp->if_hw_addr is NULL here:
(kgdb) fr 11
#11 0xffffffff80b57a80 in ether_ifattach (ifp=0xfffff80035663000, 
lla=0xfffff800090e13f8 "\002k") at /usr/src/sys/net/if_ethersubr.c:919
919             bcopy(lla, ifp->if_hw_addr, ifp->if_addrlen);
(kgdb) p ifp->if_hw_addr
$1 = (void *) 0x0

Regards,
Kristof



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3F09C117-5017-481D-AAB2-7C64FF23B395>