From 9cd20436c701dbe11c3aae3e65c60801f188ebd2 Mon Sep 17 00:00:00 2001 From: Chris Kuethe Date: Sat, 6 Oct 2007 15:45:01 +0000 Subject: Allow the various pf table actions to operate independently. For example, "-L leased" wouldn't work without "-A abandoned". testing help from merdely "i like" deraadt --- usr.sbin/dhcpd/pfutils.c | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/usr.sbin/dhcpd/pfutils.c b/usr.sbin/dhcpd/pfutils.c index 6d806fa80e1..5c2034bc3d5 100644 --- a/usr.sbin/dhcpd/pfutils.c +++ b/usr.sbin/dhcpd/pfutils.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfutils.c,v 1.7 2007/05/15 06:22:32 tedu Exp $ */ +/* $OpenBSD: pfutils.c,v 1.8 2007/10/06 15:45:00 ckuethe Exp $ */ /* * Copyright (c) 2006 Chris Kuethe * @@ -234,24 +234,14 @@ pfmsg(char c, struct lease *lp) switch (c) { case 'A': /* address is being abandoned */ - if (abandoned_tab != NULL) - (void)atomicio(vwrite, pfpipe[1], &cmd, - sizeof(struct pf_cmd)); - break; + /* FALLTHROUGH */ case 'C': /* IP moved to different ethernet address */ - if (changedmac_tab != NULL) - (void)atomicio(vwrite, pfpipe[1], &cmd, - sizeof(struct pf_cmd)); - break; + /* FALLTHROUGH */ case 'L': /* Address is being leased (unabandoned) */ - if (abandoned_tab != NULL) - (void)atomicio(vwrite, pfpipe[1], &cmd, - sizeof(struct pf_cmd)); - break; + /* FALLTHROUGH */ case 'R': /* Address is being released or lease has expired */ - if (leased_tab != NULL) - (void)atomicio(vwrite, pfpipe[1], &cmd, - sizeof(struct pf_cmd)); + (void)atomicio(vwrite, pfpipe[1], &cmd, + sizeof(struct pf_cmd)); break; default: /* silently ignore unknown commands */ break; -- cgit v1.2.3