Page MenuHomeFreeBSD

sbin/ipfw: Allow tablearg as hostname
ClosedPublic

Authored by donner on May 11 2021, 8:26 AM.
Tags
None
Referenced Files
F153395521: D30208.id89008.diff
Mon, Apr 20, 10:08 PM
F153386253: D30208.id.diff
Mon, Apr 20, 8:51 PM
Unknown Object (File)
Sun, Apr 19, 8:55 PM
Unknown Object (File)
Sat, Apr 18, 8:11 PM
Unknown Object (File)
Thu, Apr 9, 4:17 PM
Unknown Object (File)
Thu, Apr 9, 9:38 AM
Unknown Object (File)
Tue, Apr 7, 8:02 AM
Unknown Object (File)
Sun, Mar 29, 4:58 AM
Subscribers

Details

Summary

Hostnames starting with "tablearg" are considered as a functional
argument instead of a literal.

Reported by: ae

Test Plan

The binary was supplied with some printf before and after the
transformation:

$ ipfw add fwd 0.0.0.0 from any to 'table(1)'
>>> 0.0.0.0 <<<
>>> 0.0.0.0 <<<

$ ipfw add fwd tablearg from any to 'table(1)'
>>> tablearg <<<
>>> 0.0.0.0 <<<

$ ipfw add fwd table,80 from any to 'table(1)'
>>> table,80 <<<
>>> table,80 <<<

$ ipfw add fwd tablearg,80 from any to 'table(1)'
>>> tablearg,80 <<<
>>> 0.0.0.0,80 <<<

$ ipfw add fwd tableargs.test from any to 'table(1)'
>>> tableargs.test <<<
>>> tableargs.test <<<

$ ipfw add fwd tablearg.local:80 from any to 'table(1)'
>>> tablearg.local:80 <<<
>>> tablearg.local:80 <<<

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable