diff options
Diffstat (limited to 'net/ipv4/udp.c')
-rw-r--r-- | net/ipv4/udp.c | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 5676237d2b0f..ebfbccae62fd 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
@@ -231,10 +231,7 @@ static int udp_reuseport_add_sock(struct sock *sk, struct udp_hslot *hslot) | |||
231 | } | 231 | } |
232 | } | 232 | } |
233 | 233 | ||
234 | /* Initial allocation may have already happened via setsockopt */ | 234 | return reuseport_alloc(sk); |
235 | if (!rcu_access_pointer(sk->sk_reuseport_cb)) | ||
236 | return reuseport_alloc(sk); | ||
237 | return 0; | ||
238 | } | 235 | } |
239 | 236 | ||
240 | /** | 237 | /** |
@@ -1061,7 +1058,7 @@ back_from_confirm: | |||
1061 | /* ... which is an evident application bug. --ANK */ | 1058 | /* ... which is an evident application bug. --ANK */ |
1062 | release_sock(sk); | 1059 | release_sock(sk); |
1063 | 1060 | ||
1064 | net_dbg_ratelimited("cork app bug 2\n"); | 1061 | net_dbg_ratelimited("socket already corked\n"); |
1065 | err = -EINVAL; | 1062 | err = -EINVAL; |
1066 | goto out; | 1063 | goto out; |
1067 | } | 1064 | } |
@@ -1144,7 +1141,7 @@ int udp_sendpage(struct sock *sk, struct page *page, int offset, | |||
1144 | if (unlikely(!up->pending)) { | 1141 | if (unlikely(!up->pending)) { |
1145 | release_sock(sk); | 1142 | release_sock(sk); |
1146 | 1143 | ||
1147 | net_dbg_ratelimited("udp cork app bug 3\n"); | 1144 | net_dbg_ratelimited("cork failed\n"); |
1148 | return -EINVAL; | 1145 | return -EINVAL; |
1149 | } | 1146 | } |
1150 | 1147 | ||
@@ -2240,20 +2237,16 @@ int udp_v4_early_demux(struct sk_buff *skb) | |||
2240 | iph = ip_hdr(skb); | 2237 | iph = ip_hdr(skb); |
2241 | uh = udp_hdr(skb); | 2238 | uh = udp_hdr(skb); |
2242 | 2239 | ||
2243 | if (skb->pkt_type == PACKET_BROADCAST || | 2240 | if (skb->pkt_type == PACKET_MULTICAST) { |
2244 | skb->pkt_type == PACKET_MULTICAST) { | ||
2245 | in_dev = __in_dev_get_rcu(skb->dev); | 2241 | in_dev = __in_dev_get_rcu(skb->dev); |
2246 | 2242 | ||
2247 | if (!in_dev) | 2243 | if (!in_dev) |
2248 | return 0; | 2244 | return 0; |
2249 | 2245 | ||
2250 | /* we are supposed to accept bcast packets */ | 2246 | ours = ip_check_mc_rcu(in_dev, iph->daddr, iph->saddr, |
2251 | if (skb->pkt_type == PACKET_MULTICAST) { | 2247 | iph->protocol); |
2252 | ours = ip_check_mc_rcu(in_dev, iph->daddr, iph->saddr, | 2248 | if (!ours) |
2253 | iph->protocol); | 2249 | return 0; |
2254 | if (!ours) | ||
2255 | return 0; | ||
2256 | } | ||
2257 | 2250 | ||
2258 | sk = __udp4_lib_mcast_demux_lookup(net, uh->dest, iph->daddr, | 2251 | sk = __udp4_lib_mcast_demux_lookup(net, uh->dest, iph->daddr, |
2259 | uh->source, iph->saddr, | 2252 | uh->source, iph->saddr, |