]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Change tablearg value to be 0 (try #2).
authorAlexander V. Chernikov <melifaro@FreeBSD.org>
Tue, 12 Aug 2014 15:51:48 +0000 (15:51 +0000)
committerAlexander V. Chernikov <melifaro@FreeBSD.org>
Tue, 12 Aug 2014 15:51:48 +0000 (15:51 +0000)
commit1940fa77278f0ec2ff1d3a8a174dbf5785d8e70e
treea8fa20927c28cd192b16b34d205f195ff47c0df4
parent56f43a5e98695a187837094740286c60fdcc0de0
Change tablearg value to be 0 (try #2).
Most of the tablearg-supported opcodes does not accept 0 as valid value:
 O_TAG, O_TAGGED, O_PIPE, O_QUEUE, O_DIVERT, O_TEE, O_SKIPTO, O_CALLRET,
 O_NETGRAPH, O_NGTEE, O_NAT treats 0 as invalid input.

The rest are O_SETDSCP and O_SETFIB.
'Fix' them by adding high-order bit (0x8000) set for non-tablearg values.
Do translation in kernel for old clients (import_rule0 / export_rule0),
teach current ipfw(8) binary to add/remove given bit.

This change does not affect handling SETDSCP values, but limit
O_SETFIB values to 32767 instead of 65k. Since currently we have either
old (16) or new (2^32) max fibs, this should not be a big deal:
we're definitely OK for former and have to add another opcode to deal
with latter, regardless of tablearg value.
sbin/ipfw/ipfw2.c
sbin/ipfw/ipfw2.h
sys/netinet/ip_fw.h
sys/netpfil/ipfw/ip_fw2.c
sys/netpfil/ipfw/ip_fw_dynamic.c
sys/netpfil/ipfw/ip_fw_private.h
sys/netpfil/ipfw/ip_fw_sockopt.c
sys/netpfil/ipfw/ip_fw_table.c