aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2014-08-05 21:46:26 -0400
committerDavid S. Miller <davem@davemloft.net>2014-08-05 21:46:26 -0400
commitd247b6ab3ce6dd43665780865ec5fa145d9ab6bd (patch)
tree02eb71e4d64b678d7568d2b99f309e08f56ef2fe /net
parent30f00847953e3aa3f710d62ffd37b42042807900 (diff)
parent4d8fdc95c60e90d84c8257a0067ff4b1729a3757 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts: drivers/net/Makefile net/ipv6/sysctl_net_ipv6.c Two ipv6_table_template[] additions overlap, so the index of the ipv6_table[x] assignments needed to be adjusted. In the drivers/net/Makefile case, we've gotten rid of the garbage whereby we had to list every single USB networking driver in the top-level Makefile, there is just one "USB_NETWORKING" that guards everything. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/batman-adv/fragmentation.c10
-rw-r--r--net/bridge/br_fdb.c2
-rw-r--r--net/core/skbuff.c2
-rw-r--r--net/ipv4/ip_tunnel.c29
-rw-r--r--net/ipv4/tcp_vegas.c3
-rw-r--r--net/ipv4/tcp_veno.c2
-rw-r--r--net/ipv6/sysctl_net_ipv6.c1
-rw-r--r--net/netfilter/ipvs/ip_vs_xmit.c2
-rw-r--r--net/netfilter/nf_tables_api.c1
-rw-r--r--net/netfilter/xt_LED.c10
-rw-r--r--net/sctp/output.c2
11 files changed, 41 insertions, 23 deletions
diff --git a/net/batman-adv/fragmentation.c b/net/batman-adv/fragmentation.c
index f14e54a05691..022d18ab27a6 100644
--- a/net/batman-adv/fragmentation.c
+++ b/net/batman-adv/fragmentation.c
@@ -128,6 +128,7 @@ static bool batadv_frag_insert_packet(struct batadv_orig_node *orig_node,
128{ 128{
129 struct batadv_frag_table_entry *chain; 129 struct batadv_frag_table_entry *chain;
130 struct batadv_frag_list_entry *frag_entry_new = NULL, *frag_entry_curr; 130 struct batadv_frag_list_entry *frag_entry_new = NULL, *frag_entry_curr;
131 struct batadv_frag_list_entry *frag_entry_last = NULL;
131 struct batadv_frag_packet *frag_packet; 132 struct batadv_frag_packet *frag_packet;
132 uint8_t bucket; 133 uint8_t bucket;
133 uint16_t seqno, hdr_size = sizeof(struct batadv_frag_packet); 134 uint16_t seqno, hdr_size = sizeof(struct batadv_frag_packet);
@@ -180,11 +181,14 @@ static bool batadv_frag_insert_packet(struct batadv_orig_node *orig_node,
180 ret = true; 181 ret = true;
181 goto out; 182 goto out;
182 } 183 }
184
185 /* store current entry because it could be the last in list */
186 frag_entry_last = frag_entry_curr;
183 } 187 }
184 188
185 /* Reached the end of the list, so insert after 'frag_entry_curr'. */ 189 /* Reached the end of the list, so insert after 'frag_entry_last'. */
186 if (likely(frag_entry_curr)) { 190 if (likely(frag_entry_last)) {
187 hlist_add_after(&frag_entry_curr->list, &frag_entry_new->list); 191 hlist_add_after(&frag_entry_last->list, &frag_entry_new->list);
188 chain->size += skb->len - hdr_size; 192 chain->size += skb->len - hdr_size;
189 chain->timestamp = jiffies; 193 chain->timestamp = jiffies;
190 ret = true; 194 ret = true;
diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c
index 0bb9d8b63dd2..6f6c95cfe8f2 100644
--- a/net/bridge/br_fdb.c
+++ b/net/bridge/br_fdb.c
@@ -629,7 +629,7 @@ static int fdb_fill_info(struct sk_buff *skb, const struct net_bridge *br,
629 if (nla_put(skb, NDA_CACHEINFO, sizeof(ci), &ci)) 629 if (nla_put(skb, NDA_CACHEINFO, sizeof(ci), &ci))
630 goto nla_put_failure; 630 goto nla_put_failure;
631 631
632 if (nla_put(skb, NDA_VLAN, sizeof(u16), &fdb->vlan_id)) 632 if (fdb->vlan_id && nla_put(skb, NDA_VLAN, sizeof(u16), &fdb->vlan_id))
633 goto nla_put_failure; 633 goto nla_put_failure;
634 634
635 return nlmsg_end(skb, nlh); 635 return nlmsg_end(skb, nlh);
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 3dec0293a7c5..224506a6fa80 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -2976,9 +2976,9 @@ struct sk_buff *skb_segment(struct sk_buff *head_skb,
2976 tail = nskb; 2976 tail = nskb;
2977 2977
2978 __copy_skb_header(nskb, head_skb); 2978 __copy_skb_header(nskb, head_skb);
2979 nskb->mac_len = head_skb->mac_len;
2980 2979
2981 skb_headers_offset_update(nskb, skb_headroom(nskb) - headroom); 2980 skb_headers_offset_update(nskb, skb_headroom(nskb) - headroom);
2981 skb_reset_mac_len(nskb);
2982 2982
2983 skb_copy_from_linear_data_offset(head_skb, -tnl_hlen, 2983 skb_copy_from_linear_data_offset(head_skb, -tnl_hlen,
2984 nskb->data - tnl_hlen, 2984 nskb->data - tnl_hlen,
diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c
index dd8c8c765799..afed1aac2638 100644
--- a/net/ipv4/ip_tunnel.c
+++ b/net/ipv4/ip_tunnel.c
@@ -69,23 +69,25 @@ static unsigned int ip_tunnel_hash(__be32 key, __be32 remote)
69} 69}
70 70
71static void __tunnel_dst_set(struct ip_tunnel_dst *idst, 71static void __tunnel_dst_set(struct ip_tunnel_dst *idst,
72 struct dst_entry *dst) 72 struct dst_entry *dst, __be32 saddr)
73{ 73{
74 struct dst_entry *old_dst; 74 struct dst_entry *old_dst;
75 75
76 dst_clone(dst); 76 dst_clone(dst);
77 old_dst = xchg((__force struct dst_entry **)&idst->dst, dst); 77 old_dst = xchg((__force struct dst_entry **)&idst->dst, dst);
78 dst_release(old_dst); 78 dst_release(old_dst);
79 idst->saddr = saddr;
79} 80}
80 81
81static void tunnel_dst_set(struct ip_tunnel *t, struct dst_entry *dst) 82static void tunnel_dst_set(struct ip_tunnel *t,
83 struct dst_entry *dst, __be32 saddr)
82{ 84{
83 __tunnel_dst_set(this_cpu_ptr(t->dst_cache), dst); 85 __tunnel_dst_set(this_cpu_ptr(t->dst_cache), dst, saddr);
84} 86}
85 87
86static void tunnel_dst_reset(struct ip_tunnel *t) 88static void tunnel_dst_reset(struct ip_tunnel *t)
87{ 89{
88 tunnel_dst_set(t, NULL); 90 tunnel_dst_set(t, NULL, 0);
89} 91}
90 92
91void ip_tunnel_dst_reset_all(struct ip_tunnel *t) 93void ip_tunnel_dst_reset_all(struct ip_tunnel *t)
@@ -93,20 +95,25 @@ void ip_tunnel_dst_reset_all(struct ip_tunnel *t)
93 int i; 95 int i;
94 96
95 for_each_possible_cpu(i) 97 for_each_possible_cpu(i)
96 __tunnel_dst_set(per_cpu_ptr(t->dst_cache, i), NULL); 98 __tunnel_dst_set(per_cpu_ptr(t->dst_cache, i), NULL, 0);
97} 99}
98EXPORT_SYMBOL(ip_tunnel_dst_reset_all); 100EXPORT_SYMBOL(ip_tunnel_dst_reset_all);
99 101
100static struct rtable *tunnel_rtable_get(struct ip_tunnel *t, u32 cookie) 102static struct rtable *tunnel_rtable_get(struct ip_tunnel *t,
103 u32 cookie, __be32 *saddr)
101{ 104{
105 struct ip_tunnel_dst *idst;
102 struct dst_entry *dst; 106 struct dst_entry *dst;
103 107
104 rcu_read_lock(); 108 rcu_read_lock();
105 dst = rcu_dereference(this_cpu_ptr(t->dst_cache)->dst); 109 idst = this_cpu_ptr(t->dst_cache);
110 dst = rcu_dereference(idst->dst);
106 if (dst && !atomic_inc_not_zero(&dst->__refcnt)) 111 if (dst && !atomic_inc_not_zero(&dst->__refcnt))
107 dst = NULL; 112 dst = NULL;
108 if (dst) { 113 if (dst) {
109 if (dst->obsolete && dst->ops->check(dst, cookie) == NULL) { 114 if (!dst->obsolete || dst->ops->check(dst, cookie)) {
115 *saddr = idst->saddr;
116 } else {
110 tunnel_dst_reset(t); 117 tunnel_dst_reset(t);
111 dst_release(dst); 118 dst_release(dst);
112 dst = NULL; 119 dst = NULL;
@@ -367,7 +374,7 @@ static int ip_tunnel_bind_dev(struct net_device *dev)
367 374
368 if (!IS_ERR(rt)) { 375 if (!IS_ERR(rt)) {
369 tdev = rt->dst.dev; 376 tdev = rt->dst.dev;
370 tunnel_dst_set(tunnel, &rt->dst); 377 tunnel_dst_set(tunnel, &rt->dst, fl4.saddr);
371 ip_rt_put(rt); 378 ip_rt_put(rt);
372 } 379 }
373 if (dev->type != ARPHRD_ETHER) 380 if (dev->type != ARPHRD_ETHER)
@@ -610,7 +617,7 @@ void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev,
610 init_tunnel_flow(&fl4, protocol, dst, tnl_params->saddr, 617 init_tunnel_flow(&fl4, protocol, dst, tnl_params->saddr,
611 tunnel->parms.o_key, RT_TOS(tos), tunnel->parms.link); 618 tunnel->parms.o_key, RT_TOS(tos), tunnel->parms.link);
612 619
613 rt = connected ? tunnel_rtable_get(tunnel, 0) : NULL; 620 rt = connected ? tunnel_rtable_get(tunnel, 0, &fl4.saddr) : NULL;
614 621
615 if (!rt) { 622 if (!rt) {
616 rt = ip_route_output_key(tunnel->net, &fl4); 623 rt = ip_route_output_key(tunnel->net, &fl4);
@@ -620,7 +627,7 @@ void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev,
620 goto tx_error; 627 goto tx_error;
621 } 628 }
622 if (connected) 629 if (connected)
623 tunnel_dst_set(tunnel, &rt->dst); 630 tunnel_dst_set(tunnel, &rt->dst, fl4.saddr);
624 } 631 }
625 632
626 if (rt->dst.dev == dev) { 633 if (rt->dst.dev == dev) {
diff --git a/net/ipv4/tcp_vegas.c b/net/ipv4/tcp_vegas.c
index 9a5e05f27f4f..b40ad897f945 100644
--- a/net/ipv4/tcp_vegas.c
+++ b/net/ipv4/tcp_vegas.c
@@ -218,7 +218,8 @@ static void tcp_vegas_cong_avoid(struct sock *sk, u32 ack, u32 acked)
218 * This is: 218 * This is:
219 * (actual rate in segments) * baseRTT 219 * (actual rate in segments) * baseRTT
220 */ 220 */
221 target_cwnd = tp->snd_cwnd * vegas->baseRTT / rtt; 221 target_cwnd = (u64)tp->snd_cwnd * vegas->baseRTT;
222 do_div(target_cwnd, rtt);
222 223
223 /* Calculate the difference between the window we had, 224 /* Calculate the difference between the window we had,
224 * and the window we would like to have. This quantity 225 * and the window we would like to have. This quantity
diff --git a/net/ipv4/tcp_veno.c b/net/ipv4/tcp_veno.c
index 27b9825753d1..8276977d2c85 100644
--- a/net/ipv4/tcp_veno.c
+++ b/net/ipv4/tcp_veno.c
@@ -144,7 +144,7 @@ static void tcp_veno_cong_avoid(struct sock *sk, u32 ack, u32 acked)
144 144
145 rtt = veno->minrtt; 145 rtt = veno->minrtt;
146 146
147 target_cwnd = (tp->snd_cwnd * veno->basertt); 147 target_cwnd = (u64)tp->snd_cwnd * veno->basertt;
148 target_cwnd <<= V_PARAM_SHIFT; 148 target_cwnd <<= V_PARAM_SHIFT;
149 do_div(target_cwnd, rtt); 149 do_div(target_cwnd, rtt);
150 150
diff --git a/net/ipv6/sysctl_net_ipv6.c b/net/ipv6/sysctl_net_ipv6.c
index 5bf7b61f8ae8..0c56c93619e0 100644
--- a/net/ipv6/sysctl_net_ipv6.c
+++ b/net/ipv6/sysctl_net_ipv6.c
@@ -82,6 +82,7 @@ static int __net_init ipv6_sysctl_net_init(struct net *net)
82 ipv6_table[1].data = &net->ipv6.sysctl.anycast_src_echo_reply; 82 ipv6_table[1].data = &net->ipv6.sysctl.anycast_src_echo_reply;
83 ipv6_table[2].data = &net->ipv6.sysctl.flowlabel_consistency; 83 ipv6_table[2].data = &net->ipv6.sysctl.flowlabel_consistency;
84 ipv6_table[3].data = &net->ipv6.sysctl.auto_flowlabels; 84 ipv6_table[3].data = &net->ipv6.sysctl.auto_flowlabels;
85 ipv6_table[4].data = &net->ipv6.sysctl.fwmark_reflect;
85 86
86 ipv6_route_table = ipv6_route_sysctl_init(net); 87 ipv6_route_table = ipv6_route_sysctl_init(net);
87 if (!ipv6_route_table) 88 if (!ipv6_route_table)
diff --git a/net/netfilter/ipvs/ip_vs_xmit.c b/net/netfilter/ipvs/ip_vs_xmit.c
index 73ba1cc7a88d..6f70bdd3a90a 100644
--- a/net/netfilter/ipvs/ip_vs_xmit.c
+++ b/net/netfilter/ipvs/ip_vs_xmit.c
@@ -967,8 +967,8 @@ ip_vs_tunnel_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
967 iph->nexthdr = IPPROTO_IPV6; 967 iph->nexthdr = IPPROTO_IPV6;
968 iph->payload_len = old_iph->payload_len; 968 iph->payload_len = old_iph->payload_len;
969 be16_add_cpu(&iph->payload_len, sizeof(*old_iph)); 969 be16_add_cpu(&iph->payload_len, sizeof(*old_iph));
970 iph->priority = old_iph->priority;
971 memset(&iph->flow_lbl, 0, sizeof(iph->flow_lbl)); 970 memset(&iph->flow_lbl, 0, sizeof(iph->flow_lbl));
971 ipv6_change_dsfield(iph, 0, ipv6_get_dsfield(old_iph));
972 iph->daddr = cp->daddr.in6; 972 iph->daddr = cp->daddr.in6;
973 iph->saddr = saddr; 973 iph->saddr = saddr;
974 iph->hop_limit = old_iph->hop_limit; 974 iph->hop_limit = old_iph->hop_limit;
diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index 93692d692ebc..b8035c2d6667 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -3144,6 +3144,7 @@ static int nft_del_setelem(struct nft_ctx *ctx, struct nft_set *set,
3144 if (set->flags & NFT_SET_MAP) 3144 if (set->flags & NFT_SET_MAP)
3145 nft_data_uninit(&elem.data, set->dtype); 3145 nft_data_uninit(&elem.data, set->dtype);
3146 3146
3147 return 0;
3147err2: 3148err2:
3148 nft_data_uninit(&elem.key, desc.type); 3149 nft_data_uninit(&elem.key, desc.type);
3149err1: 3150err1:
diff --git a/net/netfilter/xt_LED.c b/net/netfilter/xt_LED.c
index f14bcf23dc9f..3ba31c194cce 100644
--- a/net/netfilter/xt_LED.c
+++ b/net/netfilter/xt_LED.c
@@ -50,11 +50,14 @@ struct xt_led_info_internal {
50 struct timer_list timer; 50 struct timer_list timer;
51}; 51};
52 52
53#define XT_LED_BLINK_DELAY 50 /* ms */
54
53static unsigned int 55static unsigned int
54led_tg(struct sk_buff *skb, const struct xt_action_param *par) 56led_tg(struct sk_buff *skb, const struct xt_action_param *par)
55{ 57{
56 const struct xt_led_info *ledinfo = par->targinfo; 58 const struct xt_led_info *ledinfo = par->targinfo;
57 struct xt_led_info_internal *ledinternal = ledinfo->internal_data; 59 struct xt_led_info_internal *ledinternal = ledinfo->internal_data;
60 unsigned long led_delay = XT_LED_BLINK_DELAY;
58 61
59 /* 62 /*
60 * If "always blink" is enabled, and there's still some time until the 63 * If "always blink" is enabled, and there's still some time until the
@@ -62,9 +65,10 @@ led_tg(struct sk_buff *skb, const struct xt_action_param *par)
62 */ 65 */
63 if ((ledinfo->delay > 0) && ledinfo->always_blink && 66 if ((ledinfo->delay > 0) && ledinfo->always_blink &&
64 timer_pending(&ledinternal->timer)) 67 timer_pending(&ledinternal->timer))
65 led_trigger_event(&ledinternal->netfilter_led_trigger, LED_OFF); 68 led_trigger_blink_oneshot(&ledinternal->netfilter_led_trigger,
66 69 &led_delay, &led_delay, 1);
67 led_trigger_event(&ledinternal->netfilter_led_trigger, LED_FULL); 70 else
71 led_trigger_event(&ledinternal->netfilter_led_trigger, LED_FULL);
68 72
69 /* If there's a positive delay, start/update the timer */ 73 /* If there's a positive delay, start/update the timer */
70 if (ledinfo->delay > 0) { 74 if (ledinfo->delay > 0) {
diff --git a/net/sctp/output.c b/net/sctp/output.c
index 1eedba5195a3..42dffd428389 100644
--- a/net/sctp/output.c
+++ b/net/sctp/output.c
@@ -599,7 +599,7 @@ out:
599 return err; 599 return err;
600no_route: 600no_route:
601 kfree_skb(nskb); 601 kfree_skb(nskb);
602 IP_INC_STATS_BH(sock_net(asoc->base.sk), IPSTATS_MIB_OUTNOROUTES); 602 IP_INC_STATS(sock_net(asoc->base.sk), IPSTATS_MIB_OUTNOROUTES);
603 603
604 /* FIXME: Returning the 'err' will effect all the associations 604 /* FIXME: Returning the 'err' will effect all the associations
605 * associated with a socket, although only one of the paths of the 605 * associated with a socket, although only one of the paths of the