diff options
author | dfr <dfr@FreeBSD.org> | 1995-01-16 18:57:45 +0000 |
---|---|---|
committer | dfr <dfr@FreeBSD.org> | 1995-01-16 18:57:45 +0000 |
commit | 0036e9d1e722430d7fb60acc8397d818e5d52d54 (patch) | |
tree | c086f8f6976e74cbef66950ffbe0aded8d4d22e6 /libexec/bootpd | |
parent | 801ab1baf755ffba7cd3d0a1e8c34ae8f3715186 (diff) | |
download | FreeBSD-src-0036e9d1e722430d7fb60acc8397d818e5d52d54.zip FreeBSD-src-0036e9d1e722430d7fb60acc8397d818e5d52d54.tar.gz |
Change to use RTM_CHANGE when an arp entry already exists. This closes
problem bin/57 which was caused when an incomplete entry was present for the
host which was booting.
Diffstat (limited to 'libexec/bootpd')
-rw-r--r-- | libexec/bootpd/rtmsg.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libexec/bootpd/rtmsg.c b/libexec/bootpd/rtmsg.c index fb59afe..7d0e8f4 100644 --- a/libexec/bootpd/rtmsg.c +++ b/libexec/bootpd/rtmsg.c @@ -39,7 +39,7 @@ /* * from arp.c 8.2 (Berkeley) 1/2/94 - * $Id: rtmsg.c,v 1.2 1994/09/10 15:13:28 csgr Exp $ + * $Id: rtmsg.c,v 1.1.1.1 1994/09/30 05:45:06 pst Exp $ */ #include <sys/param.h> @@ -110,6 +110,7 @@ int bsd_arp_set(ia, eaddr, len) register struct rt_msghdr *rtm = &(m_rtmsg.m_rtm); u_char *ea; struct timeval time; + int op = RTM_ADD; getsocket(); sdl_m = blank_sdl; @@ -138,6 +139,7 @@ tryagain: !(rtm->rtm_flags & RTF_GATEWAY)) switch (sdl->sdl_type) { case IFT_ETHER: case IFT_FDDI: case IFT_ISO88023: case IFT_ISO88024: case IFT_ISO88025: + op = RTM_CHANGE; goto overwrite; } if (doing_proxy == 0) { @@ -163,7 +165,7 @@ overwrite: } sdl_m.sdl_type = sdl->sdl_type; sdl_m.sdl_index = sdl->sdl_index; - return (rtmsg(RTM_ADD)); + return (rtmsg(op)); } @@ -186,6 +188,7 @@ static int rtmsg(cmd) report(LOG_ERR, "set_arp: internal wrong cmd - exiting"); exit(1); case RTM_ADD: + case RTM_CHANGE: rtm->rtm_addrs |= RTA_GATEWAY; rtm->rtm_rmx.rmx_expire = expire_time; rtm->rtm_inits = RTV_EXPIRE; |