From owner-svn-src-all@freebsd.org Mon Dec 14 19:44:50 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82D3AA43D6C; Mon, 14 Dec 2015 19:44:50 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 503B31C78; Mon, 14 Dec 2015 19:44:50 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBEJinMc008067; Mon, 14 Dec 2015 19:44:49 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBEJinv9008065; Mon, 14 Dec 2015 19:44:49 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201512141944.tBEJinv9008065@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Mon, 14 Dec 2015 19:44:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292219 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2015 19:44:50 -0000 Author: kp Date: Mon Dec 14 19:44:49 2015 New Revision: 292219 URL: https://svnweb.freebsd.org/changeset/base/292219 Log: inet6: Do not assume every interface has ip6 enabled. Certain interfaces (e.g. pfsync0) do not have ip6 addresses (in other words, ifp->if_afdata[AF_INET6] is NULL). Ensure we don't panic when the MTU is updated. pfsync interfaces will never have ip6 support, because it's explicitly disabled in in6_domifattach(). PR: 205194 Reviewed by: melifaro, hrs Differential Revision: https://reviews.freebsd.org/D4522 Modified: head/sys/netinet6/in6.c head/sys/netinet6/nd6.c Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Mon Dec 14 19:40:47 2015 (r292218) +++ head/sys/netinet6/in6.c Mon Dec 14 19:44:49 2015 (r292219) @@ -2432,6 +2432,8 @@ in6_domifattach(struct ifnet *ifp) int in6_domifmtu(struct ifnet *ifp) { + if (ifp->if_afdata[AF_INET6] == NULL) + return ifp->if_mtu; return (IN6_LINKMTU(ifp)); } Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Mon Dec 14 19:40:47 2015 (r292218) +++ head/sys/netinet6/nd6.c Mon Dec 14 19:44:49 2015 (r292219) @@ -285,6 +285,8 @@ nd6_ifdetach(struct nd_ifinfo *nd) void nd6_setmtu(struct ifnet *ifp) { + if (ifp->if_afdata[AF_INET6] == NULL) + return; nd6_setmtu0(ifp, ND_IFINFO(ifp)); }