diff options
| author | 2018-12-26 18:32:38 +0000 | |
|---|---|---|
| committer | 2018-12-26 18:32:38 +0000 | |
| commit | a38d798b0581ec986329a24ce3b08569ba29b0c8 (patch) | |
| tree | 1977851555d126543a65493db79da79a6482b680 /sys/net/if_ethersubr.c | |
| parent | simplify code (diff) | |
| download | wireguard-openbsd-a38d798b0581ec986329a24ce3b08569ba29b0c8.tar.xz wireguard-openbsd-a38d798b0581ec986329a24ce3b08569ba29b0c8.zip | |
uncouple AF_MPLS and AF_INET
input and OK mpi@
Diffstat (limited to 'sys/net/if_ethersubr.c')
| -rw-r--r-- | sys/net/if_ethersubr.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index f16ecdd4a99..fee86adae15 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ethersubr.c,v 1.256 2018/12/20 23:00:55 dlg Exp $ */ +/* $OpenBSD: if_ethersubr.c,v 1.257 2018/12/26 18:32:38 denis Exp $ */ /* $NetBSD: if_ethersubr.c,v 1.19 1996/05/07 02:40:30 thorpej Exp $ */ /* @@ -243,7 +243,11 @@ ether_resolve(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, if (!ISSET(ifp->if_xflags, IFXF_MPLS)) senderr(ENETUNREACH); - switch (dst->sa_family) { + af = dst->sa_family; + if (af == AF_MPLS) + af = rt->rt_gateway->sa_family; + + switch (af) { case AF_LINK: if (satosdl(dst)->sdl_alen < sizeof(eh->ether_dhost)) senderr(EHOSTUNREACH); @@ -258,7 +262,6 @@ ether_resolve(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, break; #endif case AF_INET: - case AF_MPLS: error = arpresolve(ifp, rt, m, dst, eh->ether_dhost); if (error) return (error); |
