diff options
author | 2012-05-02 07:45:50 +0000 | |
---|---|---|
committer | 2012-05-02 07:45:50 +0000 | |
commit | fd34e9dd4dcb20861aa52fc3876dfce4a3654d8f (patch) | |
tree | f0689dcbad098f6f19cf69d908820de7ee89cd09 | |
parent | make fragment handling yet more customizable (diff) | |
download | wireguard-openbsd-fd34e9dd4dcb20861aa52fc3876dfce4a3654d8f.tar.xz wireguard-openbsd-fd34e9dd4dcb20861aa52fc3876dfce4a3654d8f.zip |
don't call getifmtu in -n mode, assume 1500. calling getifmtu requires
the interface in question to be there, breaking ruleset verification
From: Silamael <Silamael at coronamundi dot de>
-rw-r--r-- | sbin/pfctl/pfctl_altq.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/sbin/pfctl/pfctl_altq.c b/sbin/pfctl/pfctl_altq.c index 0c057ad0c9b..68d9e7e436a 100644 --- a/sbin/pfctl/pfctl_altq.c +++ b/sbin/pfctl/pfctl_altq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfctl_altq.c,v 1.97 2011/07/04 01:07:43 henning Exp $ */ +/* $OpenBSD: pfctl_altq.c,v 1.98 2012/05/02 07:45:50 henning Exp $ */ /* * Copyright (c) 2002 @@ -244,7 +244,12 @@ eval_pfaltq(struct pfctl *pf, struct pf_altq *pa, struct node_queue_bw *bw, size = 8; else size = 24; - size = size * getifmtu(pa->ifname); + + if ((pf->opts & PF_OPT_NOACTION) == 0) + size = size * getifmtu(pa->ifname); + else + size = size * 1500; + if (size > 0xffff) size = 0xffff; pa->tbrsize = size; @@ -391,7 +396,11 @@ eval_pfqueue_cbq(struct pfctl *pf, struct pf_altq *pa) return (-1); } - ifmtu = getifmtu(pa->ifname); + if ((pf->opts & PF_OPT_NOACTION) == 0) + ifmtu = getifmtu(pa->ifname); + else + ifmtu = 1500; + opts = &pa->pq_u.cbq_opts; if (opts->pktsize == 0) { /* use default */ |