Page MenuHomeFreeBSD

sbin/ipfw: fix parsing error in nat config port_range
ClosedPublic

Authored by terehovv_mail.ru on May 15 2026, 9:59 AM.
Tags
None
Referenced Files
F168899210: D57010.id177874.diff
Sun, Aug 30, 4:14 PM
F168898797: D57010.id178198.diff
Sun, Aug 30, 4:11 PM
F168769672: D57010.id177871.diff
Sun, Aug 30, 1:45 AM
F168769655: D57010.id178301.diff
Sun, Aug 30, 1:45 AM
Unknown Object (File)
Sat, Aug 29, 11:26 PM
Unknown Object (File)
Sat, Aug 29, 1:57 PM
Unknown Object (File)
Fri, Aug 28, 1:53 PM
Unknown Object (File)
Fri, Aug 28, 10:18 AM

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

Fix tests for nat:ipfw_portalias

Added set -e to the test script to ensure it is correct

Code is fine, some finishing touches are needed.

sbin/ipfw/nat.c
765

I would use base = 0 here, no reason to limit port range to be in decimal form.

766

ipfw.8 must be changed to reflect port range limits:

port_range lower-upper
        Set the aliasing ports between the ranges given.  Upper port has
        to be greater than lower.

Update ipfw.8 man page
Update strtol() to use base = 0

This revision is now accepted and ready to land.May 20 2026, 1:55 PM
This revision was automatically updated to reflect the committed changes.