From owner-svn-src-head@FreeBSD.ORG Tue Jul 29 15:01:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0AA96C3F; Tue, 29 Jul 2014 15:01:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 DF34229C2; Tue, 29 Jul 2014 15:01:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s6TF1UH6028345; Tue, 29 Jul 2014 15:01:30 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s6TF1TZL028335; Tue, 29 Jul 2014 15:01:29 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201407291501.s6TF1TZL028335@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 29 Jul 2014 15:01:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269243 - in head: share/man/man9 sys/net sys/netinet 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-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jul 2014 15:01:31 -0000 Author: glebius Date: Tue Jul 29 15:01:29 2014 New Revision: 269243 URL: http://svnweb.freebsd.org/changeset/base/269243 Log: Garbage collect couple of unused fields from struct ifaddr: - ifa_claim_addr() unused since removal of NetAtalk - ifa_metric seems to be never utilized, always a copy of if_metric Modified: head/share/man/man9/ifnet.9 head/sys/net/if.c head/sys/net/if.h head/sys/net/if_var.h head/sys/net/rtsock.c head/sys/netinet/in.c head/sys/netinet6/in6.c Modified: head/share/man/man9/ifnet.9 ============================================================================== --- head/share/man/man9/ifnet.9 Tue Jul 29 14:54:23 2014 (r269242) +++ head/share/man/man9/ifnet.9 Tue Jul 29 15:01:29 2014 (r269243) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 5, 2013 +.Dd July 29, 2014 .Dt IFNET 9 .Os .Sh NAME @@ -1084,10 +1084,6 @@ address in the route table. .It Va ifa_refcnt .Pq Vt short The reference count. -.It Va ifa_metric -.Pq Vt int -A metric associated with this interface address, for the use of some -external routing protocol. .El .Pp References to Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Tue Jul 29 14:54:23 2014 (r269242) +++ head/sys/net/if.c Tue Jul 29 15:01:29 2014 (r269243) @@ -1747,19 +1747,6 @@ next: continue; } } else { /* - * if we have a special address handler, - * then use it instead of the generic one. - */ - if (ifa->ifa_claim_addr) { - if ((*ifa->ifa_claim_addr)(ifa, addr)) { - ifa_ref(ifa); - IF_ADDR_RUNLOCK(ifp); - goto done; - } - continue; - } - - /* * Scan all the bits in the ifa's address. * If a bit dissagrees with what we are * looking for, mask it with the netmask Modified: head/sys/net/if.h ============================================================================== --- head/sys/net/if.h Tue Jul 29 14:54:23 2014 (r269242) +++ head/sys/net/if.h Tue Jul 29 15:01:29 2014 (r269243) @@ -304,7 +304,7 @@ struct ifa_msghdr { int ifam_addrs; /* like rtm_addrs */ int ifam_flags; /* value of ifa_flags */ u_short ifam_index; /* index for associated ifp */ - int ifam_metric; /* value of ifa_metric */ + int ifam_metric; /* value of ifa_ifp->if_metric */ }; /* @@ -329,7 +329,7 @@ struct ifa_msghdrl { u_short _ifam_spare1; /* spare space to grow if_index, see if_var.h */ u_short ifam_len; /* length of ifa_msghdrl incl. if_data */ u_short ifam_data_off; /* offset of if_data from beginning */ - int ifam_metric; /* value of ifa_metric */ + int ifam_metric; /* value of ifa_ifp->if_metric */ struct if_data ifam_data;/* statistics and other data about if or * address */ }; Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Tue Jul 29 14:54:23 2014 (r269242) +++ head/sys/net/if_var.h Tue Jul 29 15:01:29 2014 (r269243) @@ -366,9 +366,6 @@ struct ifaddr { (int, struct rtentry *, struct rt_addrinfo *); u_short ifa_flags; /* mostly rt_flags for cloning */ u_int ifa_refcnt; /* references to this structure */ - int ifa_metric; /* cost of going out this interface */ - int (*ifa_claim_addr) /* check if an addr goes to this if */ - (struct ifaddr *, struct sockaddr *); counter_u64_t ifa_ipackets; counter_u64_t ifa_opackets; Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Tue Jul 29 14:54:23 2014 (r269242) +++ head/sys/net/rtsock.c Tue Jul 29 15:01:29 2014 (r269243) @@ -1289,7 +1289,7 @@ rtsock_addrmsg(int cmd, struct ifaddr *i return (ENOBUFS); ifam = mtod(m, struct ifa_msghdr *); ifam->ifam_index = ifp->if_index; - ifam->ifam_metric = ifa->ifa_metric; + ifam->ifam_metric = ifa->ifa_ifp->if_metric; ifam->ifam_flags = ifa->ifa_flags; ifam->ifam_addrs = info.rti_addrs; @@ -1638,7 +1638,7 @@ sysctl_iflist_ifaml(struct ifaddr *ifa, ifam32->ifam_len = sizeof(*ifam32); ifam32->ifam_data_off = offsetof(struct ifa_msghdrl32, ifam_data); - ifam32->ifam_metric = ifa->ifa_metric; + ifam32->ifam_metric = ifa->ifa_ifp->if_metric; ifd = &ifam32->ifam_data; } else #endif @@ -1649,7 +1649,7 @@ sysctl_iflist_ifaml(struct ifaddr *ifa, ifam->_ifam_spare1 = 0; ifam->ifam_len = sizeof(*ifam); ifam->ifam_data_off = offsetof(struct ifa_msghdrl, ifam_data); - ifam->ifam_metric = ifa->ifa_metric; + ifam->ifam_metric = ifa->ifa_ifp->if_metric; ifd = &ifam->ifam_data; } @@ -1677,7 +1677,7 @@ sysctl_iflist_ifam(struct ifaddr *ifa, s ifam->ifam_addrs = info->rti_addrs; ifam->ifam_flags = ifa->ifa_flags; ifam->ifam_index = ifa->ifa_ifp->if_index; - ifam->ifam_metric = ifa->ifa_metric; + ifam->ifam_metric = ifa->ifa_ifp->if_metric; return (SYSCTL_OUT(w->w_req, w->w_tmem, len)); } Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Tue Jul 29 14:54:23 2014 (r269242) +++ head/sys/netinet/in.c Tue Jul 29 15:01:29 2014 (r269243) @@ -363,7 +363,6 @@ in_aifaddr_ioctl(u_long cmd, caddr_t dat ifa->ifa_netmask = (struct sockaddr *)&ia->ia_sockmask; ia->ia_ifp = ifp; - ia->ia_ifa.ifa_metric = ifp->if_metric; ia->ia_addr = *addr; if (mask->sin_len != 0) { ia->ia_sockmask = *mask; Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Tue Jul 29 14:54:23 2014 (r269242) +++ head/sys/netinet6/in6.c Tue Jul 29 15:01:29 2014 (r269243) @@ -1249,9 +1249,6 @@ in6_update_ifa_internal(struct ifnet *if ia->ia6_lifetime.ia6t_preferred = time_uptime; } - /* Update metric */ - ia->ia_ifa.ifa_metric = ifp->if_metric; - /* * configure address flags. */