[1]Summary of the problem: ip_options_fragment() has no effect on fragmentation
[2]Full description of the problem: When I send IPv4 packet(contain Record Route Option) which need to be fragmented to the router, the router can not fragment it correctly. After fragmented by router, the second fragmentation still contain Record Route Option. Refer to RFC791, Record Route Option must Not be copied on fragmentation, goes in first fragment only. ip_options_fragment() is the implemental function, but there are some BUGs in it: ip_option.c: line 207: void ip_options_fragment(struct sk_buff * skb) { unsigned char * optptr = skb->nh.raw; struct ip_options * opt = &(IPCB(skb)->opt);...optptr get a error pointer to the ipv4 options, now it is pointer to the IPv4 header, correct is as following:
unsigned char * optptr = skb->nh.raw + sizeof(struct iphdr); Following is the patch:--- linux-2.6.15.1/net/ipv4/ip_options.c.orig 2006-01-27 09:14:33.463612696 +0900
+++ linux-2.6.15.1/net/ipv4/ip_options.c 2006-01-27 09:12:21.857619848 +0900 @@ -207,7 +207,7 @@ void ip_options_fragment(struct sk_buff * skb) { - unsigned char * optptr = skb->nh.raw; + unsigned char * optptr = skb->nh.raw + sizeof(struct iphdr); struct ip_options * opt = &(IPCB(skb)->opt); int l = opt->optlen; int optlen; Regards -------------------------------------------------- Wei Yongjun FUJITSU INTERNAL:7124-2865 [EMAIL PROTECTED]--------------------------------------------------
ip_options_fragment.patch
Description: Binary data