aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/core/rtnetlink.c8
-rw-r--r--net/ipv4/tcp.c5
-rw-r--r--net/ipv4/tcp_input.c5
-rw-r--r--net/ipv4/tcp_ipv4.c14
-rw-r--r--net/ipv4/tcp_minisocks.c1
-rw-r--r--net/openvswitch/actions.c3
6 files changed, 22 insertions, 14 deletions
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 334b930e0de3..bc9e380f0abf 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -659,6 +659,12 @@ static void set_operstate(struct net_device *dev, unsigned char transition)
659 } 659 }
660} 660}
661 661
662static unsigned int rtnl_dev_get_flags(const struct net_device *dev)
663{
664 return (dev->flags & ~(IFF_PROMISC | IFF_ALLMULTI)) |
665 (dev->gflags & (IFF_PROMISC | IFF_ALLMULTI));
666}
667
662static unsigned int rtnl_dev_combine_flags(const struct net_device *dev, 668static unsigned int rtnl_dev_combine_flags(const struct net_device *dev,
663 const struct ifinfomsg *ifm) 669 const struct ifinfomsg *ifm)
664{ 670{
@@ -667,7 +673,7 @@ static unsigned int rtnl_dev_combine_flags(const struct net_device *dev,
667 /* bugwards compatibility: ifi_change == 0 is treated as ~0 */ 673 /* bugwards compatibility: ifi_change == 0 is treated as ~0 */
668 if (ifm->ifi_change) 674 if (ifm->ifi_change)
669 flags = (flags & ifm->ifi_change) | 675 flags = (flags & ifm->ifi_change) |
670 (dev->flags & ~ifm->ifi_change); 676 (rtnl_dev_get_flags(dev) & ~ifm->ifi_change);
671 677
672 return flags; 678 return flags;
673} 679}
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 581ecf02c6b5..e7e6eeae49c0 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -2681,7 +2681,10 @@ static int do_tcp_setsockopt(struct sock *sk, int level,
2681 /* Cap the max timeout in ms TCP will retry/retrans 2681 /* Cap the max timeout in ms TCP will retry/retrans
2682 * before giving up and aborting (ETIMEDOUT) a connection. 2682 * before giving up and aborting (ETIMEDOUT) a connection.
2683 */ 2683 */
2684 icsk->icsk_user_timeout = msecs_to_jiffies(val); 2684 if (val < 0)
2685 err = -EINVAL;
2686 else
2687 icsk->icsk_user_timeout = msecs_to_jiffies(val);
2685 break; 2688 break;
2686 default: 2689 default:
2687 err = -ENOPROTOOPT; 2690 err = -ENOPROTOOPT;
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 3e07a64ca44e..a356e1fecf9a 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -5475,7 +5475,9 @@ int tcp_rcv_established(struct sock *sk, struct sk_buff *skb,
5475 if (tp->copied_seq == tp->rcv_nxt && 5475 if (tp->copied_seq == tp->rcv_nxt &&
5476 len - tcp_header_len <= tp->ucopy.len) { 5476 len - tcp_header_len <= tp->ucopy.len) {
5477#ifdef CONFIG_NET_DMA 5477#ifdef CONFIG_NET_DMA
5478 if (tcp_dma_try_early_copy(sk, skb, tcp_header_len)) { 5478 if (tp->ucopy.task == current &&
5479 sock_owned_by_user(sk) &&
5480 tcp_dma_try_early_copy(sk, skb, tcp_header_len)) {
5479 copied_early = 1; 5481 copied_early = 1;
5480 eaten = 1; 5482 eaten = 1;
5481 } 5483 }
@@ -5603,6 +5605,7 @@ void tcp_finish_connect(struct sock *sk, struct sk_buff *skb)
5603 5605
5604 if (skb != NULL) { 5606 if (skb != NULL) {
5605 sk->sk_rx_dst = dst_clone(skb_dst(skb)); 5607 sk->sk_rx_dst = dst_clone(skb_dst(skb));
5608 inet_sk(sk)->rx_dst_ifindex = skb->skb_iif;
5606 security_inet_conn_established(sk, skb); 5609 security_inet_conn_established(sk, skb);
5607 } 5610 }
5608 5611
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index b6b07c93924c..2fbd9921253f 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -1620,17 +1620,15 @@ int tcp_v4_do_rcv(struct sock *sk, struct sk_buff *skb)
1620 sock_rps_save_rxhash(sk, skb); 1620 sock_rps_save_rxhash(sk, skb);
1621 if (sk->sk_rx_dst) { 1621 if (sk->sk_rx_dst) {
1622 struct dst_entry *dst = sk->sk_rx_dst; 1622 struct dst_entry *dst = sk->sk_rx_dst;
1623 if (dst->ops->check(dst, 0) == NULL) { 1623 if (inet_sk(sk)->rx_dst_ifindex != skb->skb_iif ||
1624 dst->ops->check(dst, 0) == NULL) {
1624 dst_release(dst); 1625 dst_release(dst);
1625 sk->sk_rx_dst = NULL; 1626 sk->sk_rx_dst = NULL;
1626 } 1627 }
1627 } 1628 }
1628 if (unlikely(sk->sk_rx_dst == NULL)) { 1629 if (unlikely(sk->sk_rx_dst == NULL)) {
1629 struct inet_sock *icsk = inet_sk(sk); 1630 sk->sk_rx_dst = dst_clone(skb_dst(skb));
1630 struct rtable *rt = skb_rtable(skb); 1631 inet_sk(sk)->rx_dst_ifindex = skb->skb_iif;
1631
1632 sk->sk_rx_dst = dst_clone(&rt->dst);
1633 icsk->rx_dst_ifindex = inet_iif(skb);
1634 } 1632 }
1635 if (tcp_rcv_established(sk, skb, tcp_hdr(skb), skb->len)) { 1633 if (tcp_rcv_established(sk, skb, tcp_hdr(skb), skb->len)) {
1636 rsk = sk; 1634 rsk = sk;
@@ -1709,11 +1707,11 @@ void tcp_v4_early_demux(struct sk_buff *skb)
1709 skb->destructor = sock_edemux; 1707 skb->destructor = sock_edemux;
1710 if (sk->sk_state != TCP_TIME_WAIT) { 1708 if (sk->sk_state != TCP_TIME_WAIT) {
1711 struct dst_entry *dst = sk->sk_rx_dst; 1709 struct dst_entry *dst = sk->sk_rx_dst;
1712 struct inet_sock *icsk = inet_sk(sk); 1710
1713 if (dst) 1711 if (dst)
1714 dst = dst_check(dst, 0); 1712 dst = dst_check(dst, 0);
1715 if (dst && 1713 if (dst &&
1716 icsk->rx_dst_ifindex == skb->skb_iif) 1714 inet_sk(sk)->rx_dst_ifindex == skb->skb_iif)
1717 skb_dst_set_noref(skb, dst); 1715 skb_dst_set_noref(skb, dst);
1718 } 1716 }
1719 } 1717 }
diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c
index 5912ac3fd240..3f1cc2028edd 100644
--- a/net/ipv4/tcp_minisocks.c
+++ b/net/ipv4/tcp_minisocks.c
@@ -388,6 +388,7 @@ struct sock *tcp_create_openreq_child(struct sock *sk, struct request_sock *req,
388 struct tcp_cookie_values *oldcvp = oldtp->cookie_values; 388 struct tcp_cookie_values *oldcvp = oldtp->cookie_values;
389 389
390 newsk->sk_rx_dst = dst_clone(skb_dst(skb)); 390 newsk->sk_rx_dst = dst_clone(skb_dst(skb));
391 inet_sk(newsk)->rx_dst_ifindex = skb->skb_iif;
391 392
392 /* TCP Cookie Transactions require space for the cookie pair, 393 /* TCP Cookie Transactions require space for the cookie pair,
393 * as it differs for each connection. There is no need to 394 * as it differs for each connection. There is no need to
diff --git a/net/openvswitch/actions.c b/net/openvswitch/actions.c
index 320fa0e6951a..f3f96badf5aa 100644
--- a/net/openvswitch/actions.c
+++ b/net/openvswitch/actions.c
@@ -325,9 +325,6 @@ static int sample(struct datapath *dp, struct sk_buff *skb,
325 } 325 }
326 } 326 }
327 327
328 if (!acts_list)
329 return 0;
330
331 return do_execute_actions(dp, skb, nla_data(acts_list), 328 return do_execute_actions(dp, skb, nla_data(acts_list),
332 nla_len(acts_list), true); 329 nla_len(acts_list), true);
333} 330}