Index: if_ethersubr.c =================================================================== RCS file: /cvs/src/sys/net/if_ethersubr.c,v retrieving revision 1.258 diff -u -p -r1.258 if_ethersubr.c --- if_ethersubr.c 18 Feb 2019 03:41:21 -0000 1.258 +++ if_ethersubr.c 19 Feb 2019 03:23:15 -0000 @@ -235,19 +235,16 @@ ether_resolve(struct ifnet *ifp, struct #endif #ifdef MPLS case AF_MPLS: - if (rt) - dst = rt_key(rt); - else + if (rt == NULL) senderr(EHOSTUNREACH); if (!ISSET(ifp->if_xflags, IFXF_MPLS)) senderr(ENETUNREACH); - af = dst->sa_family; - if (af == AF_MPLS) - af = rt->rt_gateway->sa_family; + dst = ISSET(rt->rt_flags, RTF_GATEWAY) ? + rt->rt_gateway : rt_key(rt); - switch (af) { + switch (dst->sa_family) { case AF_LINK: if (satosdl(dst)->sdl_alen < sizeof(eh->ether_dhost)) senderr(EHOSTUNREACH);