From owner-svn-src-all@FreeBSD.ORG Fri Jul 12 01:59:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4EBD3BBF; Fri, 12 Jul 2013 01:59:31 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 411FC11CA; Fri, 12 Jul 2013 01:59:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6C1xVF3007260; Fri, 12 Jul 2013 01:59:31 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6C1xVx1007259; Fri, 12 Jul 2013 01:59:31 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201307120159.r6C1xVx1007259@svn.freebsd.org> From: Hiroki Sato Date: Fri, 12 Jul 2013 01:59:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r253242 - stable/9/usr.sbin/rtadvd X-SVN-Group: stable-9 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.14 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: Fri, 12 Jul 2013 01:59:31 -0000 Author: hrs Date: Fri Jul 12 01:59:30 2013 New Revision: 253242 URL: http://svnweb.freebsd.org/changeset/base/253242 Log: MFC 253058: - Add missing "static" keywords. - Add a check for ifindex to if_indextoifinfo(). It returns NULL when if_indextoname() fails. Modified: stable/9/usr.sbin/rtadvd/rtadvd.c Directory Properties: stable/9/usr.sbin/rtadvd/ (props changed) Modified: stable/9/usr.sbin/rtadvd/rtadvd.c ============================================================================== --- stable/9/usr.sbin/rtadvd/rtadvd.c Fri Jul 12 01:56:05 2013 (r253241) +++ stable/9/usr.sbin/rtadvd/rtadvd.c Fri Jul 12 01:59:30 2013 (r253242) @@ -95,7 +95,7 @@ struct sockaddr_in6 rcvfrom; static const char *pidfilename = _PATH_RTADVDPID; const char *conffile = _PATH_RTADVDCONF; static struct pidfh *pfh; -int dflag = 0, sflag = 0; +static int dflag, sflag; static int wait_shutdown; #define PFD_RAWSOCK 0 @@ -139,7 +139,7 @@ union nd_opt { #define NDOPT_FLAG_RDNSS (1 << 5) #define NDOPT_FLAG_DNSSL (1 << 6) -uint32_t ndopt_flags[] = { +static uint32_t ndopt_flags[] = { [ND_OPT_SOURCE_LINKADDR] = NDOPT_FLAG_SRCLINKADDR, [ND_OPT_TARGET_LINKADDR] = NDOPT_FLAG_TGTLINKADDR, [ND_OPT_PREFIX_INFORMATION] = NDOPT_FLAG_PREFIXINFO, @@ -1637,6 +1637,11 @@ struct ifinfo * if_indextoifinfo(int idx) { struct ifinfo *ifi; + char *name, name0[IFNAMSIZ]; + + /* Check if the interface has a valid name or not. */ + if (if_indextoname(idx, name0) == NULL) + return (NULL); TAILQ_FOREACH(ifi, &ifilist, ifi_next) { if (ifi->ifi_ifindex == idx)