mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
af_unix: Remove UNIX_ABSTRACT() macro and test sun_path[0] instead.
In BSD and abstract address cases, we store sockets in the hash table with keys between 0 and UNIX_HASH_SIZE - 1. However, the hash saved in a socket varies depending on its address type; sockets with BSD addresses always have UNIX_HASH_SIZE in their unix_sk(sk)->addr->hash. This is just for the UNIX_ABSTRACT() macro used to check the address type. The difference of the saved hashes comes from the first byte of the address in the first place. So, we can test it directly. Then we can keep a real hash in each socket and replace unix_table_lock with per-hash locks in the later patch. Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.co.jp> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
12f21c49ad
commit
5ce7ab4961
4 changed files with 4 additions and 8 deletions
|
@ -49,7 +49,7 @@ int dump_unix(struct bpf_iter__unix *ctx)
|
|||
sock_i_ino(sk));
|
||||
|
||||
if (unix_sk->addr) {
|
||||
if (!UNIX_ABSTRACT(unix_sk)) {
|
||||
if (unix_sk->addr->name->sun_path[0]) {
|
||||
BPF_SEQ_PRINTF(seq, " %s", unix_sk->addr->name->sun_path);
|
||||
} else {
|
||||
/* The name of the abstract UNIX domain socket starts
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue