Permalink
Browse files

ignore msg if sadb_msg_pid does not match. yamt@netbsd

  • Loading branch information...
1 parent 42780c5 commit 2d42d1bd5dc286df3604e4d23de9fc27c847a9b5 itojun committed Jul 24, 2004
Showing with 6 additions and 1 deletion.
  1. +6 −1 kame/kame/setkey/setkey.c
@@ -1,4 +1,4 @@
-/* $KAME: setkey.c,v 1.37 2004/07/03 11:02:11 jinmei Exp $ */
+/* $KAME: setkey.c,v 1.38 2004/07/24 00:51:31 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, 1998, and 1999 WIDE Project.
@@ -383,6 +383,7 @@ sendkeymsg(buf, len)
msg = (struct sadb_msg *)rbuf;
do {
+nextmsg:
if ((l = recv(so, rbuf, sizeof(rbuf), 0)) < 0) {
perror("recv");
goto end;
@@ -397,6 +398,10 @@ sendkeymsg(buf, len)
kdebug_sadb((struct sadb_msg *)rbuf);
printf("\n");
}
+
+ if (msg->sadb_msg_pid != getpid())
+ goto nextmsg;
+
if (postproc(msg, l) < 0)
break;
} while (msg->sadb_msg_errno || msg->sadb_msg_seq);

0 comments on commit 2d42d1b

Please sign in to comment.