From 8fae2bf483d801d7fcc7bb918e27868b0d31a035 Mon Sep 17 00:00:00 2001 From: Kevin Ryde Date: Sun, 23 Oct 2005 21:35:01 +0000 Subject: [PATCH] (scm_init_socket): Add IPPROTO_IP, IPPROTO_TCP, IPPROTO_UDP. Remove SOL_IP, SOL_TCP, SOL_UDP. The former are in POSIX spec examples, the latter are not available on for instance NetBSD. --- libguile/socket.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/libguile/socket.c b/libguile/socket.c index 28833df8f..6dfc80035 100644 --- a/libguile/socket.c +++ b/libguile/socket.c @@ -1341,18 +1341,25 @@ scm_init_socket () scm_c_define ("SOCK_RDM", scm_from_int (SOCK_RDM)); #endif - /* setsockopt level. */ + /* setsockopt level. + + SOL_IP, SOL_TCP and SOL_UDP are defined on gnu/linux, but not on for + instance NetBSD. We define IPPROTOs because that's what the posix spec + shows in its example at + + http://www.opengroup.org/onlinepubs/007904975/functions/getsockopt.html + */ #ifdef SOL_SOCKET scm_c_define ("SOL_SOCKET", scm_from_int (SOL_SOCKET)); #endif -#ifdef SOL_IP - scm_c_define ("SOL_IP", scm_from_int (SOL_IP)); +#ifdef IPPROTO_IP + scm_c_define ("IPPROTO_IP", scm_from_int (IPPROTO_IP)); #endif -#ifdef SOL_TCP - scm_c_define ("SOL_TCP", scm_from_int (SOL_TCP)); +#ifdef IPPROTO_TCP + scm_c_define ("IPPROTO_TCP", scm_from_int (IPPROTO_TCP)); #endif -#ifdef SOL_UDP - scm_c_define ("SOL_UDP", scm_from_int (SOL_UDP)); +#ifdef IPPROTO_UDP + scm_c_define ("IPPROTO_UDP", scm_from_int (IPPROTO_UDP)); #endif /* setsockopt names. */