ip6_offload.c (2423496af35d94a87156b063ea5cedffc10a70a1) ip6_offload.c (7dd7eb9513bd02184d45f000ab69d78cb1fa1531)
1/*
2 * IPV6 GSO/GRO offload support
3 * Linux INET6 implementation
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version
8 * 2 of the License, or (at your option) any later version.

--- 49 unchanged lines hidden (view full) ---

58static struct sk_buff *ipv6_gso_segment(struct sk_buff *skb,
59 netdev_features_t features)
60{
61 struct sk_buff *segs = ERR_PTR(-EINVAL);
62 struct ipv6hdr *ipv6h;
63 const struct net_offload *ops;
64 int proto;
65 struct frag_hdr *fptr;
1/*
2 * IPV6 GSO/GRO offload support
3 * Linux INET6 implementation
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version
8 * 2 of the License, or (at your option) any later version.

--- 49 unchanged lines hidden (view full) ---

58static struct sk_buff *ipv6_gso_segment(struct sk_buff *skb,
59 netdev_features_t features)
60{
61 struct sk_buff *segs = ERR_PTR(-EINVAL);
62 struct ipv6hdr *ipv6h;
63 const struct net_offload *ops;
64 int proto;
65 struct frag_hdr *fptr;
66 unsigned int unfrag_ip6hlen;
67 unsigned int payload_len;
68 u8 *prevhdr;
69 int offset = 0;
70 bool encap, udpfrag;
71 int nhoff;
72 bool gso_partial;
73
74 skb_reset_network_header(skb);

--- 36 unchanged lines hidden (view full) ---

111 SKB_GSO_CB(skb)->data_offset +
112 skb->head - (unsigned char *)(ipv6h + 1);
113 else
114 payload_len = skb->len - nhoff - sizeof(*ipv6h);
115 ipv6h->payload_len = htons(payload_len);
116 skb->network_header = (u8 *)ipv6h - skb->head;
117
118 if (udpfrag) {
66 unsigned int payload_len;
67 u8 *prevhdr;
68 int offset = 0;
69 bool encap, udpfrag;
70 int nhoff;
71 bool gso_partial;
72
73 skb_reset_network_header(skb);

--- 36 unchanged lines hidden (view full) ---

110 SKB_GSO_CB(skb)->data_offset +
111 skb->head - (unsigned char *)(ipv6h + 1);
112 else
113 payload_len = skb->len - nhoff - sizeof(*ipv6h);
114 ipv6h->payload_len = htons(payload_len);
115 skb->network_header = (u8 *)ipv6h - skb->head;
116
117 if (udpfrag) {
119 unfrag_ip6hlen = ip6_find_1stfragopt(skb, &prevhdr);
120 if (unfrag_ip6hlen < 0)
121 return ERR_PTR(unfrag_ip6hlen);
122 fptr = (struct frag_hdr *)((u8 *)ipv6h + unfrag_ip6hlen);
118 int err = ip6_find_1stfragopt(skb, &prevhdr);
119 if (err < 0)
120 return ERR_PTR(err);
121 fptr = (struct frag_hdr *)((u8 *)ipv6h + err);
123 fptr->frag_off = htons(offset);
124 if (skb->next)
125 fptr->frag_off |= htons(IP6_MF);
126 offset += (ntohs(ipv6h->payload_len) -
127 sizeof(struct frag_hdr));
128 }
129 if (encap)
130 skb_reset_inner_headers(skb);

--- 260 unchanged lines hidden ---
122 fptr->frag_off = htons(offset);
123 if (skb->next)
124 fptr->frag_off |= htons(IP6_MF);
125 offset += (ntohs(ipv6h->payload_len) -
126 sizeof(struct frag_hdr));
127 }
128 if (encap)
129 skb_reset_inner_headers(skb);

--- 260 unchanged lines hidden ---