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
This commit is contained in:
parent
dc0ca75105
commit
9753faf553
@ -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
|
||||
|
13
sys/net/if.c
13
sys/net/if.c
@ -1746,19 +1746,6 @@ next: continue;
|
||||
goto done;
|
||||
}
|
||||
} 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
|
||||
|
@ -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 */
|
||||
};
|
||||
|
@ -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;
|
||||
|
@ -1289,7 +1289,7 @@ rtsock_addrmsg(int cmd, struct ifaddr *ifa, int fibnum)
|
||||
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, struct rt_addrinfo *info,
|
||||
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, struct rt_addrinfo *info,
|
||||
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, struct rt_addrinfo *info,
|
||||
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));
|
||||
}
|
||||
|
@ -363,7 +363,6 @@ in_aifaddr_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp, struct thread *td)
|
||||
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;
|
||||
|
@ -1249,9 +1249,6 @@ in6_update_ifa_internal(struct ifnet *ifp, struct in6_aliasreq *ifra,
|
||||
ia->ia6_lifetime.ia6t_preferred = time_uptime;
|
||||
}
|
||||
|
||||
/* Update metric */
|
||||
ia->ia_ifa.ifa_metric = ifp->if_metric;
|
||||
|
||||
/*
|
||||
* configure address flags.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user