Page MenuHomeFreeBSD

sbin/ipfw: Allow tablearg as hostname
ClosedPublic

Authored by donner on May 11 2021, 8:26 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, May 6, 9:18 AM
Unknown Object (File)
Tue, Apr 30, 8:55 PM
Unknown Object (File)
Wed, Apr 24, 7:10 AM
Unknown Object (File)
Apr 20 2024, 2:12 AM
Unknown Object (File)
Apr 15 2024, 11:33 AM
Unknown Object (File)
Apr 12 2024, 9:10 PM
Unknown Object (File)
Mar 22 2024, 9:30 PM
Unknown Object (File)
Mar 22 2024, 9:30 PM
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