Date: Sat, 9 Apr 2011 10:19:26 +0000 (UTC) From: "Bjoern A. Zeeb" <bz@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r220476 - stable/8/usr.sbin/rtadvd Message-ID: <201104091019.p39AJQ82008817@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: bz Date: Sat Apr 9 10:19:25 2011 New Revision: 220476 URL: http://svn.freebsd.org/changeset/base/220476 Log: MFC r219184: Prevent crashes from a race when (cloned) interfaces go away. PR: bin/152143 Submitted by: Przemyslaw Frasunek (przemyslaw frasunek.com) Tested by: Przemyslaw Frasunek (przemyslaw frasunek.com) Modified: stable/8/usr.sbin/rtadvd/rtadvd.c Directory Properties: stable/8/usr.sbin/rtadvd/ (props changed) Modified: stable/8/usr.sbin/rtadvd/rtadvd.c ============================================================================== --- stable/8/usr.sbin/rtadvd/rtadvd.c Sat Apr 9 10:18:46 2011 (r220475) +++ stable/8/usr.sbin/rtadvd/rtadvd.c Sat Apr 9 10:19:25 2011 (r220476) @@ -667,14 +667,16 @@ rtadvd_input() } /* - * If we happen to receive data on an interface which is now down, - * just discard the data. + * If we happen to receive data on an interface which is now gone + * or down, just discard the data. */ - if ((iflist[pi->ipi6_ifindex]->ifm_flags & IFF_UP) == 0) { + if (iflist[pi->ipi6_ifindex] == NULL || + (iflist[pi->ipi6_ifindex]->ifm_flags & IFF_UP) == 0) { syslog(LOG_INFO, "<%s> received data on a disabled interface (%s)", __func__, - if_indextoname(pi->ipi6_ifindex, ifnamebuf)); + (iflist[pi->ipi6_ifindex] == NULL) ? "[gone]" : + if_indextoname(pi->ipi6_ifindex, ifnamebuf)); return; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201104091019.p39AJQ82008817>