]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/netinet/in_arp.c
xnu-1228.9.59.tar.gz
[apple/xnu.git] / bsd / netinet / in_arp.c
index d764b37182ab27444d8d926dc0c3c640126eda07..174aa7742ce058975a915bd41fbf47c6101e2d8d 100644 (file)
@@ -242,7 +242,8 @@ arp_rtrequest(
                        gate = rt->rt_gateway;
                        SDL(gate)->sdl_type = rt->rt_ifp->if_type;
                        SDL(gate)->sdl_index = rt->rt_ifp->if_index;
-                       rt->rt_expire = timenow.tv_sec;
+                       /* In case we're called before 1.0 sec. has elapsed */
+                       rt->rt_expire = MAX(timenow.tv_sec, 1);
                        break;
                }
                /* Announce a new entry if requested. */
@@ -296,7 +297,8 @@ arp_rtrequest(
                        gate_ll->sdl_alen = broadcast_len;
                        gate_ll->sdl_family = AF_LINK;
                        gate_ll->sdl_len = sizeof(struct sockaddr_dl);
-                       rt->rt_expire = timenow.tv_sec;
+                       /* In case we're called before 1.0 sec. has elapsed */
+                       rt->rt_expire = MAX(timenow.tv_sec, 1);
                }
 #endif