This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] Add a number of protocols to __SOCKADDR_ALLTYPES
- From: Ralf Baechle <ralf at linux-mips dot org>
- To: libc-alpha at sourceware dot org
- Cc: Thomas Osterried <thomas at osterried dot de>, linux-hams at vger dot kernel dot org
- Date: Thu, 3 Aug 2017 14:04:48 +0200
- Subject: [PATCH] Add a number of protocols to __SOCKADDR_ALLTYPES
- Authentication-results: sourceware.org; auth=none
__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)