-/* $OpenBSD: if_ethersubr.c,v 1.206 2015/06/23 09:42:23 mpi Exp $ */
+/* $OpenBSD: if_ethersubr.c,v 1.207 2015/06/23 13:20:17 mpi Exp $ */
/* $NetBSD: if_ethersubr.c,v 1.19 1996/05/07 02:40:30 thorpej Exp $ */
/*
switch (dst->sa_family) {
case AF_INET:
- error = arpresolve(ac, rt, m, dst, edst);
+ error = arpresolve(ifp, rt, m, dst, edst);
if (error)
return (error == EAGAIN ? 0 : error);
/* If broadcasting on a simplex interface, loopback a copy */
sizeof(edst));
break;
case AF_INET:
- error = arpresolve(ac, rt, m, dst, edst);
+ error = arpresolve(ifp, rt, m, dst, edst);
if (error)
return (error == EAGAIN ? 0 : error);
break;
-/* $OpenBSD: if_ether.c,v 1.155 2015/06/16 11:09:40 mpi Exp $ */
+/* $OpenBSD: if_ether.c,v 1.156 2015/06/23 13:20:17 mpi Exp $ */
/* $NetBSD: if_ether.c,v 1.31 1996/05/11 12:59:58 mycroft Exp $ */
/*
* Any other return value indicates an error.
*/
int
-arpresolve(struct arpcom *ac, struct rtentry *rt0, struct mbuf *m,
+arpresolve(struct ifnet *ifp, struct rtentry *rt0, struct mbuf *m,
struct sockaddr *dst, u_char *desten)
{
+ struct arpcom *ac = (struct arpcom *)ifp;
struct llinfo_arp *la;
struct sockaddr_dl *sdl;
struct rtentry *rt = NULL;
}
if (rt0 != NULL) {
- error = rt_checkgate(&ac->ac_if, rt0, dst,
+ error = rt_checkgate(ifp, rt0, dst,
m->m_pkthdr.ph_rtableid, &rt);
if (error) {
m_freem(m);
&satosin(dst)->sin_addr, addr, sizeof(addr)));
} else {
if ((la = arplookup(satosin(dst)->sin_addr.s_addr, 1, 0,
- ac->ac_if.if_rdomain)) != NULL)
+ ifp->if_rdomain)) != NULL)
rt = la->la_rt;
else
log(LOG_DEBUG,
memcpy(desten, LLADDR(sdl), sdl->sdl_alen);
return (0);
}
- if (((struct ifnet *)ac)->if_flags & IFF_NOARP) {
+ if (ifp->if_flags & IFF_NOARP) {
m_freem(m);
return (EINVAL);
}
if (la->la_asked == 0 || rt->rt_expire != time_second) {
rt->rt_expire = time_second;
if (la->la_asked++ < arp_maxtries)
- arprequest(&ac->ac_if,
+ arprequest(ifp,
&satosin(rt->rt_ifa->ifa_addr)->sin_addr.s_addr,
&satosin(dst)->sin_addr.s_addr,
#if NCARP > 0
-/* $OpenBSD: if_ether.h,v 1.56 2015/04/10 13:58:20 dlg Exp $ */
+/* $OpenBSD: if_ether.h,v 1.57 2015/06/23 13:20:17 mpi Exp $ */
/* $NetBSD: if_ether.h,v 1.22 1996/05/11 13:00:00 mycroft Exp $ */
/*
void arpwhohas(struct arpcom *, struct in_addr *);
void arpintr(void);
-int arpresolve(struct arpcom *,
+int arpresolve(struct ifnet *,
struct rtentry *, struct mbuf *, struct sockaddr *, u_char *);
void arp_ifinit(struct arpcom *, struct ifaddr *);
void arp_rtrequest(int, struct rtentry *);