Hi, 
In the kernel, I added some customized options to the ip_options struct, and I send the ip packet with these option fields set. 

After I receive the packet, I extract these options and try to remove them from the ip packet because I don't want these options be delivered to upper layer. 

In the method ip_rcv_finish of the file ip_input.c, I added following code: 

/*********My code to process the options****/
process_my_options(skb);
/*********My code to remove the options ****/
  //skb_pull(skb, sizeof(struct iphdr) + 12);
//skb_push(skb, sizeof(struct iphdr));
//skb_reset_network_header(skb);
//iph->ihl -= 3;

/*********Normal process of the ip packet.****/
if (iph->ihl > 5 && ip_rcv_options(skb))
goto drop;


The question is at how to remove the options. I tried some code but none of them works correctly. Can anybody give me some suggestion? Thanks.