Skip to contentSkip to conversation

netfilter6 ip6_packet_match doesn't properly skip exthdrs

PATCH New Olaf Kirch 1 participant 1 message Sep 30, 2004

Subsystems (3)
lore
Share & tools
lore

Olaf Kirch

author
#0 lore raw

PATCH 1/1 netfilter6 ip6_packet_match doesn't properly skip exthdrs

This patch fixes a bug in the ip6_tables code that tries to skip extension headers. Packets with extension headers were usually not matched because the code was looking at the wrong offset inside the skb.

net/ipv6/netfilter/ip6_tables.c +1 -1
Index: linux-2.6.8.nf/net/ipv6/netfilter/ip6_tables.c
===================================================================
@@ -219,7 +219,7 @@
 		u_int16_t ptr;		/* Header offset in skb */
 		u_int16_t hdrlen;	/* Header */
 
-		ptr = IPV6_HDR_LEN;
+		ptr = ((char *) ipv6 - (char *) skb->data) + IPV6_HDR_LEN;
 
 		while (ip6t_ext_hdr(currenthdr)) {
 	                /* Is there enough space for the next ext header? */
Signature · 3 lines
Olaf Kirch     | Things that make Monday morning interesting, #1:
[email protected]   |        "I want to use NFS over AX25, can you help me?"
---------------+