linux-hams.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ralf Baechle <ralf@linux-mips.org>
To: libc-alpha@sourceware.org
Cc: Thomas Osterried <thomas@osterried.de>, linux-hams@vger.kernel.org
Subject: [PATCH] Add a number of protocols to __SOCKADDR_ALLTYPES
Date: Thu, 3 Aug 2017 14:04:48 +0200	[thread overview]
Message-ID: <20170803120448.GA24196@linux-mips.org> (raw)

__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)
 

                 reply	other threads:[~2017-08-03 12:04 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170803120448.GA24196@linux-mips.org \
    --to=ralf@linux-mips.org \
    --cc=libc-alpha@sourceware.org \
    --cc=linux-hams@vger.kernel.org \
    --cc=thomas@osterried.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).