Merge tag 'stable/for-linus-3.8-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel...
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / net / ipv6 / exthdrs.c
index f005acc58b2aad4db9119e307b45d4029f2bc159..473f628f9f203d2e0c58466f32603ce50a330402 100644 (file)
 
 #include <asm/uaccess.h>
 
-int ipv6_find_tlv(struct sk_buff *skb, int offset, int type)
-{
-       const unsigned char *nh = skb_network_header(skb);
-       int packet_len = skb->tail - skb->network_header;
-       struct ipv6_opt_hdr *hdr;
-       int len;
-
-       if (offset + 2 > packet_len)
-               goto bad;
-       hdr = (struct ipv6_opt_hdr *)(nh + offset);
-       len = ((hdr->hdrlen + 1) << 3);
-
-       if (offset + len > packet_len)
-               goto bad;
-
-       offset += 2;
-       len -= 2;
-
-       while (len > 0) {
-               int opttype = nh[offset];
-               int optlen;
-
-               if (opttype == type)
-                       return offset;
-
-               switch (opttype) {
-               case IPV6_TLV_PAD1:
-                       optlen = 1;
-                       break;
-               default:
-                       optlen = nh[offset + 1] + 2;
-                       if (optlen > len)
-                               goto bad;
-                       break;
-               }
-               offset += optlen;
-               len -= optlen;
-       }
-       /* not_found */
- bad:
-       return -1;
-}
-EXPORT_SYMBOL_GPL(ipv6_find_tlv);
-
 /*
  *     Parsing tlv encoded headers.
  *
@@ -528,12 +484,12 @@ unknown_rh:
 
 static const struct inet6_protocol rthdr_protocol = {
        .handler        =       ipv6_rthdr_rcv,
-       .flags          =       INET6_PROTO_NOPOLICY | INET6_PROTO_GSO_EXTHDR,
+       .flags          =       INET6_PROTO_NOPOLICY,
 };
 
 static const struct inet6_protocol destopt_protocol = {
        .handler        =       ipv6_destopt_rcv,
-       .flags          =       INET6_PROTO_NOPOLICY | INET6_PROTO_GSO_EXTHDR,
+       .flags          =       INET6_PROTO_NOPOLICY,
 };
 
 static const struct inet6_protocol nodata_protocol = {
@@ -559,10 +515,10 @@ int __init ipv6_exthdrs_init(void)
 
 out:
        return ret;
-out_rthdr:
-       inet6_del_protocol(&rthdr_protocol, IPPROTO_ROUTING);
 out_destopt:
        inet6_del_protocol(&destopt_protocol, IPPROTO_DSTOPTS);
+out_rthdr:
+       inet6_del_protocol(&rthdr_protocol, IPPROTO_ROUTING);
        goto out;
 };