Bug 242318 - ipfw - fix option 'ipversion' matching only IPv4 packets
Summary: ipfw - fix option 'ipversion' matching only IPv4 packets
Status: Closed Overcome By Events
Alias: None
Product: Documentation
Classification: Unclassified
Component: Manual Pages (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-ipfw (Nobody)
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2019-11-30 09:42 UTC by Freddy DISSAUX
Modified: 2021-10-17 07:20 UTC (History)
3 users (show)

See Also:


Attachments
replace IP by IPv4 (411 bytes, patch)
2019-11-30 09:42 UTC, Freddy DISSAUX
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Freddy DISSAUX 2019-11-30 09:42:06 UTC
Created attachment 209546 [details]
replace IP by IPv4

option 'ipversion' match only IPv4 packets:

sys/netpfil/ipfw/ip_fw2.c:
...
  2207                          case O_IPVER:
  2208                                  match = (is_ipv4 &&
  2209                                      cmd->arg1 == ip->ip_v);
  2210                                  break;

As others options (iptos, ipid ...), replace IP by IPv4:

      ipversion ver
             Matches IP packets whose IP version field is ver.

become

     ipversion ver
             Matches IPv4 packets whose IP version field is ver.
Comment 1 Felix Johnson freebsd_triage 2021-10-17 05:14:06 UTC
ip_fw2.c added IPv6 support for ipversion in this revision:
https://cgit.freebsd.org/src/commit/sys/netpfil/ipfw/ip_fw2.c?id=1388cfe1b500db39d4858083f333e50c0f80b5e4

Since IPv4 and IPv6 are supported, do we still need this PR?
Comment 2 Guangyuan Yang freebsd_committer freebsd_triage 2021-10-17 07:20:49 UTC
Closing - thanks!