The argument parser does not recognise the optional port for an
"tablearg" argument. Fix simplifies the code by make the internal
representation expicit for the parser.
PR: 252744
MFC: 1 week
Differential D30164
sbin/ipfw: Fix parsing error in table based forward donner on May 7 2021, 7:07 PM. Authored by Tags None Referenced Files
Subscribers
Details The argument parser does not recognise the optional port for an PR: 252744 # ipfw add 7110 fwd tablearg,8000 tcp from 'table(5)' to any dst-port 80,8000,8080 07110 fwd tablearg,8000 tcp from table(5) to any 80,8000,8080
Diff Detail
Event TimelineComment Actions LGTM. Keep in mind that I'm a ports committer. I'm not a src committer, and haven't really been doing much work on ipfw lately. I'm more focused on ports nowadays and if not that, then drm-kmod/linuxkpi (which I only started with). It's just that ports committers can commit to src with approval of a src committer, and vice versa. I'd recommend getting a src committer to approve as well. Comment Actions Replacing _substrcmp() with strncmp(,,8) breaks the case, when "tablearg" is part of hostname:port syntax. Comment Actions No, it _substrcmp() is used to match any shorter string instead of "tablearg", and prints a depreciation warning. strncmp(,,8) does match "tablearg" exactly regardless of an optional port part. |