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

Raimo Niskanen raimo+erlang-bugs@REDACTED
Tue Apr 14 12:31:05 CEST 2009


Thank you very much for the patch.

Alas, (due to customer demands), we had a very short time
between R13A and R13B, so you just missed the deadline, or
rather Giacomo Olgeni's patch was too risky to take now.
I want to remake his patch to a configure test for
sctp_bindx in libc (without linking with libsctp) instead
of a compile test for __FreeBSD__; I hate OS version tests,
they always come back and bite you.

But now we have a virtual FreeBSD 7.1 machine, so we will 
enable SCTP on its daily builds (and hence apply your patches)
as soon as possible. Check out the snapshots.



On Sun, Apr 12, 2009 at 01:12:45PM +0900, Kenji Rikitake wrote:
> 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: */
> _______________________________________________
> erlang-bugs mailing list
> erlang-bugs@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-bugs

-- 

/ Raimo Niskanen, Erlang/OTP, Ericsson AB



More information about the erlang-bugs mailing list