aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-01-29 21:08:37 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-01-29 21:08:37 -0500
commit1d494f36d1fde04188341bf3d3b1a14cdf6fb2c9 (patch)
treeb8849264f0e8e59b8466c6b6a2db9df71d1ee59a /net
parent19ba20f455a8e9cf15c12891e751fd73c9026292 (diff)
parentc044dc2132d19d8c643cdd340f21afcec177c046 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: "Several fixups, of note: 1) Fix unlock of not held spinlock in RXRPC code, from Alexey Khoroshilov. 2) Call pci_disable_device() from the correct shutdown path in bnx2x driver, from Yuval Mintz. 3) Fix qeth build on s390 for some configurations, from Eugene Crosser. 4) Cure locking bugs in bond_loadbalance_arp_mon(), from Ding Tianhong. 5) Must do netif_napi_add() before registering netdevice in sky2 driver, from Stanislaw Gruszka. 6) Fix lost bug fix during merge due to code movement in ieee802154, noticed and fixed by the eagle eyed Stephen Rothwell. 7) Get rid of resource leak in xen-netfront driver, from Annie Li. 8) Bounds checks in qlcnic driver are off by one, from Manish Chopra. 9) TPROXY can leak sockets when TCP early demux is enabled, fix from Holger Eitzenberger" * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (32 commits) qeth: fix build of s390 allmodconfig bonding: fix locking in bond_loadbalance_arp_mon() tun: add device name(iff) field to proc fdinfo entry DT: net: davinci_emac: "ti, davinci-no-bd-ram" property is actually optional DT: net: davinci_emac: "ti, davinci-rmii-en" property is actually optional bnx2x: Fix generic option settings net: Fix warning on make htmldocs caused by skbuff.c llc: remove noisy WARN from llc_mac_hdr_init qlcnic: Fix loopback test failure qlcnic: Fix tx timeout. qlcnic: Fix initialization of vlan list. qlcnic: Correct off-by-one errors in bounds checks net: Document promote_secondaries net: gre: use icmp_hdr() to get inner ip header i40e: Add missing braces to i40e_dcb_need_reconfig() xen-netfront: fix resource leak in netfront net: 6lowpan: fixup for code movement hyperv: Add support for physically discontinuous receive buffer sky2: initialize napi before registering device net: Fix memory leak if TPROXY used with TCP early demux ...
Diffstat (limited to 'net')
-rw-r--r--net/core/skbuff.c27
-rw-r--r--net/ieee802154/6lowpan_iphc.c2
-rw-r--r--net/ipv4/ip_gre.c2
-rw-r--r--net/ipv4/ip_input.c2
-rw-r--r--net/ipv4/ip_tunnel.c3
-rw-r--r--net/ipv6/ip6_input.c2
-rw-r--r--net/llc/llc_output.c2
-rw-r--r--net/rxrpc/ar-connection.c2
-rw-r--r--net/rxrpc/ar-recvmsg.c7
-rw-r--r--net/sched/sch_tbf.c13
10 files changed, 44 insertions, 18 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 8f519dbb358b..5976ef0846bd 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -47,6 +47,8 @@
47#include <linux/in.h> 47#include <linux/in.h>
48#include <linux/inet.h> 48#include <linux/inet.h>
49#include <linux/slab.h> 49#include <linux/slab.h>
50#include <linux/tcp.h>
51#include <linux/udp.h>
50#include <linux/netdevice.h> 52#include <linux/netdevice.h>
51#ifdef CONFIG_NET_CLS_ACT 53#ifdef CONFIG_NET_CLS_ACT
52#include <net/pkt_sched.h> 54#include <net/pkt_sched.h>
@@ -2119,7 +2121,7 @@ EXPORT_SYMBOL_GPL(skb_zerocopy_headlen);
2119/** 2121/**
2120 * skb_zerocopy - Zero copy skb to skb 2122 * skb_zerocopy - Zero copy skb to skb
2121 * @to: destination buffer 2123 * @to: destination buffer
2122 * @source: source buffer 2124 * @from: source buffer
2123 * @len: number of bytes to copy from source buffer 2125 * @len: number of bytes to copy from source buffer
2124 * @hlen: size of linear headroom in destination buffer 2126 * @hlen: size of linear headroom in destination buffer
2125 * 2127 *
@@ -3916,3 +3918,26 @@ void skb_scrub_packet(struct sk_buff *skb, bool xnet)
3916 nf_reset_trace(skb); 3918 nf_reset_trace(skb);
3917} 3919}
3918EXPORT_SYMBOL_GPL(skb_scrub_packet); 3920EXPORT_SYMBOL_GPL(skb_scrub_packet);
3921
3922/**
3923 * skb_gso_transport_seglen - Return length of individual segments of a gso packet
3924 *
3925 * @skb: GSO skb
3926 *
3927 * skb_gso_transport_seglen is used to determine the real size of the
3928 * individual segments, including Layer4 headers (TCP/UDP).
3929 *
3930 * The MAC/L2 or network (IP, IPv6) headers are not accounted for.
3931 */
3932unsigned int skb_gso_transport_seglen(const struct sk_buff *skb)
3933{
3934 const struct skb_shared_info *shinfo = skb_shinfo(skb);
3935 unsigned int hdr_len;
3936
3937 if (likely(shinfo->gso_type & (SKB_GSO_TCPV4 | SKB_GSO_TCPV6)))
3938 hdr_len = tcp_hdrlen(skb);
3939 else
3940 hdr_len = sizeof(struct udphdr);
3941 return hdr_len + shinfo->gso_size;
3942}
3943EXPORT_SYMBOL_GPL(skb_gso_transport_seglen);
diff --git a/net/ieee802154/6lowpan_iphc.c b/net/ieee802154/6lowpan_iphc.c
index 083f905bf109..860aa2d445ba 100644
--- a/net/ieee802154/6lowpan_iphc.c
+++ b/net/ieee802154/6lowpan_iphc.c
@@ -678,7 +678,7 @@ int lowpan_header_compress(struct sk_buff *skb, struct net_device *dev,
678 hc06_ptr += 3; 678 hc06_ptr += 3;
679 } else { 679 } else {
680 /* compress nothing */ 680 /* compress nothing */
681 memcpy(hc06_ptr, &hdr, 4); 681 memcpy(hc06_ptr, hdr, 4);
682 /* replace the top byte with new ECN | DSCP format */ 682 /* replace the top byte with new ECN | DSCP format */
683 *hc06_ptr = tmp; 683 *hc06_ptr = tmp;
684 hc06_ptr += 4; 684 hc06_ptr += 4;
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index e7a92fdb36f6..ec4f762efda5 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -178,7 +178,7 @@ static int ipgre_err(struct sk_buff *skb, u32 info,
178 else 178 else
179 itn = net_generic(net, ipgre_net_id); 179 itn = net_generic(net, ipgre_net_id);
180 180
181 iph = (const struct iphdr *)skb->data; 181 iph = (const struct iphdr *)(icmp_hdr(skb) + 1);
182 t = ip_tunnel_lookup(itn, skb->dev->ifindex, tpi->flags, 182 t = ip_tunnel_lookup(itn, skb->dev->ifindex, tpi->flags,
183 iph->daddr, iph->saddr, tpi->key); 183 iph->daddr, iph->saddr, tpi->key);
184 184
diff --git a/net/ipv4/ip_input.c b/net/ipv4/ip_input.c
index 054a3e97d822..3d4da2c16b6a 100644
--- a/net/ipv4/ip_input.c
+++ b/net/ipv4/ip_input.c
@@ -314,7 +314,7 @@ static int ip_rcv_finish(struct sk_buff *skb)
314 const struct iphdr *iph = ip_hdr(skb); 314 const struct iphdr *iph = ip_hdr(skb);
315 struct rtable *rt; 315 struct rtable *rt;
316 316
317 if (sysctl_ip_early_demux && !skb_dst(skb)) { 317 if (sysctl_ip_early_demux && !skb_dst(skb) && skb->sk == NULL) {
318 const struct net_protocol *ipprot; 318 const struct net_protocol *ipprot;
319 int protocol = iph->protocol; 319 int protocol = iph->protocol;
320 320
diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c
index c0e3cb72ad70..bd28f386bd02 100644
--- a/net/ipv4/ip_tunnel.c
+++ b/net/ipv4/ip_tunnel.c
@@ -40,6 +40,7 @@
40#include <linux/if_ether.h> 40#include <linux/if_ether.h>
41#include <linux/if_vlan.h> 41#include <linux/if_vlan.h>
42#include <linux/rculist.h> 42#include <linux/rculist.h>
43#include <linux/err.h>
43 44
44#include <net/sock.h> 45#include <net/sock.h>
45#include <net/ip.h> 46#include <net/ip.h>
@@ -930,7 +931,7 @@ int ip_tunnel_init_net(struct net *net, int ip_tnl_net_id,
930 } 931 }
931 rtnl_unlock(); 932 rtnl_unlock();
932 933
933 return PTR_RET(itn->fb_tunnel_dev); 934 return PTR_ERR_OR_ZERO(itn->fb_tunnel_dev);
934} 935}
935EXPORT_SYMBOL_GPL(ip_tunnel_init_net); 936EXPORT_SYMBOL_GPL(ip_tunnel_init_net);
936 937
diff --git a/net/ipv6/ip6_input.c b/net/ipv6/ip6_input.c
index 302d6fb1ff2b..51d54dc376f3 100644
--- a/net/ipv6/ip6_input.c
+++ b/net/ipv6/ip6_input.c
@@ -49,7 +49,7 @@
49 49
50int ip6_rcv_finish(struct sk_buff *skb) 50int ip6_rcv_finish(struct sk_buff *skb)
51{ 51{
52 if (sysctl_ip_early_demux && !skb_dst(skb)) { 52 if (sysctl_ip_early_demux && !skb_dst(skb) && skb->sk == NULL) {
53 const struct inet6_protocol *ipprot; 53 const struct inet6_protocol *ipprot;
54 54
55 ipprot = rcu_dereference(inet6_protos[ipv6_hdr(skb)->nexthdr]); 55 ipprot = rcu_dereference(inet6_protos[ipv6_hdr(skb)->nexthdr]);
diff --git a/net/llc/llc_output.c b/net/llc/llc_output.c
index 2dae8a5df23f..94425e421213 100644
--- a/net/llc/llc_output.c
+++ b/net/llc/llc_output.c
@@ -43,7 +43,7 @@ int llc_mac_hdr_init(struct sk_buff *skb,
43 rc = 0; 43 rc = 0;
44 break; 44 break;
45 default: 45 default:
46 WARN(1, "device type not supported: %d\n", skb->dev->type); 46 break;
47 } 47 }
48 return rc; 48 return rc;
49} 49}
diff --git a/net/rxrpc/ar-connection.c b/net/rxrpc/ar-connection.c
index 4106ca95ec86..7bf5b5b9e8b9 100644
--- a/net/rxrpc/ar-connection.c
+++ b/net/rxrpc/ar-connection.c
@@ -381,6 +381,8 @@ static int rxrpc_connect_exclusive(struct rxrpc_sock *rx,
381 381
382 rxrpc_assign_connection_id(conn); 382 rxrpc_assign_connection_id(conn);
383 rx->conn = conn; 383 rx->conn = conn;
384 } else {
385 spin_lock(&trans->client_lock);
384 } 386 }
385 387
386 /* we've got a connection with a free channel and we can now attach the 388 /* we've got a connection with a free channel and we can now attach the
diff --git a/net/rxrpc/ar-recvmsg.c b/net/rxrpc/ar-recvmsg.c
index 898492a8d61b..34b5490dde65 100644
--- a/net/rxrpc/ar-recvmsg.c
+++ b/net/rxrpc/ar-recvmsg.c
@@ -180,7 +180,8 @@ int rxrpc_recvmsg(struct kiocb *iocb, struct socket *sock,
180 if (copy > len - copied) 180 if (copy > len - copied)
181 copy = len - copied; 181 copy = len - copied;
182 182
183 if (skb->ip_summed == CHECKSUM_UNNECESSARY) { 183 if (skb->ip_summed == CHECKSUM_UNNECESSARY ||
184 skb->ip_summed == CHECKSUM_PARTIAL) {
184 ret = skb_copy_datagram_iovec(skb, offset, 185 ret = skb_copy_datagram_iovec(skb, offset,
185 msg->msg_iov, copy); 186 msg->msg_iov, copy);
186 } else { 187 } else {
@@ -353,6 +354,10 @@ csum_copy_error:
353 if (continue_call) 354 if (continue_call)
354 rxrpc_put_call(continue_call); 355 rxrpc_put_call(continue_call);
355 rxrpc_kill_skb(skb); 356 rxrpc_kill_skb(skb);
357 if (!(flags & MSG_PEEK)) {
358 if (skb_dequeue(&rx->sk.sk_receive_queue) != skb)
359 BUG();
360 }
356 skb_kill_datagram(&rx->sk, skb, flags); 361 skb_kill_datagram(&rx->sk, skb, flags);
357 rxrpc_put_call(call); 362 rxrpc_put_call(call);
358 return -EAGAIN; 363 return -EAGAIN;
diff --git a/net/sched/sch_tbf.c b/net/sched/sch_tbf.c
index fbba5b0ec121..1cb413fead89 100644
--- a/net/sched/sch_tbf.c
+++ b/net/sched/sch_tbf.c
@@ -21,7 +21,6 @@
21#include <net/netlink.h> 21#include <net/netlink.h>
22#include <net/sch_generic.h> 22#include <net/sch_generic.h>
23#include <net/pkt_sched.h> 23#include <net/pkt_sched.h>
24#include <net/tcp.h>
25 24
26 25
27/* Simple Token Bucket Filter. 26/* Simple Token Bucket Filter.
@@ -148,16 +147,10 @@ static u64 psched_ns_t2l(const struct psched_ratecfg *r,
148 * Return length of individual segments of a gso packet, 147 * Return length of individual segments of a gso packet,
149 * including all headers (MAC, IP, TCP/UDP) 148 * including all headers (MAC, IP, TCP/UDP)
150 */ 149 */
151static unsigned int skb_gso_seglen(const struct sk_buff *skb) 150static unsigned int skb_gso_mac_seglen(const struct sk_buff *skb)
152{ 151{
153 unsigned int hdr_len = skb_transport_header(skb) - skb_mac_header(skb); 152 unsigned int hdr_len = skb_transport_header(skb) - skb_mac_header(skb);
154 const struct skb_shared_info *shinfo = skb_shinfo(skb); 153 return hdr_len + skb_gso_transport_seglen(skb);
155
156 if (likely(shinfo->gso_type & (SKB_GSO_TCPV4 | SKB_GSO_TCPV6)))
157 hdr_len += tcp_hdrlen(skb);
158 else
159 hdr_len += sizeof(struct udphdr);
160 return hdr_len + shinfo->gso_size;
161} 154}
162 155
163/* GSO packet is too big, segment it so that tbf can transmit 156/* GSO packet is too big, segment it so that tbf can transmit
@@ -202,7 +195,7 @@ static int tbf_enqueue(struct sk_buff *skb, struct Qdisc *sch)
202 int ret; 195 int ret;
203 196
204 if (qdisc_pkt_len(skb) > q->max_size) { 197 if (qdisc_pkt_len(skb) > q->max_size) {
205 if (skb_is_gso(skb) && skb_gso_seglen(skb) <= q->max_size) 198 if (skb_is_gso(skb) && skb_gso_mac_seglen(skb) <= q->max_size)
206 return tbf_segment(skb, sch); 199 return tbf_segment(skb, sch);
207 return qdisc_reshape_fail(skb, sch); 200 return qdisc_reshape_fail(skb, sch);
208 } 201 }