Bluetooth: Add multiple LE advertise state change event
[platform/kernel/linux-starfive.git] / net / ipv4 / tcp_ipv4.c
index a59cc4b..c7ffab3 100644 (file)
@@ -57,6 +57,7 @@
 #include <linux/init.h>
 #include <linux/times.h>
 #include <linux/slab.h>
+#include <linux/sched.h>
 
 #include <net/net_namespace.h>
 #include <net/icmp.h>
@@ -193,7 +194,7 @@ static int tcp_v4_pre_connect(struct sock *sk, struct sockaddr *uaddr,
 
        sock_owned_by_me(sk);
 
-       return BPF_CGROUP_RUN_PROG_INET4_CONNECT(sk, uaddr);
+       return BPF_CGROUP_RUN_PROG_INET4_CONNECT(sk, uaddr, &addr_len);
 }
 
 /* This will initiate an outgoing connection. */
@@ -312,7 +313,7 @@ int tcp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
                                             inet->inet_daddr));
        }
 
-       inet->inet_id = get_random_u16();
+       atomic_set(&inet->inet_id, get_random_u16());
 
        if (tcp_fastopen_defer_connect(sk, &err))
                return err;
@@ -476,7 +477,6 @@ int tcp_v4_err(struct sk_buff *skb, u32 info)
        const struct iphdr *iph = (const struct iphdr *)skb->data;
        struct tcphdr *th = (struct tcphdr *)(skb->data + (iph->ihl << 2));
        struct tcp_sock *tp;
-       struct inet_sock *inet;
        const int type = icmp_hdr(skb)->type;
        const int code = icmp_hdr(skb)->code;
        struct sock *sk;
@@ -624,8 +624,8 @@ int tcp_v4_err(struct sk_buff *skb, u32 info)
         *                                                      --ANK (980905)
         */
 
-       inet = inet_sk(sk);
-       if (!sock_owned_by_user(sk) && inet->recverr) {
+       if (!sock_owned_by_user(sk) &&
+           inet_test_bit(RECVERR, sk)) {
                WRITE_ONCE(sk->sk_err, err);
                sk_error_report(sk);
        } else  { /* Only an error on timeout */
@@ -1596,7 +1596,7 @@ struct sock *tcp_v4_syn_recv_sock(const struct sock *sk, struct sk_buff *skb,
        inet_csk(newsk)->icsk_ext_hdr_len = 0;
        if (inet_opt)
                inet_csk(newsk)->icsk_ext_hdr_len = inet_opt->opt.optlen;
-       newinet->inet_id = get_random_u16();
+       atomic_set(&newinet->inet_id, get_random_u16());
 
        /* Set ToS of the new socket based upon the value of incoming SYN.
         * ECT bits are set later in tcp_init_transfer().
@@ -1869,6 +1869,7 @@ bool tcp_add_backlog(struct sock *sk, struct sk_buff *skb,
 #ifdef CONFIG_TLS_DEVICE
            tail->decrypted != skb->decrypted ||
 #endif
+           !mptcp_skb_can_collapse(tail, skb) ||
            thtail->doff != th->doff ||
            memcmp(thtail + 1, th + 1, hdrlen - sizeof(*th)))
                goto no_coalesce;
@@ -2448,6 +2449,8 @@ static void *established_get_first(struct seq_file *seq)
                struct hlist_nulls_node *node;
                spinlock_t *lock = inet_ehash_lockp(hinfo, st->bucket);
 
+               cond_resched();
+
                /* Lockless fast path for the common case of empty buckets */
                if (empty_bucket(hinfo, st))
                        continue;