Date: Sat, 12 May 2007 18:30:01 +0200 From: Fredrik Lindberg <fli@FreeBSD.org> To: freebsd-net@freebsd.org Cc: jfvogel@gmail.com Subject: em_ioctl and SIOCGIFADDR Message-ID: <4645EB89.6030208@FreeBSD.org>
next in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format. --------------020804090506080608050002 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi I'm getting panics when doing a SIOCGIFADDR ioctl to a em device, verified with todays current. FreeBSD 7.0-CURRENT #16: Sat May 12 15:44:05 CEST 2007 The interface only had a auto configured ipv6 address and no ipv4 address at all. Both SIOCGIFADDR and SIOCSIFADDR take a struct ifreq as an argument, so one should dereference a struct ifreq in em_ioctl and not a struct ifaddr. At least this takes care of the panic. Fredrik Lindberg --------------020804090506080608050002 Content-Type: text/plain; name="if_em.c-20070512" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="if_em.c-20070512" Index: if_em.c =================================================================== RCS file: /home/ncvs/src/sys/dev/em/if_em.c,v retrieving revision 1.175 diff -u -u -r1.175 if_em.c --- if_em.c 11 May 2007 21:36:08 -0000 1.175 +++ if_em.c 12 May 2007 16:19:14 -0000 @@ -974,7 +974,7 @@ switch (command) { case SIOCSIFADDR: case SIOCGIFADDR: - if (ifa->ifa_addr->sa_family == AF_INET) { + if (ifr->ifr_addr.sa_family == AF_INET) { /* * XXX * Since resetting hardware takes a very long time --------------020804090506080608050002--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4645EB89.6030208>