diff options
| author | 2009-03-09 13:53:09 +0000 | |
|---|---|---|
| committer | 2009-03-09 13:53:09 +0000 | |
| commit | 26b46f765f4625ccd2dddc5773828829ada61c48 (patch) | |
| tree | 0f06774f2d9543d3874eddd1e8e8d89f27f62185 /sys/net/pf_if.c | |
| parent | add hunk that should have been included in rev. 1.12, fixes occasional (diff) | |
| download | wireguard-openbsd-26b46f765f4625ccd2dddc5773828829ada61c48.tar.xz wireguard-openbsd-26b46f765f4625ccd2dddc5773828829ada61c48.zip | |
Make the DIOCSETIFFLAG, DIOCSETLIMIT, and DIOCSETTIMEOUT ioctls
transactional, closing PRs 4941 and 5910. Minor flag day, requires rebuild
of userland tools that use struct pfi_kif.
ok henning deraadt
Diffstat (limited to 'sys/net/pf_if.c')
| -rw-r--r-- | sys/net/pf_if.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/sys/net/pf_if.c b/sys/net/pf_if.c index ddf5cec4d2f..6a29e361025 100644 --- a/sys/net/pf_if.c +++ b/sys/net/pf_if.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf_if.c,v 1.55 2008/11/24 13:22:09 mikeb Exp $ */ +/* $OpenBSD: pf_if.c,v 1.56 2009/03/09 13:53:10 mcbride Exp $ */ /* * Copyright 2005 Henning Brauer <henning@openbsd.org> @@ -714,7 +714,7 @@ pfi_set_flags(const char *name, int flags) RB_FOREACH(p, pfi_ifhead, &pfi_ifs) { if (pfi_skip_if(name, p)) continue; - p->pfik_flags |= flags; + p->pfik_flags_new = p->pfik_flags | flags; } splx(s); return (0); @@ -730,12 +730,24 @@ pfi_clear_flags(const char *name, int flags) RB_FOREACH(p, pfi_ifhead, &pfi_ifs) { if (pfi_skip_if(name, p)) continue; - p->pfik_flags &= ~flags; + p->pfik_flags_new = p->pfik_flags & ~flags; } splx(s); return (0); } +void +pfi_xcommit(void) +{ + struct pfi_kif *p; + int s; + + s = splsoftnet(); + RB_FOREACH(p, pfi_ifhead, &pfi_ifs) + p->pfik_flags = p->pfik_flags_new; + splx(s); +} + /* from pf_print_state.c */ int pfi_unmask(void *addr) |
