summaryrefslogtreecommitdiff
path: root/lib/bch.c
diff options
context:
space:
mode:
authorKuniyuki Iwashima <kuniyu@amazon.co.jp>2021-11-24 05:14:19 +0300
committerJakub Kicinski <kuba@kernel.org>2021-11-27 05:01:53 +0300
commit755662ce78d14c1a9118df921c528b1f992ded2e (patch)
tree7932aff19cff0e8f89785ba434c9b4f95a3efb19 /lib/bch.c
parent442b03c32ca1077c75682346a1434eedcdc3e4d4 (diff)
downloadlinux-755662ce78d14c1a9118df921c528b1f992ded2e.tar.xz
af_unix: Use offsetof() instead of sizeof().
The length of the AF_UNIX socket address contains an offset to the member sun_path of struct sockaddr_un. Currently, the preceding member is just sun_family, and its type is sa_family_t and resolved to short. Therefore, the offset is represented by sizeof(short). However, it is not clear and fragile to changes in struct sockaddr_storage or sockaddr_un. This commit makes it clear and robust by rewriting sizeof() with offsetof(). Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.co.jp> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'lib/bch.c')
0 files changed, 0 insertions, 0 deletions