[erlang-patches] R13A patch for erts/emulator/drivers/common/inet_drv.c

Kenji Rikitake kenji.rikitake@REDACTED
Sun Apr 12 06:12:45 CEST 2009


This is a patch for compiling Erlang R13A on FreeBSD 7.1-RELEASE.
Note that I apply all Giacomo's patches for Erlang R12B5
(available on FreeBSD port lang/erlang) BEFORE applying
this patch.

Kenji Rikitake

R13A patch for solving a compilation error when building
erts/emulator/drivers/common/inet_drv.c
by Kenji Rikitake 12-APR-2009

Symptom:

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.

Workaround: apply the following patch.

NOTE: this is a followup patch of Giacomo Olgeni's patch for FreeBSD at:

http://www.freebsd.org/cgi/cvsweb.cgi/~checkout~/ports/lang/erlang/files/patch-erts_emulator_drivers_common_inet__drv.c?rev=1.1;content-type=text%2Fplain

so Giacomo's patch must be applied before this patch to compile.

--- erts/emulator/drivers/common/inet_drv.c.FCS	2009-04-12 12:16:52.000000000 +0900
+++ erts/emulator/drivers/common/inet_drv.c	2009-04-12 12:36:06.000000000 +0900
@@ -5301,16 +5301,19 @@
 	    if (pmtud_enable && pmtud_disable)
 		return -1;
 	    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
 	    curr += 4;
 
@@ -6207,17 +6210,19 @@
 	    if (ap.spp_flags & SPP_PMTUD_ENABLE)
 		{ i = LOAD_ATOM (spec, i, am_pmtud_enable);          n++; }
 	    
 	    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,
 		      LOAD_NIL_CNT + LOAD_LIST_CNT + 2*LOAD_TUPLE_CNT);
 	    
 	    /* Close up the Flags list: */



More information about the erlang-patches mailing list