Bug 148091 - [ipfw] ipfw ipv6 handling broken.
Summary: [ipfw] ipfw ipv6 handling broken.
Status: Closed Unable to Reproduce
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 8.1-PRERELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-ipfw (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-23 15:30 UTC by sec
Modified: 2018-07-12 17:42 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description sec 2010-06-23 15:30:09 UTC
ipfw recently changed the meaning of "ME" to also match ipv6 addresses.
This is not only a POLA violation but breaks ipv6 when queues are involved.

I have the following rule in effect:

| 03010 queue 1 tcp from me 40000-40099,20,80 to any // Bandwidth: max 5 per-IP

with an corresponding pipe/queue setup:

| ipfw pipe 1 config bw 5KByte/s noerror
| ipfw queue 1 config mask dst-ip 0xffffffff pipe 1

This rule now matches ipv6 traffic, but apparently the queue code
can't handle ipv6:

Without ipfw:
| telnet -6 MY.IP 80

tcpdump shows a (correct) RST 
16:18:08.526171 IP6 2001::srchost.57434 > 2001::dsthost.80: Flags [S], seq 1763366169, win 5760, options [mss 1440,sackOK,TS val 5910142 ecr 0,nop,wscale 7], length 0
16:18:08.526249 IP6 2001::dsthost.80 > 2001::srchost.57434: Flags [R.], seq 0, ack 1763366170, win 0, length 0

With that rule above, a broken packet is created.
The tcpdump looks like this:

16:18:25.328411 IP6 2001::srchost.57435 > 2001::dsthost.80: Flags [S], seq 1383793472, win 5760, options [mss 1440,sackOK,TS val 5914343 ecr 0,nop,wscale 7], length 0
16:18:25.328485 IP6 2001::dsthost > 2001::srchost: ip-proto-64 20


Additionally I found no obvious way to restrict the rule back to TCP/v4 only --
There is a "me6" keyword, but no "me4" keyword. Obvious attempts like
"ipv4 tcp from me ..." or
"tcp from ipv4 me ..." or similar don't work either.

Fix: 

One or more of the following options:

a) Revert the change to "ME" back to ipv4 as to not violate POLA. 
b) Fix "queue" in ipfw as to not break when fed ipv6 packets.
c) Add a way to filter for v4/tcp
d) Add a BIG warning somewhere.
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2010-07-18 16:51:09 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-ipfw

Over to maintainer(s).
Comment 2 Mark Felder freebsd_committer freebsd_triage 2016-02-19 14:49:15 UTC
Is this still an issue? I'm doing queuing and ipv6 on CURRENT and have not experienced any issues.
Comment 3 Eitan Adler freebsd_committer freebsd_triage 2018-05-28 19:45:12 UTC
batch change:

For bugs that match the following
-  Status Is In progress 
AND
- Untouched since 2018-01-01.
AND
- Affects Base System OR Documentation

DO:

Reset to open status.


Note:
I did a quick pass but if you are getting this email it might be worthwhile to double check to see if this bug ought to be closed.