From 31a91a5e6310b316f1d80be5e71ac72fddc77043 Mon Sep 17 00:00:00 2001 From: jasoni Date: Tue, 18 Dec 2001 00:14:21 +0000 Subject: Update rt_ifp in DIOCCHANGERULE. - noticed by DJ Gregor --- sys/net/pf.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/sys/net/pf.c b/sys/net/pf.c index 11dfd4161e7..864b42576e1 100644 --- a/sys/net/pf.c +++ b/sys/net/pf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf.c,v 1.179 2001/12/11 03:08:47 jasoni Exp $ */ +/* $OpenBSD: pf.c,v 1.180 2001/12/18 00:14:20 jasoni Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -1250,6 +1250,15 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p) break; } } + newrule->rt_ifp = NULL; + if (newrule->rt_ifname[0]) { + newrule->rt_ifp = ifunit(newrule->rt_ifname); + if (newrule->rt_ifname == NULL) { + pool_put(&pf_rule_pl, newrule); + error = EINVAL; + break; + } + } newrule->evaluations = newrule->packets = 0; newrule->bytes = 0; } -- cgit v1.2.3