summaryrefslogtreecommitdiff
path: root/Modules/socketmodule.h
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2019-10-10 21:30:20 +0200
committerGitHub <noreply@github.com>2019-10-10 21:30:20 +0200
commitd565fb9828ee9c494bb7a80057a08e4738273e30 (patch)
tree93fda6393b2dd321afa6f928abd3c5b6a13c12fc /Modules/socketmodule.h
parent1dbe5373851acb85ba91f0be7b83c69563acd68d (diff)
downloadcpython-git-d565fb9828ee9c494bb7a80057a08e4738273e30.tar.gz
bpo-38282: Rewrite getsockaddrarg() helper function (GH-16698)
Rewrite getsockaddrarg() helper function of socketmodule.c (_socket module) to prevent a false alarm when compiling codde using GCC with _FORTIFY_SOURCE=2. Pass a pointer of the sock_addr_t union, rather than passing a pointer to a sockaddr structure. Add "struct sockaddr_tipc tipc;" to the sock_addr_t union.
Diffstat (limited to 'Modules/socketmodule.h')
-rw-r--r--Modules/socketmodule.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/Modules/socketmodule.h b/Modules/socketmodule.h
index 3d95fe709a..e06e4c3888 100644
--- a/Modules/socketmodule.h
+++ b/Modules/socketmodule.h
@@ -261,6 +261,9 @@ typedef union sock_addr {
#ifdef AF_VSOCK
struct sockaddr_vm vm;
#endif
+#ifdef HAVE_LINUX_TIPC_H
+ struct sockaddr_tipc tipc;
+#endif
} sock_addr_t;
/* The object holding a socket. It holds some extra information,