diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2016-03-30 10:13:15 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2016-03-30 10:13:15 +0000 |
commit | ea35b2cb525379a007baaf70bd9ff83c3c64519c (patch) | |
tree | d624a11a6517f628fa5c1b2b95c52b95cfcd8b81 /sys/netinet/if_ether.c | |
parent | df3210756b0daff1d1eb642ce3aa526c1bb532ef (diff) |
Implement proxy ARP for ART based on mpath support.
Since mpath is not enabled in RAMDISK, proxy ARP won't work there either.
ok bluhm@
Diffstat (limited to 'sys/netinet/if_ether.c')
-rw-r--r-- | sys/netinet/if_ether.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c index 50095387798..ca7fea72be9 100644 --- a/sys/netinet/if_ether.c +++ b/sys/netinet/if_ether.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ether.c,v 1.203 2016/03/24 07:15:10 mpi Exp $ */ +/* $OpenBSD: if_ether.c,v 1.204 2016/03/30 10:13:14 mpi Exp $ */ /* $NetBSD: if_ether.c,v 1.31 1996/05/11 12:59:58 mycroft Exp $ */ /* @@ -698,8 +698,20 @@ arplookup(u_int32_t addr, int create, int proxy, u_int tableid) } if (proxy && !ISSET(rt->rt_flags, RTF_ANNOUNCE)) { + struct rtentry *mrt = NULL; +#if defined(ART) && !defined(SMALL_KERNEL) + mrt = rt; + KERNEL_LOCK(); + while ((mrt = rtable_mpath_next(mrt)) != NULL) { + if (ISSET(mrt->rt_flags, RTF_ANNOUNCE)) { + rtref(mrt); + break; + } + } + KERNEL_UNLOCK(); +#endif /* ART && !SMALL_KERNEL */ rtfree(rt); - return (NULL); + return (mrt); } return (rt); |