unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Christopher Baines <mail@cbaines.net>
To: guile-devel@gnu.org
Subject: [PATCH] socket: Add IPPROTO_IPV6 and IPV6_V6ONLY.
Date: Fri, 13 May 2022 12:51:14 +0100	[thread overview]
Message-ID: <20220513115114.7821-1-mail@cbaines.net> (raw)

Add constants to enable setting sockets to be IPv6 only. This is useful
if you want to listen on a port via IPv4 and IPv6 as the socket for IPv6
may need setting to be IPv6 only to avoid conflicting with the IPv4
socket.

* libguile/socket.c (IPPROTO_IPV6, IPV6_V6ONLY): New constants.
---
 libguile/socket.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/libguile/socket.c b/libguile/socket.c
index 77cdd74ef..98861e913 100644
--- a/libguile/socket.c
+++ b/libguile/socket.c
@@ -1702,6 +1702,9 @@ scm_init_socket ()
 #ifdef IPPROTO_IP
   scm_c_define ("IPPROTO_IP", scm_from_int (IPPROTO_IP));
 #endif
+#ifdef IPPROTO_IPV6
+  scm_c_define ("IPPROTO_IPV6", scm_from_int (IPPROTO_IPV6));
+#endif
 #ifdef IPPROTO_TCP
   scm_c_define ("IPPROTO_TCP", scm_from_int (IPPROTO_TCP));
 #endif
@@ -1791,6 +1794,10 @@ scm_init_socket ()
   scm_c_define ("IP_MULTICAST_IF", scm_from_int ( IP_MULTICAST_IF));
 #endif
 
+#ifdef IPV6_V6ONLY
+  scm_c_define ("IPV6_V6ONLY", scm_from_int (IPV6_V6ONLY));
+#endif
+
   scm_add_feature ("socket");
 
 #include "socket.x"
-- 
2.34.0




             reply	other threads:[~2022-05-13 11:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-13 11:51 Christopher Baines [this message]
2022-05-13 12:32 ` [PATCH] socket: Add IPPROTO_IPV6 and IPV6_V6ONLY Maxime Devos

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

  List information: https://www.gnu.org/software/guile/

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

  git send-email \
    --in-reply-to=20220513115114.7821-1-mail@cbaines.net \
    --to=mail@cbaines.net \
    --cc=guile-devel@gnu.org \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).