summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorclaudio <claudio@openbsd.org>2009-06-25 15:44:43 +0000
committerclaudio <claudio@openbsd.org>2009-06-25 15:44:43 +0000
commit35b77220f65d21da15f6345785584a26627e3b45 (patch)
tree87958cacbd8e4a69d167118098ceb6bfdeadb772
parentSame code as in route(8) same RTM_VERSION check missing. (diff)
downloadwireguard-openbsd-35b77220f65d21da15f6345785584a26627e3b45.tar.xz
wireguard-openbsd-35b77220f65d21da15f6345785584a26627e3b45.zip
Another copy of the strange while loop seen in route(8). Add missing
RTM_VERSION check. Tested and OK sthen@, OK henning@
-rw-r--r--usr.sbin/ndp/ndp.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/ndp/ndp.c b/usr.sbin/ndp/ndp.c
index e77c5194803..965c6559ee0 100644
--- a/usr.sbin/ndp/ndp.c
+++ b/usr.sbin/ndp/ndp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ndp.c,v 1.44 2009/06/17 15:31:23 claudio Exp $ */
+/* $OpenBSD: ndp.c,v 1.45 2009/06/25 15:44:43 claudio Exp $ */
/* $KAME: ndp.c,v 1.101 2002/07/17 08:46:33 itojun Exp $ */
/*
@@ -898,7 +898,8 @@ doit:
}
do {
l = read(s, (char *)&m_rtmsg, sizeof(m_rtmsg));
- } while (l > 0 && (rtm->rtm_seq != seq || rtm->rtm_pid != pid));
+ } while (l > 0 && (rtm->rtm_version != RTM_VERSION ||
+ rtm->rtm_seq != seq || rtm->rtm_pid != pid));
if (l < 0)
(void) fprintf(stderr, "ndp: read from routing socket: %s\n",
strerror(errno));