-/* $OpenBSD: if.c,v 1.398 2015/10/25 21:58:04 deraadt Exp $ */
+/* $OpenBSD: if.c,v 1.399 2015/10/27 10:52:17 mpi Exp $ */
/* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */
/*
int
if_group_egress_build(void)
{
+ struct ifnet *ifp;
struct ifg_group *ifg;
struct ifg_member *ifgm, *next;
struct sockaddr_in sa_in;
if (rt0 != NULL) {
rt = rt0;
do {
- if (rt->rt_ifp)
- if_addgroup(rt->rt_ifp, IFG_EGRESS);
+ ifp = if_get(rt->rt_ifidx);
+ if (ifp != NULL) {
+ if_addgroup(ifp, IFG_EGRESS);
+ if_put(ifp);
+ }
#ifndef SMALL_KERNEL
rt = rt_mpath_next(rt);
#else
if (rt0 != NULL) {
rt = rt0;
do {
- if (rt->rt_ifp)
- if_addgroup(rt->rt_ifp, IFG_EGRESS);
+ ifp = if_get(rt->rt_ifidx);
+ if (ifp != NULL) {
+ if_addgroup(ifp, IFG_EGRESS);
+ if_put(ifp);
+ }
#ifndef SMALL_KERNEL
rt = rt_mpath_next(rt);
#else
-/* $OpenBSD: pf.c,v 1.947 2015/10/13 19:32:31 sashan Exp $ */
+/* $OpenBSD: pf.c,v 1.948 2015/10/27 10:52:17 mpi Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
u_int16_t
pf_calc_mss(struct pf_addr *addr, sa_family_t af, int rtableid, u_int16_t offer)
{
+ struct ifnet *ifp;
struct sockaddr_in *dst;
#ifdef INET6
struct sockaddr_in6 *dst6;
#endif /* INET6 */
}
- if (rt && rt->rt_ifp) {
- mss = rt->rt_ifp->if_mtu - hlen - sizeof(struct tcphdr);
+ if (rt != NULL && (ifp = if_get(rt->rt_ifidx)) != NULL) {
+ mss = ifp->if_mtu - hlen - sizeof(struct tcphdr);
mss = max(tcp_mssdflt, mss);
- rtfree(rt);
+ if_put(ifp);
}
+ rtfree(rt);
mss = min(mss, offer);
mss = max(mss, 64); /* sanity - at least max opt space */
return (mss);
-/* $OpenBSD: nd6.c,v 1.162 2015/10/25 15:11:52 deraadt Exp $ */
+/* $OpenBSD: nd6.c,v 1.163 2015/10/27 10:52:18 mpi Exp $ */
/* $KAME: nd6.c,v 1.280 2002/06/08 19:52:07 itojun Exp $ */
/*
if ((rt = ln->ln_rt) == NULL)
panic("ln->ln_rt == NULL");
- if ((ifp = rt->rt_ifp) == NULL)
- panic("ln->ln_rt->rt_ifp == NULL");
+ if ((ifp = if_get(rt->rt_ifidx)) == NULL)
+ return;
ndi = ND_IFINFO(ifp);
dst = satosin6(rt_key(rt));
break;
}
+ if_put(ifp);
splx(s);
}