-/* $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
char *cp = m_rtmsg.m_space;
int l;
+retry:
errno = 0;
if (cmd == RTM_DELETE)
goto 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);
}