tcp_bpf.c (cdd38c5f1ce4398ec58fec95904b75824daab7b5) tcp_bpf.c (887596095ec2a9ea39ffcf98f27bf2e77c5eb512)
1// SPDX-License-Identifier: GPL-2.0
2/* Copyright (c) 2017 - 2018 Covalent IO, Inc. http://covalent.io */
3
4#include <linux/skmsg.h>
5#include <linux/filter.h>
6#include <linux/bpf.h>
7#include <linux/init.h>
8#include <linux/wait.h>

--- 215 unchanged lines hidden (view full) ---

224 }
225 ret = ingress ? bpf_tcp_ingress(sk, psock, msg, bytes, flags) :
226 tcp_bpf_push_locked(sk, msg, bytes, flags, false);
227 sk_psock_put(sk, psock);
228 return ret;
229}
230EXPORT_SYMBOL_GPL(tcp_bpf_sendmsg_redir);
231
1// SPDX-License-Identifier: GPL-2.0
2/* Copyright (c) 2017 - 2018 Covalent IO, Inc. http://covalent.io */
3
4#include <linux/skmsg.h>
5#include <linux/filter.h>
6#include <linux/bpf.h>
7#include <linux/init.h>
8#include <linux/wait.h>

--- 215 unchanged lines hidden (view full) ---

224 }
225 ret = ingress ? bpf_tcp_ingress(sk, psock, msg, bytes, flags) :
226 tcp_bpf_push_locked(sk, msg, bytes, flags, false);
227 sk_psock_put(sk, psock);
228 return ret;
229}
230EXPORT_SYMBOL_GPL(tcp_bpf_sendmsg_redir);
231
232#ifdef CONFIG_BPF_STREAM_PARSER
232#ifdef CONFIG_BPF_SYSCALL
233static bool tcp_bpf_stream_read(const struct sock *sk)
234{
235 struct sk_psock *psock;
236 bool empty = true;
237
238 rcu_read_lock();
239 psock = sk_psock(sk);
240 if (likely(psock))

--- 383 unchanged lines hidden (view full) ---

624void tcp_bpf_clone(const struct sock *sk, struct sock *newsk)
625{
626 int family = sk->sk_family == AF_INET6 ? TCP_BPF_IPV6 : TCP_BPF_IPV4;
627 struct proto *prot = newsk->sk_prot;
628
629 if (prot == &tcp_bpf_prots[family][TCP_BPF_BASE])
630 newsk->sk_prot = sk->sk_prot_creator;
631}
233static bool tcp_bpf_stream_read(const struct sock *sk)
234{
235 struct sk_psock *psock;
236 bool empty = true;
237
238 rcu_read_lock();
239 psock = sk_psock(sk);
240 if (likely(psock))

--- 383 unchanged lines hidden (view full) ---

624void tcp_bpf_clone(const struct sock *sk, struct sock *newsk)
625{
626 int family = sk->sk_family == AF_INET6 ? TCP_BPF_IPV6 : TCP_BPF_IPV4;
627 struct proto *prot = newsk->sk_prot;
628
629 if (prot == &tcp_bpf_prots[family][TCP_BPF_BASE])
630 newsk->sk_prot = sk->sk_prot_creator;
631}
632#endif /* CONFIG_BPF_STREAM_PARSER */
632#endif /* CONFIG_BPF_SYSCALL */