[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] socket: Add IPPROTO_IPV6 and IPV6_V6ONLY.

From: Christopher Baines
Subject: [PATCH] socket: Add IPPROTO_IPV6 and IPV6_V6ONLY.
Date: Fri, 13 May 2022 12:51:14 +0100

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

* 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));
+#ifdef IPPROTO_IPV6
+  scm_c_define ("IPPROTO_IPV6", scm_from_int (IPPROTO_IPV6));
   scm_c_define ("IPPROTO_TCP", scm_from_int (IPPROTO_TCP));
@@ -1791,6 +1794,10 @@ scm_init_socket ()
   scm_c_define ("IP_MULTICAST_IF", scm_from_int ( IP_MULTICAST_IF));
+#ifdef IPV6_V6ONLY
+  scm_c_define ("IPV6_V6ONLY", scm_from_int (IPV6_V6ONLY));
   scm_add_feature ("socket");
 #include "socket.x"

reply via email to

[Prev in Thread] Current Thread [Next in Thread]