public inbox for linux-man@vger.kernel.org
 help / color / mirror / Atom feed
* Typo in the man7 bpf-helpers page
@ 2023-01-31 10:03 Zexuan Luo
  2023-01-31 11:00 ` Alejandro Colomar
  0 siblings, 1 reply; 8+ messages in thread
From: Zexuan Luo @ 2023-01-31 10:03 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: linux-man

Hello Colomar,

I just found a potential bug in the bpf-helpers page.

Under the https://www.man7.org/linux/man-pages/man7/bpf-helpers.7.html:

```
       u64 bpf_get_socket_cookie(struct sk_buff *skb)

              Description
                     If the struct sk_buff pointed by skb has a known
                     socket, retrieve the cookie (generated by the
                     kernel) of this socket.  If no cookie has been set
                     yet, generate a new cookie. Once generated, the
                     socket cookie remains stable for the life of the
                     socket. This helper can be useful for monitoring
                     per socket networking traffic statistics as it
                     provides a global socket identifier that can be
                     assumed unique.

              Return A 8-byte long non-decreasing number on success, or
                     0 if the socket field is missing inside skb.

       u64 bpf_get_socket_cookie(struct bpf_sock_addr *ctx)

              Description
                     Equivalent to bpf_get_socket_cookie() helper that
                     accepts skb, but gets socket from struct
                     bpf_sock_addr context.

              Return A 8-byte long non-decreasing number.

       u64 bpf_get_socket_cookie(struct bpf_sock_ops *ctx)

              Description
                     Equivalent to bpf_get_socket_cookie() helper that
                     accepts skb, but gets socket from struct
                     bpf_sock_ops context.

              Return A 8-byte long non-decreasing number.
```

The function bpf_get_socket_cookie repeats three times. The second one
should be bpf_get_socket_cookie_addr and the third one should be
bpf_get_socket_cookie_ops.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-01-31 14:51 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-31 10:03 Typo in the man7 bpf-helpers page Zexuan Luo
2023-01-31 11:00 ` Alejandro Colomar
2023-01-31 11:40   ` Alejandro Colomar
2023-01-31 11:51     ` Alejandro Colomar
2023-01-31 12:02     ` Quentin Monnet
2023-01-31 14:36       ` Zexuan Luo
2023-01-31 14:45         ` Zexuan Luo
2023-01-31 14:51         ` Quentin Monnet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox