aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-06-15 22:37:03 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-06-15 22:37:03 -0400
commita9be22425e767d936105679fdc9f568b97bd47cf (patch)
tree37a63136da83dcf272668462f96eed1e96f37de3 /net
parentdd1845af24a47b70cf84c29126698884f740ff9c (diff)
parentb58537a1f5629bdc98a8b9dc2051ce0e952f6b4b (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: 1) Fix checksumming regressions, from Tom Herbert. 2) Undo unintentional permissions changes for SCTP rto_alpha and rto_beta sysfs knobs, from Denial Borkmann. 3) VXLAN, like other IP tunnels, should advertize it's encapsulation size using dev->needed_headroom instead of dev->hard_header_len. From Cong Wang. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: net: sctp: fix permissions for rto_alpha and rto_beta knobs vxlan: Checksum fixes net: add skb_pop_rcv_encapsulation udp: call __skb_checksum_complete when doing full checksum net: Fix save software checksum complete net: Fix GSO constants to match NETIF flags udp: ipv4: do not waste time in __udp4_lib_mcast_demux_lookup vxlan: use dev->needed_headroom instead of dev->hard_header_len MAINTAINERS: update cxgb4 maintainer
Diffstat (limited to 'net')
-rw-r--r--net/core/datagram.c36
-rw-r--r--net/core/skbuff.c3
-rw-r--r--net/ipv4/udp.c4
-rw-r--r--net/sctp/sysctl.c32
4 files changed, 61 insertions, 14 deletions
diff --git a/net/core/datagram.c b/net/core/datagram.c
index 6b1c04ca1d50..488dd1a825c0 100644
--- a/net/core/datagram.c
+++ b/net/core/datagram.c
@@ -739,22 +739,38 @@ __sum16 __skb_checksum_complete_head(struct sk_buff *skb, int len)
739 __sum16 sum; 739 __sum16 sum;
740 740
741 sum = csum_fold(skb_checksum(skb, 0, len, skb->csum)); 741 sum = csum_fold(skb_checksum(skb, 0, len, skb->csum));
742 if (unlikely(skb->ip_summed == CHECKSUM_COMPLETE) && !sum && 742 if (likely(!sum)) {
743 !skb->csum_complete_sw) 743 if (unlikely(skb->ip_summed == CHECKSUM_COMPLETE) &&
744 netdev_rx_csum_fault(skb->dev); 744 !skb->csum_complete_sw)
745 745 netdev_rx_csum_fault(skb->dev);
746 /* Save checksum complete for later use */ 746 }
747 skb->csum = sum; 747 skb->csum_valid = !sum;
748 skb->ip_summed = CHECKSUM_COMPLETE;
749 skb->csum_complete_sw = 1;
750
751 return sum; 748 return sum;
752} 749}
753EXPORT_SYMBOL(__skb_checksum_complete_head); 750EXPORT_SYMBOL(__skb_checksum_complete_head);
754 751
755__sum16 __skb_checksum_complete(struct sk_buff *skb) 752__sum16 __skb_checksum_complete(struct sk_buff *skb)
756{ 753{
757 return __skb_checksum_complete_head(skb, skb->len); 754 __wsum csum;
755 __sum16 sum;
756
757 csum = skb_checksum(skb, 0, skb->len, 0);
758
759 /* skb->csum holds pseudo checksum */
760 sum = csum_fold(csum_add(skb->csum, csum));
761 if (likely(!sum)) {
762 if (unlikely(skb->ip_summed == CHECKSUM_COMPLETE) &&
763 !skb->csum_complete_sw)
764 netdev_rx_csum_fault(skb->dev);
765 }
766
767 /* Save full packet checksum */
768 skb->csum = csum;
769 skb->ip_summed = CHECKSUM_COMPLETE;
770 skb->csum_complete_sw = 1;
771 skb->csum_valid = !sum;
772
773 return sum;
758} 774}
759EXPORT_SYMBOL(__skb_checksum_complete); 775EXPORT_SYMBOL(__skb_checksum_complete);
760 776
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index bf92824af3f7..9cd5344fad73 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -689,6 +689,9 @@ static void __copy_skb_header(struct sk_buff *new, const struct sk_buff *old)
689 new->ooo_okay = old->ooo_okay; 689 new->ooo_okay = old->ooo_okay;
690 new->no_fcs = old->no_fcs; 690 new->no_fcs = old->no_fcs;
691 new->encapsulation = old->encapsulation; 691 new->encapsulation = old->encapsulation;
692 new->encap_hdr_csum = old->encap_hdr_csum;
693 new->csum_valid = old->csum_valid;
694 new->csum_complete_sw = old->csum_complete_sw;
692#ifdef CONFIG_XFRM 695#ifdef CONFIG_XFRM
693 new->sp = secpath_get(old->sp); 696 new->sp = secpath_get(old->sp);
694#endif 697#endif
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 185ed3e59802..d92f94b7e402 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -1861,6 +1861,10 @@ static struct sock *__udp4_lib_mcast_demux_lookup(struct net *net,
1861 unsigned int count, slot = udp_hashfn(net, hnum, udp_table.mask); 1861 unsigned int count, slot = udp_hashfn(net, hnum, udp_table.mask);
1862 struct udp_hslot *hslot = &udp_table.hash[slot]; 1862 struct udp_hslot *hslot = &udp_table.hash[slot];
1863 1863
1864 /* Do not bother scanning a too big list */
1865 if (hslot->count > 10)
1866 return NULL;
1867
1864 rcu_read_lock(); 1868 rcu_read_lock();
1865begin: 1869begin:
1866 count = 0; 1870 count = 0;
diff --git a/net/sctp/sysctl.c b/net/sctp/sysctl.c
index 7e5eb7554990..dcb19592761e 100644
--- a/net/sctp/sysctl.c
+++ b/net/sctp/sysctl.c
@@ -34,6 +34,8 @@
34 * Sridhar Samudrala <sri@us.ibm.com> 34 * Sridhar Samudrala <sri@us.ibm.com>
35 */ 35 */
36 36
37#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
38
37#include <net/sctp/structs.h> 39#include <net/sctp/structs.h>
38#include <net/sctp/sctp.h> 40#include <net/sctp/sctp.h>
39#include <linux/sysctl.h> 41#include <linux/sysctl.h>
@@ -46,6 +48,11 @@ static int sack_timer_min = 1;
46static int sack_timer_max = 500; 48static int sack_timer_max = 500;
47static int addr_scope_max = 3; /* check sctp_scope_policy_t in include/net/sctp/constants.h for max entries */ 49static int addr_scope_max = 3; /* check sctp_scope_policy_t in include/net/sctp/constants.h for max entries */
48static int rwnd_scale_max = 16; 50static int rwnd_scale_max = 16;
51static int rto_alpha_min = 0;
52static int rto_beta_min = 0;
53static int rto_alpha_max = 1000;
54static int rto_beta_max = 1000;
55
49static unsigned long max_autoclose_min = 0; 56static unsigned long max_autoclose_min = 0;
50static unsigned long max_autoclose_max = 57static unsigned long max_autoclose_max =
51 (MAX_SCHEDULE_TIMEOUT / HZ > UINT_MAX) 58 (MAX_SCHEDULE_TIMEOUT / HZ > UINT_MAX)
@@ -64,6 +71,9 @@ static int proc_sctp_do_rto_min(struct ctl_table *ctl, int write,
64static int proc_sctp_do_rto_max(struct ctl_table *ctl, int write, 71static int proc_sctp_do_rto_max(struct ctl_table *ctl, int write,
65 void __user *buffer, size_t *lenp, 72 void __user *buffer, size_t *lenp,
66 loff_t *ppos); 73 loff_t *ppos);
74static int proc_sctp_do_alpha_beta(struct ctl_table *ctl, int write,
75 void __user *buffer, size_t *lenp,
76 loff_t *ppos);
67static int proc_sctp_do_auth(struct ctl_table *ctl, int write, 77static int proc_sctp_do_auth(struct ctl_table *ctl, int write,
68 void __user *buffer, size_t *lenp, 78 void __user *buffer, size_t *lenp,
69 loff_t *ppos); 79 loff_t *ppos);
@@ -126,15 +136,19 @@ static struct ctl_table sctp_net_table[] = {
126 .procname = "rto_alpha_exp_divisor", 136 .procname = "rto_alpha_exp_divisor",
127 .data = &init_net.sctp.rto_alpha, 137 .data = &init_net.sctp.rto_alpha,
128 .maxlen = sizeof(int), 138 .maxlen = sizeof(int),
129 .mode = 0444, 139 .mode = 0644,
130 .proc_handler = proc_dointvec, 140 .proc_handler = proc_sctp_do_alpha_beta,
141 .extra1 = &rto_alpha_min,
142 .extra2 = &rto_alpha_max,
131 }, 143 },
132 { 144 {
133 .procname = "rto_beta_exp_divisor", 145 .procname = "rto_beta_exp_divisor",
134 .data = &init_net.sctp.rto_beta, 146 .data = &init_net.sctp.rto_beta,
135 .maxlen = sizeof(int), 147 .maxlen = sizeof(int),
136 .mode = 0444, 148 .mode = 0644,
137 .proc_handler = proc_dointvec, 149 .proc_handler = proc_sctp_do_alpha_beta,
150 .extra1 = &rto_beta_min,
151 .extra2 = &rto_beta_max,
138 }, 152 },
139 { 153 {
140 .procname = "max_burst", 154 .procname = "max_burst",
@@ -403,6 +417,16 @@ static int proc_sctp_do_rto_max(struct ctl_table *ctl, int write,
403 return ret; 417 return ret;
404} 418}
405 419
420static int proc_sctp_do_alpha_beta(struct ctl_table *ctl, int write,
421 void __user *buffer, size_t *lenp,
422 loff_t *ppos)
423{
424 pr_warn_once("Changing rto_alpha or rto_beta may lead to "
425 "suboptimal rtt/srtt estimations!\n");
426
427 return proc_dointvec_minmax(ctl, write, buffer, lenp, ppos);
428}
429
406static int proc_sctp_do_auth(struct ctl_table *ctl, int write, 430static int proc_sctp_do_auth(struct ctl_table *ctl, int write,
407 void __user *buffer, size_t *lenp, 431 void __user *buffer, size_t *lenp,
408 loff_t *ppos) 432 loff_t *ppos)