diff options
author | 2002-04-07 16:31:27 +0000 | |
---|---|---|
committer | 2002-04-07 16:31:27 +0000 | |
commit | 130aea021f90de5b800453dc2e95f2052a27f8e9 (patch) | |
tree | 0ae52500c3d09d22eae76153c0bdce771b35b114 | |
parent | more meat and fixens from weissman dude (diff) | |
download | wireguard-openbsd-130aea021f90de5b800453dc2e95f2052a27f8e9.tar.xz wireguard-openbsd-130aea021f90de5b800453dc2e95f2052a27f8e9.zip |
fix authpf_kill_states()
-rw-r--r-- | usr.sbin/authpf/authpf.c | 16 |
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)"); } |