summaryrefslogtreecommitdiff
path: root/usr.sbin/tcpdrop
diff options
context:
space:
mode:
authorGleydson Soares <gsoares@cvs.openbsd.org>2013-07-09 19:35:53 +0000
committerGleydson Soares <gsoares@cvs.openbsd.org>2013-07-09 19:35:53 +0000
commite71effc60014b927aa3182729951282e39babb69 (patch)
tree72e92503cde4aec84cb1d8d6afd3a48281292ec4 /usr.sbin/tcpdrop
parent508e500f9d1c9ce8711d5df776667f0c0e356d01 (diff)
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@
Diffstat (limited to 'usr.sbin/tcpdrop')
-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);