* [PATCH] Add a number of protocols to __SOCKADDR_ALLTYPES
@ 2017-08-03 12:04 Ralf Baechle
0 siblings, 0 replies; only message in thread
From: Ralf Baechle @ 2017-08-03 12:04 UTC (permalink / raw)
To: libc-alpha; +Cc: Thomas Osterried, linux-hams
__SOCKADDR_ALLTYPES is lacking a number of sockaddr_* variants so those
can't be passed to syscalls such as bind, sendto, recvfrom oder
getsockname or a warning or build error such as
beacon.c: In function ‘main’:
beacon.c:188:15: error: incompatible type for argument 2 of ‘bind’
if (bind(s, &src, len) == -1) {
will hit. Adding a number of sockaddr_* fixes these problems.
2017-08-03 Ralf Baechle <ralf@linux-mips.org>
* socket/sys/socket.h (__SOCKADDR_ALLTYPES.): Add
full_sockaddr_ax25 , sockaddr_ll, sockaddr_pkt and sockaddr_rose.
---
socket/sys/socket.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/socket/sys/socket.h b/socket/sys/socket.h
index bbfde8f602..061f457993 100644
--- a/socket/sys/socket.h
+++ b/socket/sys/socket.h
@@ -61,6 +61,7 @@ enum
/* Add more `struct sockaddr_AF' types here as necessary.
These are all the ones I found on NetBSD and Linux. */
# define __SOCKADDR_ALLTYPES \
+ __SOCKADDR_ONETYPE (full_sockaddr_ax25) \
__SOCKADDR_ONETYPE (sockaddr) \
__SOCKADDR_ONETYPE (sockaddr_at) \
__SOCKADDR_ONETYPE (sockaddr_ax25) \
@@ -71,7 +72,10 @@ enum
__SOCKADDR_ONETYPE (sockaddr_inarp) \
__SOCKADDR_ONETYPE (sockaddr_ipx) \
__SOCKADDR_ONETYPE (sockaddr_iso) \
+ __SOCKADDR_ONETYPE (sockaddr_ll) \
__SOCKADDR_ONETYPE (sockaddr_ns) \
+ __SOCKADDR_ONETYPE (sockaddr_pkt) \
+ __SOCKADDR_ONETYPE (sockaddr_rose) \
__SOCKADDR_ONETYPE (sockaddr_un) \
__SOCKADDR_ONETYPE (sockaddr_x25)
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2017-08-03 12:04 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-03 12:04 [PATCH] Add a number of protocols to __SOCKADDR_ALLTYPES Ralf Baechle
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).