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
F162732975: D57010.id178301.diff
Thu, Jul 16, 7:00 AM
Unknown Object (File)
Wed, Jul 15, 8:29 AM
Unknown Object (File)
Wed, Jul 15, 7:22 AM
Unknown Object (File)
Wed, Jul 15, 7:22 AM
Unknown Object (File)
Fri, Jul 10, 11:21 AM
Unknown Object (File)
Thu, Jul 9, 9:49 AM
Unknown Object (File)
Wed, Jul 8, 10:38 PM
Unknown Object (File)
Sun, Jul 5, 8:04 PM

Diff Detail

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

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
771

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

772

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.