Merge ra.kernel.org:/pub/scm/linux/kernel/git/davem/net
Two new tls tests added in parallel in both net and net-next. Used Stephen Rothwell's linux-next resolution. Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
@@ -2124,6 +2124,28 @@ static inline int udp4_csum_init(struct sk_buff *skb, struct udphdr *uh,
|
||||
inet_compute_pseudo);
|
||||
}
|
||||
|
||||
/* wrapper for udp_queue_rcv_skb tacking care of csum conversion and
|
||||
* return code conversion for ip layer consumption
|
||||
*/
|
||||
static int udp_unicast_rcv_skb(struct sock *sk, struct sk_buff *skb,
|
||||
struct udphdr *uh)
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (inet_get_convert_csum(sk) && uh->check && !IS_UDPLITE(sk))
|
||||
skb_checksum_try_convert(skb, IPPROTO_UDP, uh->check,
|
||||
inet_compute_pseudo);
|
||||
|
||||
ret = udp_queue_rcv_skb(sk, skb);
|
||||
|
||||
/* a return value > 0 means to resubmit the input, but
|
||||
* it wants the return to be -protocol, or 0
|
||||
*/
|
||||
if (ret > 0)
|
||||
return -ret;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* All we need to do is get the socket, and then do a checksum.
|
||||
*/
|
||||
@@ -2170,14 +2192,9 @@ int __udp4_lib_rcv(struct sk_buff *skb, struct udp_table *udptable,
|
||||
if (unlikely(sk->sk_rx_dst != dst))
|
||||
udp_sk_rx_dst_set(sk, dst);
|
||||
|
||||
ret = udp_queue_rcv_skb(sk, skb);
|
||||
ret = udp_unicast_rcv_skb(sk, skb, uh);
|
||||
sock_put(sk);
|
||||
/* a return value > 0 means to resubmit the input, but
|
||||
* it wants the return to be -protocol, or 0
|
||||
*/
|
||||
if (ret > 0)
|
||||
return -ret;
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (rt->rt_flags & (RTCF_BROADCAST|RTCF_MULTICAST))
|
||||
@@ -2185,22 +2202,8 @@ int __udp4_lib_rcv(struct sk_buff *skb, struct udp_table *udptable,
|
||||
saddr, daddr, udptable, proto);
|
||||
|
||||
sk = __udp4_lib_lookup_skb(skb, uh->source, uh->dest, udptable);
|
||||
if (sk) {
|
||||
int ret;
|
||||
|
||||
if (inet_get_convert_csum(sk) && uh->check && !IS_UDPLITE(sk))
|
||||
skb_checksum_try_convert(skb, IPPROTO_UDP, uh->check,
|
||||
inet_compute_pseudo);
|
||||
|
||||
ret = udp_queue_rcv_skb(sk, skb);
|
||||
|
||||
/* a return value > 0 means to resubmit the input, but
|
||||
* it wants the return to be -protocol, or 0
|
||||
*/
|
||||
if (ret > 0)
|
||||
return -ret;
|
||||
return 0;
|
||||
}
|
||||
if (sk)
|
||||
return udp_unicast_rcv_skb(sk, skb, uh);
|
||||
|
||||
if (!xfrm4_policy_check(NULL, XFRM_POLICY_IN, skb))
|
||||
goto drop;
|
||||
|
Reference in New Issue
Block a user