diff options
author | Alexander V. Chernikov <melifaro@FreeBSD.org> | 2020-04-02 20:06:37 +0000 |
---|---|---|
committer | Alexander V. Chernikov <melifaro@FreeBSD.org> | 2020-04-02 20:06:37 +0000 |
commit | 66bc03d415666a5b0e8566a2d05649f13bf07ebe (patch) | |
tree | 8a826206dfb63b4107062d8e7313ebf3d2a6d655 | |
parent | 272bd6985f72a2c7dad0d904449d6b6ec0982d9c (diff) |
Use interface fib for proxyarp checks.
Before the change, proxyarp checks for src and dst addresses
were performed using default fib, breaking multi-fib scenario.
PR: 245181
Submitted by: Scott Aitken (original version)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D24244
Notes
Notes:
svn path=/head/; revision=359580
-rw-r--r-- | sys/netinet/if_ether.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c index d1dd8e36fedf..c24313082ade 100644 --- a/sys/netinet/if_ether.c +++ b/sys/netinet/if_ether.c @@ -1044,7 +1044,11 @@ reply: (void)memcpy(ar_tha(ah), ar_sha(ah), ah->ar_hln); (void)memcpy(ar_sha(ah), enaddr, ah->ar_hln); } else { - struct llentry *lle = NULL; + /* + * Destination address is not ours. Check if + * proxyarp entry exists or proxyarp is turned on globally. + */ + struct llentry *lle; sin.sin_addr = itaddr; lle = lla_lookup(LLTABLE(ifp), 0, (struct sockaddr *)&sin); @@ -1061,8 +1065,8 @@ reply: if (!V_arp_proxyall) goto drop; - /* XXX MRT use table 0 for arp reply */ - if (fib4_lookup_nh_basic(0, itaddr, 0, 0, &nh4) != 0) + if (fib4_lookup_nh_basic(ifp->if_fib, itaddr, 0, 0, + &nh4) != 0) goto drop; /* @@ -1083,8 +1087,8 @@ reply: * wrong network. */ - /* XXX MRT use table 0 for arp checks */ - if (fib4_lookup_nh_basic(0, isaddr, 0, 0, &nh4) != 0) + if (fib4_lookup_nh_basic(ifp->if_fib, isaddr, 0, 0, + &nh4) != 0) goto drop; if (nh4.nh_ifp != ifp) { ARP_LOG(LOG_INFO, "proxy: ignoring request" |