udp_offload.c (2423496af35d94a87156b063ea5cedffc10a70a1) | udp_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. --- 15 unchanged lines hidden (view full) --- 24 unsigned int mss; 25 unsigned int unfrag_ip6hlen, unfrag_len; 26 struct frag_hdr *fptr; 27 u8 *packet_start, *prevhdr; 28 u8 nexthdr; 29 u8 frag_hdr_sz = sizeof(struct frag_hdr); 30 __wsum csum; 31 int tnl_hlen; | 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. --- 15 unchanged lines hidden (view full) --- 24 unsigned int mss; 25 unsigned int unfrag_ip6hlen, unfrag_len; 26 struct frag_hdr *fptr; 27 u8 *packet_start, *prevhdr; 28 u8 nexthdr; 29 u8 frag_hdr_sz = sizeof(struct frag_hdr); 30 __wsum csum; 31 int tnl_hlen; |
32 int err; |
|
32 33 mss = skb_shinfo(skb)->gso_size; 34 if (unlikely(skb->len <= mss)) 35 goto out; 36 37 if (skb_gso_ok(skb, features | NETIF_F_GSO_ROBUST)) { 38 /* Packet is from an untrusted source, reset gso_segs. */ 39 --- 45 unchanged lines hidden (view full) --- 85 if (skb->mac_header < (tnl_hlen + frag_hdr_sz)) { 86 if (gso_pskb_expand_head(skb, tnl_hlen + frag_hdr_sz)) 87 goto out; 88 } 89 90 /* Find the unfragmentable header and shift it left by frag_hdr_sz 91 * bytes to insert fragment header. 92 */ | 33 34 mss = skb_shinfo(skb)->gso_size; 35 if (unlikely(skb->len <= mss)) 36 goto out; 37 38 if (skb_gso_ok(skb, features | NETIF_F_GSO_ROBUST)) { 39 /* Packet is from an untrusted source, reset gso_segs. */ 40 --- 45 unchanged lines hidden (view full) --- 86 if (skb->mac_header < (tnl_hlen + frag_hdr_sz)) { 87 if (gso_pskb_expand_head(skb, tnl_hlen + frag_hdr_sz)) 88 goto out; 89 } 90 91 /* Find the unfragmentable header and shift it left by frag_hdr_sz 92 * bytes to insert fragment header. 93 */ |
93 unfrag_ip6hlen = ip6_find_1stfragopt(skb, &prevhdr); 94 if (unfrag_ip6hlen < 0) 95 return ERR_PTR(unfrag_ip6hlen); | 94 err = ip6_find_1stfragopt(skb, &prevhdr); 95 if (err < 0) 96 return ERR_PTR(err); 97 unfrag_ip6hlen = err; |
96 nexthdr = *prevhdr; 97 *prevhdr = NEXTHDR_FRAGMENT; 98 unfrag_len = (skb_network_header(skb) - skb_mac_header(skb)) + 99 unfrag_ip6hlen + tnl_hlen; 100 packet_start = (u8 *) skb->head + SKB_GSO_CB(skb)->mac_offset; 101 memmove(packet_start-frag_hdr_sz, packet_start, unfrag_len); 102 103 SKB_GSO_CB(skb)->mac_offset -= frag_hdr_sz; --- 81 unchanged lines hidden --- | 98 nexthdr = *prevhdr; 99 *prevhdr = NEXTHDR_FRAGMENT; 100 unfrag_len = (skb_network_header(skb) - skb_mac_header(skb)) + 101 unfrag_ip6hlen + tnl_hlen; 102 packet_start = (u8 *) skb->head + SKB_GSO_CB(skb)->mac_offset; 103 memmove(packet_start-frag_hdr_sz, packet_start, unfrag_len); 104 105 SKB_GSO_CB(skb)->mac_offset -= frag_hdr_sz; --- 81 unchanged lines hidden --- |