pfctl: DIOCADDALTQ: Invalid argument

2006-04-19 Thread kestas . j . k
Hello,

I'm trying to give a computer on my LAN priority when it accesses the
internet with NAT. However when I write what seems to be a valid queue
set which should do the job fine I get

# pfctl -f /etc/pf.conf
pfctl: DIOCADDALTQ: Invalid argument


Here is the queue section of my ruleset, if I remove these and
references to them pfctl accepts the rest without a hiccup:

altq on $int_if bandwidth 100Mb cbq queue { ether, nattraffic }
queue ether bandwidth 70% cbq
queue nattraffic bandwidth 30% cbq (default) { out_, in_ }
queue out_ bandwidth 64Kb cbq { out_me, out_others }
queue out_me bandwidth 80% cbq
queue out_others bandwidth 20% cbq ( default )

queue in_ bandwidth 128Kb cbq { in_me, in_others }
queue in_me bandwidth 80% cbq
queue in_others bandwidth 20% cbq ( default )


Also, it accepts priority based queues without a problem too, just not
class based.
I have all of these options in the kernel:
device  pf
device  pflog
device  pfsync
options ALTQ
options ALTQ_CBQ# Class Bases Queuing (CBQ)
options ALTQ_RED# Random Early Detection (RED)
options ALTQ_RIO# RED In/Out
options ALTQ_HFSC   # Hierarchical Packet Scheduler (HFSC)
options ALTQ_PRIQ   # Priority Queuing (PRIQ)


Does anyone have any ideas on what pfctl: DIOCADDALTQ: Invalid
argument might mean? Let me know if you'd like further info.
Regards,
Kestas


Re: pfctl: DIOCADDALTQ: Invalid argument

2006-04-19 Thread Daniel Hartmeier
On Tue, Apr 18, 2006 at 10:27:53PM -0700, [EMAIL PROTECTED] wrote:

 altq on $int_if bandwidth 100Mb cbq queue { ether, nattraffic }
 queue ether bandwidth 70% cbq
 queue nattraffic bandwidth 30% cbq (default) { out_, in_ }
 queue out_ bandwidth 64Kb cbq { out_me, out_others }
 queue out_me bandwidth 80% cbq
 queue out_others bandwidth 20% cbq ( default )
 
 queue in_ bandwidth 128Kb cbq { in_me, in_others }
 queue in_me bandwidth 80% cbq
 queue in_others bandwidth 20% cbq ( default )

You have multiple queues with 'default', which is invalid. pf.conf(5)
says

   default Packets not matched by another queue are assigned to this
   one.  Exactly one default queue is required.

That literally means you must have exactly one queue as default, not one
queue per level or sub-tree or such, just one queue in the entire tree
of queues.

I don't know what your intention is with using 'default' on 'out_others'
and 'in_others', you'll have to assign to those two using filter rules
explicitely. Anything not assigned to any queue by filter rules will go
to the one default queue.

Daniel