inet: Don't mark cloned route as RTF_REJECT on RTM_MISS
authorRoy Marples <roy@marples.name>
Mon, 9 Sep 2019 16:20:29 +0000 (17:20 +0100)
committerRoy Marples <roy@marples.name>
Mon, 9 Sep 2019 16:20:29 +0000 (17:20 +0100)
With the current behaviour, the cloned route is marked as
RTF_REJECT which means subsequent use is delayed until either an
ARP reply comes in or the ARP entry times out and resolution
can then begin again.

Instead, no longer mark the route for RTF_REJECT and allow more
ARP requests to go out if something really wants to use it.
This mirror the current behaviour for inet6.

sys/netinet/if_ether.c

index 9881500..f927bde 100644 (file)
@@ -587,15 +587,12 @@ arpresolve(struct ifnet *ifp, struct rtentry *rt0, struct mbuf *m,
                rt->rt_flags &= ~RTF_REJECT;
                if (la->la_asked == 0 || rt->rt_expire != time_uptime) {
                        rt->rt_expire = time_uptime;
-                       if (la->la_asked++ < arp_maxtries) {
-                               arprequest(ifp,
-                                          &SIN(rt->rt_ifa->ifa_addr)->sin_addr,
-                                          &SIN(dst)->sin_addr,
-                                          NULL);
-                       } else {
-                               rt->rt_flags |= RTF_REJECT;
+                       arprequest(ifp,
+                                  &SIN(rt->rt_ifa->ifa_addr)->sin_addr,
+                                  &SIN(dst)->sin_addr,
+                                  NULL);
+                       if (la->la_asked++ >= arp_maxtries) {
                                rt->rt_expire += arpt_down;
-                               la->la_asked = 0;
                                la->la_preempt = arp_maxtries;
                                rt_rtmsg(RTM_MISS, rt, rt->rt_ifp, 0);
                        }