From owner-svn-src-all@freebsd.org Sat May 14 23:32:04 2016 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 899C3B3BD3D; Sat, 14 May 2016 23:32:04 +0000 (UTC) (envelope-from pfg@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 5758810D0; Sat, 14 May 2016 23:32:04 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4ENW3ba087045; Sat, 14 May 2016 23:32:03 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4ENW3qs087044; Sat, 14 May 2016 23:32:03 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605142332.u4ENW3qs087044@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 14 May 2016 23:32:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299784 - head/sbin/routed 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.22 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: Sat, 14 May 2016 23:32:04 -0000 Author: pfg Date: Sat May 14 23:32:03 2016 New Revision: 299784 URL: https://svnweb.freebsd.org/changeset/base/299784 Log: Avoid NULL de-references. CID: 271079 Obtained from: NetBSD MFC after: 2 weeks. Modified: head/sbin/routed/output.c Modified: head/sbin/routed/output.c ============================================================================== --- head/sbin/routed/output.c Sat May 14 23:29:41 2016 (r299783) +++ head/sbin/routed/output.c Sat May 14 23:32:03 2016 (r299784) @@ -711,7 +711,7 @@ supply(struct sockaddr_in *dst, switch (type) { case OUT_MULTICAST: - if (ifp->int_if_flags & IFF_MULTICAST) + if (ifp != NULL && ifp->int_if_flags & IFF_MULTICAST) v2buf.type = OUT_MULTICAST; else v2buf.type = NO_OUT_MULTICAST; @@ -757,7 +757,7 @@ supply(struct sockaddr_in *dst, /* Fake a default route if asked and if there is not already * a better, real default route. */ - if (supplier && (def_metric = ifp->int_d_metric) != 0) { + if (supplier && ifp && (def_metric = ifp->int_d_metric) != 0) { if ((rt = rtget(RIP_DEFAULT, 0)) == NULL || rt->rt_metric+ws.metric >= def_metric) { ws.state |= WS_ST_DEFAULT;