summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorMike Frantzen <frantzen@cvs.openbsd.org>2002-04-07 16:31:28 +0000
committerMike Frantzen <frantzen@cvs.openbsd.org>2002-04-07 16:31:28 +0000
commit081104e4bf91e5c98fef1f9331cfad748d09e97f (patch)
tree06ddf9ea78e79e3b2ad7bbe958c051ef05090f37 /usr.sbin
parent45a66ed5f600ed9dc97daf8ea4da697a60b06c78 (diff)
fix authpf_kill_states()
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/authpf/authpf.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/usr.sbin/authpf/authpf.c b/usr.sbin/authpf/authpf.c
index 999f1d7432a..391866167f3 100644
--- a/usr.sbin/authpf/authpf.c
+++ b/usr.sbin/authpf/authpf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: authpf.c,v 1.7 2002/04/05 20:35:52 deraadt Exp $ */
+/* $OpenBSD: authpf.c,v 1.8 2002/04/07 16:31:27 frantzen Exp $ */
/*
* Copyright (C) 1998 - 2002 Bob Beck (beck@openbsd.org).
@@ -784,23 +784,23 @@ static void
authpf_kill_states()
{
struct pfioc_state_kill psk;
- struct in_addr target, temp;
+ struct in_addr target;
memset(&psk, 0, sizeof(psk));
- memset(&psk.psk_src.mask, 0xff, sizeof(psk.psk_src.mask));
- memset(&target, 0xff, sizeof(target));
- memset(&temp, 0xff, sizeof(temp));
+ psk.psk_af = AF_INET;
- inet_pton(AF_INET, "255.255.255.255", &temp);
inet_pton(AF_INET, ipsrc, &target);
+ /* Kill all states from ipsrc */
psk.psk_src.addr.v4 = target;
- psk.psk_dst.addr.v4 = temp;
+ memset(&psk.psk_src.mask, 0xff, sizeof(psk.psk_src.mask));
if (ioctl(dev, DIOCKILLSTATES, &psk))
syslog(LOG_ERR, "DIOCKILLSTATES failed (%m)");
+ /* Kill all states to ipsrc */
+ memset(&psk.psk_src, 0, sizeof(psk.psk_src));
psk.psk_dst.addr.v4 = target;
- psk.psk_src.addr.v4 = temp;
+ memset(&psk.psk_dst.mask, 0xff, sizeof(psk.psk_dst.mask));
if (ioctl(dev, DIOCKILLSTATES, &psk))
syslog(LOG_ERR, "DIOCKILLSTATES failed (%m)");
}