unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* [PATCH] socket: Add IPPROTO_IPV6 and IPV6_V6ONLY.
@ 2022-05-13 11:51 Christopher Baines
  2022-05-13 12:32 ` Maxime Devos
  0 siblings, 1 reply; 2+ messages in thread
From: Christopher Baines @ 2022-05-13 11:51 UTC (permalink / raw)
  To: guile-devel

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




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] socket: Add IPPROTO_IPV6 and IPV6_V6ONLY.
  2022-05-13 11:51 [PATCH] socket: Add IPPROTO_IPV6 and IPV6_V6ONLY Christopher Baines
@ 2022-05-13 12:32 ` Maxime Devos
  0 siblings, 0 replies; 2+ messages in thread
From: Maxime Devos @ 2022-05-13 12:32 UTC (permalink / raw)
  To: Christopher Baines, guile-devel

[-- Attachment #1: Type: text/plain, Size: 553 bytes --]

Christopher Baines schreef op vr 13-05-2022 om 12:51 [+0100]:
>  #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));

While we're at it, maybe IPPROTO_MPTCP, IPPROTO_DCCP, IPPROTO_UDPLITE,
IPPROTO_SCTP and IPPROTO_ICMP can be defined as well, for people using
non-TCP, non-UDP protocols? 

Greetings,
Maxime.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-05-13 12:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-13 11:51 [PATCH] socket: Add IPPROTO_IPV6 and IPV6_V6ONLY Christopher Baines
2022-05-13 12:32 ` Maxime Devos

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