Skip to contentSkip to conversation

(usagi-core 19560) [RFC] filtering bridged IPv6 traffic

DISCUSSION Yasuyuki Kozakai 1 participant 1 message Sep 1, 2004 1 message not in the archive netfilter

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

[Cc'ing netfilter-devel]

Hi,

From: Bart De Schuymer <[email protected]>
Date: Tue, 31 Aug 2004 23:09:59 +0200

Quoted 5 lines

Hello,

Dave redirected me to this list.
I have made a patch that allows ip6tables to see bridged IPv6 traffic. The patch has been tested but there is one thing I'm not sure about.

Great. This was missing piece.

Quoted 17 lines

Before giving a bridged IPv6 packet to ip6tables, the IPv6 sanity checks are done (copied from ipv6_rcv()). Unfortunately, these checks are more complicated than the ones done for IPv4. I would like to know which checks are necessary for ip6tables not to behave oddly (oops or whatever).

I'm particularly interested in knowing if the check below has to be done (copied from ipv6_rcv()):

if (hdr->nexthdr == NEXTHDR_HOP) {
        skb->h.raw = (u8*)(hdr+1);
        if (ipv6_parse_hopopts(skb, offsetof(struct ipv6hdr, nexthdr)) < 0) {
                IP6_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);
                return 0;
        }
        hdr = skb->nh.ipv6h;
}
Quoted 4 lines

If it's necessary to call ipv6_parse_hopopts() then this function will need to be exported (the other option would be copying all the code to br_netfilter.c). Note that we only need ip6tables to behave correctly. So, if this function call is not absolutely needed, I would opt not to call it.

I don't correctly know why HBH header is processed before PRE_ROUTING. But at least, trimming the packet length is necessary if it is jumbo payload.

Quoted 3 lines

I think the line skb->h.raw = (u8*)(hdr+1); will be needed for ip6tables to behave correctly. This can be easily undone later, so that should be no problem.

I think this is not necessary. If I understand correctly, netfilter assumes that
- skb->nh.raw and skb->data point to the start of IPv6 header
- skb->len is equal to the length from the start of IPv6 header to the end of application data.

When netfilter want the transport header, it parses IPv6 header and extension headers.

Quoted 2 lines

Is the IP6CB stuff needed for ip6tables? My guess is no.

No.

Quoted 8 lines

Since the patch has already been posted on netdev and netfilter-devel, I opted not to post it here again. I'll happily send it to you if you'd like to have a look (it is versus 2.6.8.1) . The patch has been tested by someone with ip6tables and he found no problems, but I guess I'll be setting up a little IPv6 network in the near future to test it myself.

cheers,
Bart

-----------------------------------------------------------------
Yasuyuki KOZAKAI @ USAGI Project <[email protected]>