Re: svn commit: r318160 - in head: sbin/ifconfig sys/net sys/sys
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 0x80ef9304 in bcopy () at /usr/src/sys/amd64/amd64/support.S:139 #11 0x80b57a80 in ether_ifattach (ifp=0xf80035663000, lla=0xf800090e13f8 "\002k") at /usr/src/sys/net/if_ethersubr.c:919 #12 0x8325dc67 in bridge_clone_create (ifc=out>, unit=, params=) at /usr/src/sys/net/if_bridge.c:704 #13 0x80b54f54 in if_clone_createif (ifc=0xf80035081500, name=0xfe03e7936780 "bridge0", len=, params=0x0) at /usr/src/sys/net/if_clone.c:685 #14 0x80b50833 in ifioctl (so=, cmd=3223349628, data=, td=) at /usr/src/sys/net/if.c:2794 #15 0x80abc00d in kern_ioctl (td=, fd=, com=, data=optimized out>) at file.h:323 #16 0x80abbccf in sys_ioctl (td=, uap=0xfe03e7936930) at /usr/src/sys/kern/sys_generic.c:745 #17 0x80efc059 in amd64_syscall (td=0xf80009114000, traced=0) at subr_syscall.c:136 #18 0x80edd09b in Xfast_syscall () at /usr/src/sys/amd64/amd64/exception.S:396 ifp->if_hw_addr is NULL here: (kgdb) fr 11 #11 0x80b57a80 in ether_ifattach (ifp=0xf80035663000, lla=0xf800090e13f8 "\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 ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r318160 - in head: sbin/ifconfig sys/net sys/sys
On 11 May 2017, at 11:05, Kristof Provost wrote: 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 0x80ef9304 in bcopy () at /usr/src/sys/amd64/amd64/support.S:139 #11 0x80b57a80 in ether_ifattach (ifp=0xf80035663000, lla=0xf800090e13f8 "\002k") at /usr/src/sys/net/if_ethersubr.c:919 #12 0x8325dc67 in bridge_clone_create (ifc=out>, unit=, params=) at /usr/src/sys/net/if_bridge.c:704 #13 0x80b54f54 in if_clone_createif (ifc=0xf80035081500, name=0xfe03e7936780 "bridge0", len=, params=0x0) at /usr/src/sys/net/if_clone.c:685 #14 0x80b50833 in ifioctl (so=, cmd=3223349628, data=, td=) at /usr/src/sys/net/if.c:2794 #15 0x80abc00d in kern_ioctl (td=, fd=, com=, data=optimized out>) at file.h:323 #16 0x80abbccf in sys_ioctl (td=, uap=0xfe03e7936930) at /usr/src/sys/kern/sys_generic.c:745 #17 0x80efc059 in amd64_syscall (td=0xf80009114000, traced=0) at subr_syscall.c:136 #18 0x80edd09b in Xfast_syscall () at /usr/src/sys/amd64/amd64/exception.S:396 ifp->if_hw_addr is NULL here: (kgdb) fr 11 #11 0x80b57a80 in ether_ifattach (ifp=0xf80035663000, lla=0xf800090e13f8 "\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 This may be because I’ve not yet updated world, just the kernel, but clearly that still shouldn’t cause panics. Regards, Kristof ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r318160 - in head: sbin/ifconfig sys/net sys/sys
-Original Message- > From: on behalf of Kristof Provost > > Date: 2017-05-10, Wednesday at 22:38 > To: Ravi Pokala > Cc: , , > > Subject: Re: svn commit: r318160 - in head: sbin/ifconfig sys/net sys/sys > > On 11 May 2017, at 11:05, Kristof Provost wrote: >> 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 >>> >> >> This seems to cause panics when I create a bridge interface: >> >> #10 0x80ef9304 in bcopy () at >> /usr/src/sys/amd64/amd64/support.S:139 >> #11 0x80b57a80 in ether_ifattach (ifp=0xf80035663000, >> lla=0xf800090e13f8 "\002k") at /usr/src/sys/net/if_ethersubr.c:919 >> #12 0x8325dc67 in bridge_clone_create (ifc=> out>, unit=, params=) at >> /usr/src/sys/net/if_bridge.c:704 >> ... >> >> ifp->if_hw_addr is NULL here: >> (kgdb) fr 11 >> #11 0x80b57a80 in ether_ifattach (ifp=0xf80035663000, >> lla=0xf800090e13f8 "\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 >> > > This may be because I’ve not yet updated world, just the kernel, but > clearly that still shouldn’t cause panics. > > Regards, > Kristof No, this is purely a kernel mistake -- I forgot to add a NULL-check in ether_ifattach(). :-p Fixing now... -Ravi (rpokala@) ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r318160 - in head: sbin/ifconfig sys/net sys/sys
Fixed in r318176. Sorry for the breakage everyone. :-p -Ravi (rpokala@) -Original Message- From: Ravi Pokala Date: 2017-05-10, Wednesday at 22:47 To: Kristof Provost Cc: , , Subject: Re: svn commit: r318160 - in head: sbin/ifconfig sys/net sys/sys -Original Message- > From: on behalf of Kristof Provost > > Date: 2017-05-10, Wednesday at 22:38 > To: Ravi Pokala > Cc: , , > > Subject: Re: svn commit: r318160 - in head: sbin/ifconfig sys/net sys/sys > > On 11 May 2017, at 11:05, Kristof Provost wrote: >> 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 >>> >> >> This seems to cause panics when I create a bridge interface: >> >> #10 0x80ef9304 in bcopy () at >> /usr/src/sys/amd64/amd64/support.S:139 >> #11 0x80b57a80 in ether_ifattach (ifp=0xf80035663000, >> lla=0xf800090e13f8 "\002k") at /usr/src/sys/net/if_ethersubr.c:919 >> #12 0x8325dc67 in bridge_clone_create (ifc=> out>, unit=, params=) at >> /usr/src/sys/net/if_bridge.c:704 >> ... >> >> ifp->if_hw_addr is NULL here: >> (kgdb) fr 11 >> #11 0x80b57a80 in ether_ifattach (ifp=0xf80035663000, >> lla=0xf800090e13f8 "\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 >> > > This may be because I’ve not yet updated world, just the kernel, but > clearly that still shouldn’t cause panics. > > Regards, > Kristof No, this is purely a kernel mistake -- I forgot to add a NULL-check in ether_ifattach(). :-p Fixing now... -Ravi (rpokala@) ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"