]> err.no Git - linux-2.6/blobdiff - net/ipv4/ip_options.c
[IPV6]: Remove unused code in ndisc_send_redirect().
[linux-2.6] / net / ipv4 / ip_options.c
index 2fa411381b11475b8066353a15d56d52a68f2b79..aeed4e5858ec2305e8c1e786bd7e6d75131b612e 100644 (file)
@@ -255,17 +255,14 @@ int ip_options_compile(struct ip_options * opt, struct sk_buff * skb)
        unsigned char * optptr;
        int optlen;
        unsigned char * pp_ptr = NULL;
-       struct rtable *rt = skb ? skb->rtable : NULL;
-
-       if (!opt) {
-               opt = &(IPCB(skb)->opt);
-               iph = skb_network_header(skb);
-               opt->optlen = ((struct iphdr *)iph)->ihl*4 - sizeof(struct iphdr);
-               optptr = iph + sizeof(struct iphdr);
-       } else {
+       struct rtable *rt = NULL;
+
+       if (skb != NULL) {
+               rt = skb->rtable;
+               optptr = (unsigned char *)&(ip_hdr(skb)[1]);
+       } else
                optptr = opt->__data;
-               iph = optptr - sizeof(struct iphdr);
-       }
+       iph = optptr - sizeof(struct iphdr);
 
        for (l = opt->optlen; l > 0; ) {
                switch (*optptr) {