From 989fa5de1889c3fd09e9b5e25c244e2a855bf0b5 Mon Sep 17 00:00:00 2001 From: Kenji Rikitake Date: Wed, 10 Feb 2010 22:44:30 +0859 Subject: Fix building error of SCTP in FreeBSD 7.1 and later This patch fixes building error of SCTP in FreeBSD 7.1 and later. See http://www.erlang.org/cgi-bin/ezmlm-cgi?2:mss:1257:200904:hppnfialjjdlgecdiehe for the details. R13A patch for solving a compilation error when building erts/emulator/drivers/common/inet_drv.c by Kenji Rikitake 12-APR-2009 Symptom solved by this patch: When building R13A in FreeBSD 7.1-RELEASE, the compiler flag HAVE_STRUCT_SCTP_PADDRPARAMS_SPP_SACKDELAY is NOT enabled. Some code in erts/emulator/drivers/common/inet_drv.c incorrectly assumes HAVE_STRUCT_SCTP_PADDRPARAMS_SPP_SACKDELAY is always true when HAVE_STRUCT_SCTP_PADDRPARAMS_SPP_FLAGS is true in config.h. This assumption causes a compilation error. --- erts/emulator/drivers/common/inet_drv.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'erts') diff --git a/erts/emulator/drivers/common/inet_drv.c b/erts/emulator/drivers/common/inet_drv.c index 3de48194fb..493ebec6b9 100644 --- a/erts/emulator/drivers/common/inet_drv.c +++ b/erts/emulator/drivers/common/inet_drv.c @@ -5293,12 +5293,15 @@ static int sctp_set_opts(inet_descriptor* desc, char* ptr, int len) if (pmtud_enable) cflags |= SPP_PMTUD_ENABLE; if (pmtud_disable) cflags |= SPP_PMTUD_DISABLE; +# ifdef HAVE_STRUCT_SCTP_PADDRPARAMS_SPP_SACKDELAY + /* The followings are missing in FreeBSD 7.1 */ sackdelay_enable =eflags& SCTP_FLAG_SACDELAY_ENABLE; sackdelay_disable=eflags& SCTP_FLAG_SACDELAY_DISABLE; if (sackdelay_enable && sackdelay_disable) return -1; if (sackdelay_enable) cflags |= SPP_SACKDELAY_ENABLE; if (sackdelay_disable) cflags |= SPP_SACKDELAY_DISABLE; +# endif arg.pap.spp_flags = cflags; # endif @@ -6199,12 +6202,14 @@ static int sctp_fill_opts(inet_descriptor* desc, char* buf, int buflen, if (ap.spp_flags & SPP_PMTUD_DISABLE) { i = LOAD_ATOM (spec, i, am_pmtud_disable); n++; } - +# ifdef HAVE_STRUCT_SCTP_PADDRPARAMS_SPP_SACKDELAY + /* SPP_SACKDELAY_* not in FreeBSD 7.1 */ if (ap.spp_flags & SPP_SACKDELAY_ENABLE) { i = LOAD_ATOM (spec, i, am_sackdelay_enable); n++; } if (ap.spp_flags & SPP_SACKDELAY_DISABLE) { i = LOAD_ATOM (spec, i, am_sackdelay_disable); n++; } +# endif # endif PLACE_FOR(spec, i, -- cgit v1.2.3