Skip to contentSkip to conversation

ipv6: Make IP6CB(skb)->nhoff 16-bit.

RFC PATCH In review David Miller 1 participant 2 messages Jul 16, 2010 – Jul 20, 2010

Subsystems (2)
lore
Share & tools
lore

David Miller

author maintainer
#0 lore raw

RFC PATCH 1/1 ipv6: Make IP6CB(skb)->nhoff 16-bit.

Even with jumbograms I cannot see any way in which we would need to records a larger than 65535 valued next-header offset.

The maximum extension header length is (256 << 3) == 2048. There are only a handful of extension headers specified which we'd even accept (say 5 or 6), therefore the largest next-header offset we'd ever have to contend with is something less than say 16k.

Therefore make it a u16 instead of a u32.

---
Can anyone find any holes in this? I want to do this so we can legitimately rip ndisc_nodetype out of struct sk_buff and stick it into the IP6CB where it belongs. Currently there isn't enough space, but with this change there will be.

include/linux/ipv6.h +1 -1
index 940e215..ab9e9e8 100644
@@ -246,7 +246,7 @@ struct inet6_skb_parm {
 	__u16			srcrt;
 	__u16			dst1;
 	__u16			lastopt;
-	__u32			nhoff;
+	__u16			nhoff;
 	__u16			flags;
 #if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)
 	__u16			dsthao;
author maintainer
#1 lore raw

From: David Miller <[email protected]>
Date: Thu, 15 Jul 2010 22:30:11 -0700 (PDT)

Quoted 12 lines

Even with jumbograms I cannot see any way in which we would need to records a larger than 65535 valued next-header offset.

The maximum extension header length is (256 << 3) == 2048. There are only a handful of extension headers specified which we'd even accept (say 5 or 6), therefore the largest next-header offset we'd ever have to contend with is something less than say 16k.

Therefore make it a u16 instead of a u32.

Quoted 7 lines

---
Can anyone find any holes in this? I want to do this so we can legitimately rip ndisc_nodetype out of struct sk_buff and stick it into the IP6CB where it belongs. Currently there isn't enough space, but with this change there will be.

No holes claimed by anyone, so... applied :-)