diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc index 9a6a268488..5ce29d9560 100644 --- a/etc/inc/filter.inc +++ b/etc/inc/filter.inc @@ -97,7 +97,12 @@ function filter_configure_sync() { $altq_queues = filter_generate_altq_queues($altq_ints); /* generate altq rules */ if($g['booting'] == true) echo " altq-rules "; - $pf_altq_rules = filter_generate_pf_altq_rules(); + /* Setup a default rule that tags ALL packets as unshaped + * we'll match only unshaped packets in the shaper code later + * this allows the shaper to be first match + */ + $pf_altq_rules = "block any tag unshaped label SHAPER: first match rule\n"; + $pf_altq_rules .= filter_generate_pf_altq_rules(); } /* enable pf if we need to, otherwise disable */ diff --git a/etc/inc/shaper.inc b/etc/inc/shaper.inc index d2598b2d46..d1abe40c34 100644 --- a/etc/inc/shaper.inc +++ b/etc/inc/shaper.inc @@ -590,7 +590,7 @@ function filter_generate_pf_altq_rules() { $line .= "{$flags}/SAFRPU "; $qtag = "{$direction}queue"; - $line .= " keep state tag {$rule[$qtag]} "; + $line .= " keep state tagged unshaped tag {$rule[$qtag]} "; $line .= "\n"; $shaperrules .= $line;