aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/rarpd/rarpd.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/rarpd/rarpd.c')
-rw-r--r--usr.sbin/rarpd/rarpd.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/rarpd/rarpd.c b/usr.sbin/rarpd/rarpd.c
index 2bb333c553c8..00f23f8fa28b 100644
--- a/usr.sbin/rarpd/rarpd.c
+++ b/usr.sbin/rarpd/rarpd.c
@@ -755,7 +755,8 @@ update_arptab(u_char *ep, in_addr_t ipaddr)
}
do {
cc = read(r, rt, sizeof(rtmsg));
- } while (cc > 0 && (rt->rtm_seq != seq || rt->rtm_pid != pid));
+ } while (cc > 0 && (rt->rtm_type != RTM_GET || rt->rtm_seq != seq ||
+ rt->rtm_pid != pid));
if (cc == -1) {
logmsg(LOG_ERR, "rtmsg get read: %m");
close(r);
@@ -803,7 +804,8 @@ update_arptab(u_char *ep, in_addr_t ipaddr)
}
do {
cc = read(r, rt, sizeof(rtmsg));
- } while (cc > 0 && (rt->rtm_seq != seq || rt->rtm_pid != pid));
+ } while (cc > 0 && (rt->rtm_type != RTM_ADD || rt->rtm_seq != seq ||
+ rt->rtm_pid != pid));
close(r);
if (cc == -1) {
logmsg(LOG_ERR, "rtmsg add read: %m");