diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-08-07 00:06:02 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-08-07 00:06:02 -0400 |
commit | 6456a0438b984186a0c9c8ecc9fe3d97b7ac3613 (patch) | |
tree | 51e61c1c269cd3647b73d6cf5d2168167f9fb0a6 /net/ipv4 | |
parent | 158c12948f3012fbe15f066f308db23502d3db0a (diff) | |
parent | 6c8f7e70837468da4e658080d4448930fb597e1b (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller:
"This fixes the most immediate fallout from yesterday's networking
merge:
1) sock_tx_timestamp() must not clear the passed in tx_flags, but
rather add to them. Fix from Eric Dumazet.
2) The hyperv driver sendbuf region increase needs to be decreased
slightly to handle older backends. From KY Srinivasan.
3) Fix RCU lockdep splats in netlink diag after recent hashing
changes, from Thomas Graf.
4) The new IPV6_FLOWLABEL was given a socket option number that
overlapped with an existing IP6 tables one, breaking ip6_tables.
Fixed by Pablo Neira Ayuso"
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net:
netlink: hold nl_sock_hash_lock during diag dump
tcp: md5: check md5 signature without socket lock
net: fix USB network driver config option.
net: reallocate new socket option number for IPV6_AUTOFLOWLABEL
vmxnet3: fix decimal printf format specifiers prefixed with 0x
net-timestamp: cumulative tcp timestamping fixes
hyperv: Adjust the size of sendbuf region to support ws2008r2
cxgb4: Fix for SR-IOV VF initialization
net-timestamp: sock_tx_timestamp() fix
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/tcp.c | 12 | ||||
-rw-r--r-- | net/ipv4/tcp_ipv4.c | 36 | ||||
-rw-r--r-- | net/ipv4/tcp_offload.c | 8 |
3 files changed, 36 insertions, 20 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 744af67a5989..181b70ebd964 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c | |||
@@ -426,13 +426,15 @@ void tcp_init_sock(struct sock *sk) | |||
426 | } | 426 | } |
427 | EXPORT_SYMBOL(tcp_init_sock); | 427 | EXPORT_SYMBOL(tcp_init_sock); |
428 | 428 | ||
429 | void tcp_tx_timestamp(struct sock *sk, struct sk_buff *skb) | 429 | static void tcp_tx_timestamp(struct sock *sk, struct sk_buff *skb) |
430 | { | 430 | { |
431 | struct skb_shared_info *shinfo = skb_shinfo(skb); | 431 | if (sk->sk_tsflags) { |
432 | struct skb_shared_info *shinfo = skb_shinfo(skb); | ||
432 | 433 | ||
433 | sock_tx_timestamp(sk, &shinfo->tx_flags); | 434 | sock_tx_timestamp(sk, &shinfo->tx_flags); |
434 | if (shinfo->tx_flags & SKBTX_ANY_SW_TSTAMP) | 435 | if (shinfo->tx_flags & SKBTX_ANY_TSTAMP) |
435 | shinfo->tskey = TCP_SKB_CB(skb)->seq + skb->len - 1; | 436 | shinfo->tskey = TCP_SKB_CB(skb)->seq + skb->len - 1; |
437 | } | ||
436 | } | 438 | } |
437 | 439 | ||
438 | /* | 440 | /* |
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 992a1f926009..dceff5fe8e66 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -1167,7 +1167,8 @@ clear_hash_noput: | |||
1167 | } | 1167 | } |
1168 | EXPORT_SYMBOL(tcp_v4_md5_hash_skb); | 1168 | EXPORT_SYMBOL(tcp_v4_md5_hash_skb); |
1169 | 1169 | ||
1170 | static bool tcp_v4_inbound_md5_hash(struct sock *sk, const struct sk_buff *skb) | 1170 | static bool __tcp_v4_inbound_md5_hash(struct sock *sk, |
1171 | const struct sk_buff *skb) | ||
1171 | { | 1172 | { |
1172 | /* | 1173 | /* |
1173 | * This gets called for each TCP segment that arrives | 1174 | * This gets called for each TCP segment that arrives |
@@ -1220,6 +1221,17 @@ static bool tcp_v4_inbound_md5_hash(struct sock *sk, const struct sk_buff *skb) | |||
1220 | return false; | 1221 | return false; |
1221 | } | 1222 | } |
1222 | 1223 | ||
1224 | static bool tcp_v4_inbound_md5_hash(struct sock *sk, const struct sk_buff *skb) | ||
1225 | { | ||
1226 | bool ret; | ||
1227 | |||
1228 | rcu_read_lock(); | ||
1229 | ret = __tcp_v4_inbound_md5_hash(sk, skb); | ||
1230 | rcu_read_unlock(); | ||
1231 | |||
1232 | return ret; | ||
1233 | } | ||
1234 | |||
1223 | #endif | 1235 | #endif |
1224 | 1236 | ||
1225 | static void tcp_v4_init_req(struct request_sock *req, struct sock *sk, | 1237 | static void tcp_v4_init_req(struct request_sock *req, struct sock *sk, |
@@ -1432,16 +1444,6 @@ static struct sock *tcp_v4_hnd_req(struct sock *sk, struct sk_buff *skb) | |||
1432 | int tcp_v4_do_rcv(struct sock *sk, struct sk_buff *skb) | 1444 | int tcp_v4_do_rcv(struct sock *sk, struct sk_buff *skb) |
1433 | { | 1445 | { |
1434 | struct sock *rsk; | 1446 | struct sock *rsk; |
1435 | #ifdef CONFIG_TCP_MD5SIG | ||
1436 | /* | ||
1437 | * We really want to reject the packet as early as possible | ||
1438 | * if: | ||
1439 | * o We're expecting an MD5'd packet and this is no MD5 tcp option | ||
1440 | * o There is an MD5 option and we're not expecting one | ||
1441 | */ | ||
1442 | if (tcp_v4_inbound_md5_hash(sk, skb)) | ||
1443 | goto discard; | ||
1444 | #endif | ||
1445 | 1447 | ||
1446 | if (sk->sk_state == TCP_ESTABLISHED) { /* Fast path */ | 1448 | if (sk->sk_state == TCP_ESTABLISHED) { /* Fast path */ |
1447 | struct dst_entry *dst = sk->sk_rx_dst; | 1449 | struct dst_entry *dst = sk->sk_rx_dst; |
@@ -1644,6 +1646,18 @@ process: | |||
1644 | 1646 | ||
1645 | if (!xfrm4_policy_check(sk, XFRM_POLICY_IN, skb)) | 1647 | if (!xfrm4_policy_check(sk, XFRM_POLICY_IN, skb)) |
1646 | goto discard_and_relse; | 1648 | goto discard_and_relse; |
1649 | |||
1650 | #ifdef CONFIG_TCP_MD5SIG | ||
1651 | /* | ||
1652 | * We really want to reject the packet as early as possible | ||
1653 | * if: | ||
1654 | * o We're expecting an MD5'd packet and this is no MD5 tcp option | ||
1655 | * o There is an MD5 option and we're not expecting one | ||
1656 | */ | ||
1657 | if (tcp_v4_inbound_md5_hash(sk, skb)) | ||
1658 | goto discard_and_relse; | ||
1659 | #endif | ||
1660 | |||
1647 | nf_reset(skb); | 1661 | nf_reset(skb); |
1648 | 1662 | ||
1649 | if (sk_filter(sk, skb)) | 1663 | if (sk_filter(sk, skb)) |
diff --git a/net/ipv4/tcp_offload.c b/net/ipv4/tcp_offload.c index f597119fc4e7..bc1b83cb8309 100644 --- a/net/ipv4/tcp_offload.c +++ b/net/ipv4/tcp_offload.c | |||
@@ -14,12 +14,12 @@ | |||
14 | #include <net/tcp.h> | 14 | #include <net/tcp.h> |
15 | #include <net/protocol.h> | 15 | #include <net/protocol.h> |
16 | 16 | ||
17 | void tcp_gso_tstamp(struct sk_buff *skb, unsigned int ts_seq, unsigned int seq, | 17 | static void tcp_gso_tstamp(struct sk_buff *skb, unsigned int ts_seq, |
18 | unsigned int mss) | 18 | unsigned int seq, unsigned int mss) |
19 | { | 19 | { |
20 | while (skb) { | 20 | while (skb) { |
21 | if (ts_seq < (__u64) seq + mss) { | 21 | if (before(ts_seq, seq + mss)) { |
22 | skb_shinfo(skb)->tx_flags = SKBTX_SW_TSTAMP; | 22 | skb_shinfo(skb)->tx_flags |= SKBTX_SW_TSTAMP; |
23 | skb_shinfo(skb)->tskey = ts_seq; | 23 | skb_shinfo(skb)->tskey = ts_seq; |
24 | return; | 24 | return; |
25 | } | 25 | } |