[PATCH bpf] bpf: Fix oudated __bpf_skc_lookup() comment

Daniel Xu posted 1 patch 3 years, 8 months ago
net/core/filter.c | 2 --
1 file changed, 2 deletions(-)
[PATCH bpf] bpf: Fix oudated __bpf_skc_lookup() comment
Posted by Daniel Xu 3 years, 8 months ago
The function returns a pointer now.

Fixes: edbf8c01de5a ("bpf: add skc_lookup_tcp helper")
Signed-off-by: Daniel Xu <dxu@dxuuu.xyz>
---
 net/core/filter.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/net/core/filter.c b/net/core/filter.c
index 5d16d66727fc..866ca05f95e0 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -6463,8 +6463,6 @@ static struct sock *sk_lookup(struct net *net, struct bpf_sock_tuple *tuple,
 
 /* bpf_skc_lookup performs the core lookup for different types of sockets,
  * taking a reference on the socket if it doesn't have the flag SOCK_RCU_FREE.
- * Returns the socket as an 'unsigned long' to simplify the casting in the
- * callers to satisfy BPF_CALL declarations.
  */
 static struct sock *
 __bpf_skc_lookup(struct sk_buff *skb, struct bpf_sock_tuple *tuple, u32 len,
-- 
2.37.1
Re: [PATCH bpf] bpf: Fix oudated __bpf_skc_lookup() comment
Posted by Andrii Nakryiko 3 years, 8 months ago
On Fri, Jul 29, 2022 at 12:47 PM Daniel Xu <dxu@dxuuu.xyz> wrote:
>
> The function returns a pointer now.
>
> Fixes: edbf8c01de5a ("bpf: add skc_lookup_tcp helper")
> Signed-off-by: Daniel Xu <dxu@dxuuu.xyz>
> ---

This was already done in [0] in bpf-next.

  [0] f5be22c64bd6 ("bpf: Fix bpf_skc_lookup comment wrt. return type")


>  net/core/filter.c | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/net/core/filter.c b/net/core/filter.c
> index 5d16d66727fc..866ca05f95e0 100644
> --- a/net/core/filter.c
> +++ b/net/core/filter.c
> @@ -6463,8 +6463,6 @@ static struct sock *sk_lookup(struct net *net, struct bpf_sock_tuple *tuple,
>
>  /* bpf_skc_lookup performs the core lookup for different types of sockets,
>   * taking a reference on the socket if it doesn't have the flag SOCK_RCU_FREE.
> - * Returns the socket as an 'unsigned long' to simplify the casting in the
> - * callers to satisfy BPF_CALL declarations.
>   */
>  static struct sock *
>  __bpf_skc_lookup(struct sk_buff *skb, struct bpf_sock_tuple *tuple, u32 len,
> --
> 2.37.1
>