summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgsoares <gsoares@openbsd.org>2013-07-09 19:35:52 +0000
committergsoares <gsoares@openbsd.org>2013-07-09 19:35:52 +0000
commit4f7831fbc54a52837dbcf7118efce1865f743c6e (patch)
tree9e27dbafee98d997f9a5845490c53d722cbacc02
parentRemove link.5, which describes a.out shared libraries only and which content (diff)
downloadwireguard-openbsd-4f7831fbc54a52837dbcf7118efce1865f743c6e.tar.xz
wireguard-openbsd-4f7831fbc54a52837dbcf7118efce1865f743c6e.zip
switch the rval to 1 before loop through the linked list \
and finally change back to 0 afterwards. so teach tcpdrop to exit 1 if \ ail->ai_family != aif_family. OK markus@
-rw-r--r--usr.sbin/tcpdrop/tcpdrop.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/tcpdrop/tcpdrop.c b/usr.sbin/tcpdrop/tcpdrop.c
index 40f888574d6..88754081a58 100644
--- a/usr.sbin/tcpdrop/tcpdrop.c
+++ b/usr.sbin/tcpdrop/tcpdrop.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcpdrop.c,v 1.10 2013/07/09 17:29:19 gsoares Exp $ */
+/* $OpenBSD: tcpdrop.c,v 1.11 2013/07/09 19:35:52 gsoares Exp $ */
/*
* Copyright (c) 2004 Markus Friedl <markus@openbsd.org>
@@ -104,10 +104,12 @@ fail:
gai_strerror(gaierr));
}
+ rval = 1;
for (ail = laddr; ail; ail = ail->ai_next) {
for (aif = faddr; aif; aif = aif->ai_next) {
if (ail->ai_family != aif->ai_family)
continue;
+ rval = 0;
memset(&tir, 0, sizeof(tir));
memcpy(&tir.faddr, aif->ai_addr, aif->ai_addrlen);
memcpy(&tir.laddr, ail->ai_addr, ail->ai_addrlen);