summaryrefslogtreecommitdiffstats
path: root/sys/net/pf_ioctl.c
diff options
context:
space:
mode:
authorsashan <sashan@openbsd.org>2015-10-13 19:32:31 +0000
committersashan <sashan@openbsd.org>2015-10-13 19:32:31 +0000
commit614a62ad7ddb5b7e95bfb87244c323bef6740a59 (patch)
treedc0497c6d5e4eb57bc4f98a26f943ed9760dafe0 /sys/net/pf_ioctl.c
parentsm_error() already does the exit for us. (diff)
downloadwireguard-openbsd-614a62ad7ddb5b7e95bfb87244c323bef6740a59.tar.xz
wireguard-openbsd-614a62ad7ddb5b7e95bfb87244c323bef6740a59.zip
- pf_insert_src_node(): global argument (arg6) is useless, function
always gets pointer to rule. - pf_remove_src_node(): function should always remove matching src node, regardless the sn->rule.ptr being NULL or valid rule - sn->rule.ptr is never NULL, spotted by mpi and Richard Procter _von_ gmail.com OK mpi@, OK mikeb@
Diffstat (limited to 'sys/net/pf_ioctl.c')
-rw-r--r--sys/net/pf_ioctl.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/net/pf_ioctl.c b/sys/net/pf_ioctl.c
index 6939a4357e3..0709b8fb9ed 100644
--- a/sys/net/pf_ioctl.c
+++ b/sys/net/pf_ioctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf_ioctl.c,v 1.290 2015/09/04 21:40:25 kettenis Exp $ */
+/* $OpenBSD: pf_ioctl.c,v 1.291 2015/10/13 19:32:31 sashan Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -2175,8 +2175,7 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p)
bzero(&pstore->entry, sizeof(pstore->entry));
pstore->rule.ptr = NULL;
pstore->kif = NULL;
- if (n->rule.ptr != NULL)
- pstore->rule.nr = n->rule.ptr->nr;
+ pstore->rule.nr = n->rule.ptr->nr;
pstore->creation = secs - pstore->creation;
if (pstore->expire > secs)
pstore->expire -= secs;