diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2006-07-03 10:25:08 -0400 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2006-07-03 10:25:08 -0400 |
commit | 0a1340c185734a57fbf4775927966ad4a1347b02 (patch) | |
tree | d9ed8f0dd809a7c542a3356601125ea5b5aaa804 /net/ipv4 | |
parent | af18ddb8864b096e3ed4732e2d4b21c956dcfe3a (diff) | |
parent | 29454dde27d8e340bb1987bad9aa504af7081eba (diff) |
Merge rsync://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts:
include/linux/kernel.h
Diffstat (limited to 'net/ipv4')
77 files changed, 240 insertions, 133 deletions
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c index 0a277453526..8d157157bf8 100644 --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c @@ -68,6 +68,7 @@ */ #include <linux/config.h> +#include <linux/err.h> #include <linux/errno.h> #include <linux/types.h> #include <linux/socket.h> @@ -1096,6 +1097,54 @@ int inet_sk_rebuild_header(struct sock *sk) EXPORT_SYMBOL(inet_sk_rebuild_header); +static struct sk_buff *inet_gso_segment(struct sk_buff *skb, int features) +{ + struct sk_buff *segs = ERR_PTR(-EINVAL); + struct iphdr *iph; + struct net_protocol *ops; + int proto; + int ihl; + int id; + + if (!pskb_may_pull(skb, sizeof(*iph))) + goto out; + + iph = skb->nh.iph; + ihl = iph->ihl * 4; + if (ihl < sizeof(*iph)) + goto out; + + if (!pskb_may_pull(skb, ihl)) + goto out; + + skb->h.raw = __skb_pull(skb, ihl); + iph = skb->nh.iph; + id = ntohs(iph->id); + proto = iph->protocol & (MAX_INET_PROTOS - 1); + segs = ERR_PTR(-EPROTONOSUPPORT); + + rcu_read_lock(); + ops = rcu_dereference(inet_protos[proto]); + if (ops && ops->gso_segment) + segs = ops->gso_segment(skb, features); + rcu_read_unlock(); + + if (!segs || unlikely(IS_ERR(segs))) + goto out; + + skb = segs; + do { + iph = skb->nh.iph; + iph->id = htons(id++); + iph->tot_len = htons(skb->len - skb->mac_len); + iph->check = 0; + iph->check = ip_fast_csum(skb->nh.raw, iph->ihl); + } while ((skb = skb->next)); + +out: + return segs; +} + #ifdef CONFIG_IP_MULTICAST static struct net_protocol igmp_protocol = { .handler = igmp_rcv, @@ -1105,6 +1154,7 @@ static struct net_protocol igmp_protocol = { static struct net_protocol tcp_protocol = { .handler = tcp_v4_rcv, .err_handler = tcp_v4_err, + .gso_segment = tcp_tso_segment, .no_policy = 1, }; @@ -1150,6 +1200,7 @@ static int ipv4_proc_init(void); static struct packet_type ip_packet_type = { .type = __constant_htons(ETH_P_IP), .func = ip_rcv, + .gso_segment = inet_gso_segment, }; static int __init inet_init(void) diff --git a/net/ipv4/ah4.c b/net/ipv4/ah4.c index c7782230080..8e748be36c5 100644 --- a/net/ipv4/ah4.c +++ b/net/ipv4/ah4.c @@ -1,4 +1,3 @@ -#include <linux/config.h> #include <linux/module.h> #include <net/ip.h> #include <net/xfrm.h> diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c index 4749d504c62..7b51b3bdb54 100644 --- a/net/ipv4/arp.c +++ b/net/ipv4/arp.c @@ -80,7 +80,6 @@ #include <linux/kernel.h> #include <linux/sched.h> #include <linux/capability.h> -#include <linux/config.h> #include <linux/socket.h> #include <linux/sockios.h> #include <linux/errno.h> diff --git a/net/ipv4/datagram.c b/net/ipv4/datagram.c index c1b42b5257f..ec5da4fbd9f 100644 --- a/net/ipv4/datagram.c +++ b/net/ipv4/datagram.c @@ -11,7 +11,6 @@ * 2 of the License, or (at your option) any later version. */ -#include <linux/config.h> #include <linux/types.h> #include <linux/module.h> #include <linux/ip.h> diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index 54419b27686..a7c65e9e5ec 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c @@ -27,7 +27,6 @@ * if no match found. */ -#include <linux/config.h> #include <asm/uaccess.h> #include <asm/system.h> diff --git a/net/ipv4/esp4.c b/net/ipv4/esp4.c index 9bbdd449455..4e112738b3f 100644 --- a/net/ipv4/esp4.c +++ b/net/ipv4/esp4.c @@ -1,4 +1,3 @@ -#include <linux/config.h> #include <linux/module.h> #include <net/ip.h> #include <net/xfrm.h> diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c index 31387abf53a..ba2a70745a6 100644 --- a/net/ipv4/fib_frontend.c +++ b/net/ipv4/fib_frontend.c @@ -15,7 +15,6 @@ * 2 of the License, or (at your option) any later version. */ -#include <linux/config.h> #include <linux/module.h> #include <asm/uaccess.h> #include <asm/system.h> diff --git a/net/ipv4/fib_hash.c b/net/ipv4/fib_hash.c index e2890ec8159..3c1d32ad35f 100644 --- a/net/ipv4/fib_hash.c +++ b/net/ipv4/fib_hash.c @@ -15,7 +15,6 @@ * 2 of the License, or (at your option) any later version. */ -#include <linux/config.h> #include <asm/uaccess.h> #include <asm/system.h> #include <linux/bitops.h> diff --git a/net/ipv4/fib_rules.c b/net/ipv4/fib_rules.c index ec566f3e66c..6c642d11d4c 100644 --- a/net/ipv4/fib_rules.c +++ b/net/ipv4/fib_rules.c @@ -19,7 +19,6 @@ * Marc Boucher : routing by fwmark */ -#include <linux/config.h> #include <asm/uaccess.h> #include <asm/system.h> #include <linux/bitops.h> diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c index 0f4145babb1..5f87533684d 100644 --- a/net/ipv4/fib_semantics.c +++ b/net/ipv4/fib_semantics.c @@ -15,7 +15,6 @@ * 2 of the License, or (at your option) any later version. */ -#include <linux/config.h> #include <asm/uaccess.h> #include <asm/system.h> #include <linux/bitops.h> diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c index 95a639f2e3d..1cb65305e10 100644 --- a/net/ipv4/fib_trie.c +++ b/net/ipv4/fib_trie.c @@ -52,7 +52,6 @@ #define VERSION "0.407" -#include <linux/config.h> #include <asm/uaccess.h> #include <asm/system.h> #include <asm/bitops.h> diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c index 017900172f7..4c86ac3d882 100644 --- a/net/ipv4/icmp.c +++ b/net/ipv4/icmp.c @@ -64,7 +64,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/jiffies.h> diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c index ab680c851aa..d299c8e547d 100644 --- a/net/ipv4/igmp.c +++ b/net/ipv4/igmp.c @@ -72,7 +72,6 @@ * Vinay Kulkarni */ -#include <linux/config.h> #include <linux/module.h> #include <asm/uaccess.h> #include <asm/system.h> diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c index 9a01bb81f8b..e50a1bfd7cc 100644 --- a/net/ipv4/inet_connection_sock.c +++ b/net/ipv4/inet_connection_sock.c @@ -13,7 +13,6 @@ * 2 of the License, or(at your option) any later version. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/jhash.h> diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c index 457db99c76d..8e7e41b66c7 100644 --- a/net/ipv4/inet_diag.c +++ b/net/ipv4/inet_diag.c @@ -11,7 +11,6 @@ * 2 of the License, or (at your option) any later version. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/fcntl.h> diff --git a/net/ipv4/inet_hashtables.c b/net/ipv4/inet_hashtables.c index ee9b5515b9a..95fac553299 100644 --- a/net/ipv4/inet_hashtables.c +++ b/net/ipv4/inet_hashtables.c @@ -13,7 +13,6 @@ * 2 of the License, or (at your option) any later version. */ -#include <linux/config.h> #include <linux/module.h> #include <linux/random.h> #include <linux/sched.h> diff --git a/net/ipv4/inet_timewait_sock.c b/net/ipv4/inet_timewait_sock.c index 417f126c749..cdd805344c6 100644 --- a/net/ipv4/inet_timewait_sock.c +++ b/net/ipv4/inet_timewait_sock.c @@ -8,7 +8,6 @@ * From code orinally in TCP */ -#include <linux/config.h> #include <net/inet_hashtables.h> #include <net/inet_timewait_sock.h> diff --git a/net/ipv4/ip_forward.c b/net/ipv4/ip_forward.c index 9f0bb529ab7..a22d11d2911 100644 --- a/net/ipv4/ip_forward.c +++ b/net/ipv4/ip_forward.c @@ -21,7 +21,6 @@ * Mike McLagan : Routing by source */ -#include <linux/config.h> #include <linux/types.h> #include <linux/mm.h> #include <linux/sched.h> diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c index da734c43917..b84b53a4752 100644 --- a/net/ipv4/ip_fragment.c +++ b/net/ipv4/ip_fragment.c @@ -23,7 +23,6 @@ */ #include <linux/compiler.h> -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/mm.h> diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c index ab99bebdcdc..6ff9b10d956 100644 --- a/net/ipv4/ip_gre.c +++ b/net/ipv4/ip_gre.c @@ -11,7 +11,6 @@ */ #include <linux/capability.h> -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/sched.h> diff --git a/net/ipv4/ip_input.c b/net/ipv4/ip_input.c index c9026dbf4c9..e1a7dba2fa8 100644 --- a/net/ipv4/ip_input.c +++ b/net/ipv4/ip_input.c @@ -121,7 +121,6 @@ #include <linux/kernel.h> #include <linux/string.h> #include <linux/errno.h> -#include <linux/config.h> #include <linux/net.h> #include <linux/socket.h> diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c index 8538aac3d14..ca0e714613f 100644 --- a/net/ipv4/ip_output.c +++ b/net/ipv4/ip_output.c @@ -53,7 +53,6 @@ #include <linux/mm.h> #include <linux/string.h> #include <linux/errno.h> -#include <linux/config.h> #include <linux/socket.h> #include <linux/sockios.h> @@ -210,8 +209,7 @@ static inline int ip_finish_output(struct sk_buff *skb) return dst_output(skb); } #endif - if (skb->len > dst_mtu(skb->dst) && - !(skb_shinfo(skb)->ufo_size || skb_shinfo(skb)->tso_size)) + if (skb->len > dst_mtu(skb->dst) && !skb_shinfo(skb)->gso_size) return ip_fragment(skb, ip_finish_output2); else return ip_finish_output2(skb); @@ -362,7 +360,7 @@ packet_routed: } ip_select_ident_more(iph, &rt->u.dst, sk, - (skb_shinfo(skb)->tso_segs ?: 1) - 1); + (skb_shinfo(skb)->gso_segs ?: 1) - 1); /* Add an IP checksum. */ ip_send_check(iph); @@ -744,7 +742,8 @@ static inline int ip_ufo_append_data(struct sock *sk, (length - transhdrlen)); if (!err) { /* specify the length of each IP datagram fragment*/ - skb_shinfo(skb)->ufo_size = (mtu - fragheaderlen); + skb_shinfo(skb)->gso_size = mtu - fragheaderlen; + skb_shinfo(skb)->gso_type = SKB_GSO_UDP; __skb_queue_tail(&sk->sk_write_queue, skb); return 0; @@ -1087,14 +1086,16 @@ ssize_t ip_append_page(struct sock *sk, struct page *page, inet->cork.length += size; if ((sk->sk_protocol == IPPROTO_UDP) && - (rt->u.dst.dev->features & NETIF_F_UFO)) - skb_shinfo(skb)->ufo_size = (mtu - fragheaderlen); + (rt->u.dst.dev->features & NETIF_F_UFO)) { + skb_shinfo(skb)->gso_size = mtu - fragheaderlen; + skb_shinfo(skb)->gso_type = SKB_GSO_UDP; + } while (size > 0) { int i; - if (skb_shinfo(skb)->ufo_size) + if (skb_shinfo(skb)->gso_size) len = size; else { diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c index 12e0bf19f24..84f43a3c909 100644 --- a/net/ipv4/ip_sockglue.c +++ b/net/ipv4/ip_sockglue.c @@ -17,7 +17,6 @@ * Mike McLagan : Routing by source */ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/mm.h> diff --git a/net/ipv4/ipcomp.c b/net/ipv4/ipcomp.c index 3ed8b57a100..8e037484753 100644 --- a/net/ipv4/ipcomp.c +++ b/net/ipv4/ipcomp.c @@ -13,7 +13,6 @@ * - Compression stats. * - Adaptive compression. */ -#include <linux/config.h> #include <linux/module.h> #include <asm/scatterlist.h> #include <asm/semaphore.h> diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c index ea398ee43f2..3291d5192aa 100644 --- a/net/ipv4/ipip.c +++ b/net/ipv4/ipip.c @@ -94,7 +94,6 @@ #include <linux/capability.h> -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/sched.h> diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c index 717ab7d6d7b..ba33f8621c6 100644 --- a/net/ipv4/ipmr.c +++ b/net/ipv4/ipmr.c @@ -28,7 +28,6 @@ * */ -#include <linux/config.h> #include <asm/system.h> #include <asm/uaccess.h> #include <linux/types.h> diff --git a/net/ipv4/ipvs/ip_vs_est.c b/net/ipv4/ipvs/ip_vs_est.c index c453e1e57f4..4c1940381ba 100644 --- a/net/ipv4/ipvs/ip_vs_est.c +++ b/net/ipv4/ipvs/ip_vs_est.c @@ -13,7 +13,6 @@ * Changes: * */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/jiffies.h> #include <linux/slab.h> diff --git a/net/ipv4/multipath_drr.c b/net/ipv4/multipath_drr.c index db67373f9b3..252e837b17a 100644 --- a/< |