diff options
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/rarpd/arptab.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/usr.sbin/rarpd/arptab.c b/usr.sbin/rarpd/arptab.c index dac132dea16..ddabb26ef22 100644 --- a/usr.sbin/rarpd/arptab.c +++ b/usr.sbin/rarpd/arptab.c @@ -1,4 +1,4 @@ -/* $OpenBSD: arptab.c,v 1.26 2016/01/26 18:26:19 mmcc Exp $ */ +/* $OpenBSD: arptab.c,v 1.27 2016/07/25 16:28:06 visa Exp $ */ /* * Copyright (c) 1984, 1993 @@ -172,6 +172,7 @@ rtmsg(int cmd) char *cp = m_rtmsg.m_space; int l; +retry: errno = 0; if (cmd == RTM_DELETE) goto doit; @@ -224,11 +225,14 @@ doit: } } do { - l = read(s, (char *)&m_rtmsg, sizeof(m_rtmsg)); + l = recv(s, (char *)&m_rtmsg, sizeof(m_rtmsg), MSG_DONTWAIT); } while (l > 0 && (rtm->rtm_version != RTM_VERSION || rtm->rtm_seq != seq || rtm->rtm_pid != pid)); - if (l < 0) + if (l < 0) { + if (errno == EAGAIN || errno == EINTR) + goto retry; syslog(LOG_ERR, "arptab_set: read from routing socket: %m"); + } return (0); } |