diff options
author | Thomas Munro | 2022-08-23 11:52:17 +0000 |
---|---|---|
committer | Thomas Munro | 2022-08-23 12:09:37 +0000 |
commit | c9818798147a4eec00bba61a05fa9bc88398ec3b (patch) | |
tree | e1edc203582fb234f3296ab7f7c74c43ec10016c | |
parent | f972ec5c285c3bc50d81f8044e08cd636017ab68 (diff) |
Don't bother to set sockaddr_un.sun_len.
It's not necessary to fill in sun_len when calling bind() or connect(),
on all known systems that have it.
Discussion: https://postgr.es/m/2781112.1644819528%40sss.pgh.pa.us
-rw-r--r-- | src/common/ip.c | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/src/common/ip.c b/src/common/ip.c index 9b611cdc8c..6343f49a70 100644 --- a/src/common/ip.c +++ b/src/common/ip.c @@ -218,20 +218,6 @@ getaddrinfo_unix(const char *path, const struct addrinfo *hintsp, aip->ai_addrlen = offsetof(struct sockaddr_un, sun_path) + strlen(path); } - /* - * The standard recommendation for filling sun_len is to set it to the - * struct size (independently of the actual path length). However, that - * draws an integer-overflow warning on AIX 7.1, where sun_len is just - * uint8 yet the struct size exceeds 255 bytes. It's likely that nothing - * is paying attention to sun_len on that platform, but we have to do - * something with it. To suppress the warning, clamp the struct size to - * what will fit in sun_len. - */ -#ifdef HAVE_STRUCT_SOCKADDR_SA_LEN - unp->sun_len = Min(sizeof(struct sockaddr_un), - ((size_t) 1 << (sizeof(unp->sun_len) * BITS_PER_BYTE)) - 1); -#endif - return 0; } |