[erlang-bugs] : [BUG] SCTP_ADDR_CONFIRMED event not handled

Raimo Niskanen raimo+erlang-bugs@REDACTED
Fri May 9 16:45:22 CEST 2008


On Tue, Apr 15, 2008 at 01:20:51PM +0200, Balint Reczey wrote:
> Hi,
> 
> Sergei Golovan updated the patch, now it builds with older lksctp-tools
> without SCTP_ADDR_CONFIRMED definition, too:
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=475540#10
> 
> Regards,
> Balint
> 

I can confirm that his patch looks almost exactly as
what I have running in our daily builds now, except that
I do not have to patch erts/config.h.in since it is an
autoconf build result here, and I did not bother to
conditionalize the definition and initialization of
am_addr_confirmed in erts/emulator/drivers/common/inet_drv.c,
which should not matter at all.



Patch by Balint Reczey <balint@REDACTED> adds SCTP_ADDR_CONFIRMED
SCTP_PEER_ADDR_CHANGE event to Erlang API.

Patch is modified by Sergei Golovan to work only with older SCTP also.

--- erlang-12.b.2.orig/bootstrap/lib/kernel/include/inet_sctp.hrl
+++ erlang-12.b.2/bootstrap/lib/kernel/include/inet_sctp.hrl
@@ -73,7 +73,7 @@
 %% sctp_paddr_change: Peer address is a list. Possible "state" values:
 %%			addr_available, addr_unreachable,
 %%			addr_removed,   addr_added,
-%%			addr_made_prim
+%%			addr_made_prim, addr_confirmed
 -record(sctp_paddr_change,
 	{
 	  addr	    = [0,0,0,0],
--- erlang-12.b.2.orig/erts/config.h.in
+++ erlang-12.b.2/erts/config.h.in
@@ -160,6 +160,10 @@
 /* Define to 1 if you have the declaration of `SCTP_UNORDERED', and to 0 if
    you don't. */
 #undef HAVE_DECL_SCTP_UNORDERED
+
+/* Define to 1 if you have the declaration of `SCTP_ADDR_CONFIRMED', and to 0 if
+   you don't. */
+#undef HAVE_DECL_SCTP_ADDR_CONFIRMED
 
 /* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
    */
--- erlang-12.b.2.orig/erts/configure.in
+++ erlang-12.b.2/erts/configure.in
@@ -1115,7 +1115,7 @@
 	 #endif
 	])
     AC_CHECK_DECLS([SCTP_UNORDERED, SCTP_ADDR_OVER, SCTP_ABORT,
-                    SCTP_EOF, SCTP_SENDALL], [], [],
+                    SCTP_EOF, SCTP_SENDALL, SCTP_ADDR_CONFIRMED], [], [],
         [#if HAVE_SYS_SOCKET_H
          #include <sys/socket.h>
          #endif
--- erlang-12.b.2.orig/erts/emulator/drivers/common/inet_drv.c
+++ erlang-12.b.2/erts/emulator/drivers/common/inet_drv.c
@@ -2752,7 +2752,10 @@
     /* For #sctp_paddr_change{}: */
     am_addr_available,                 am_addr_unreachable, 
     am_addr_removed,                   am_addr_added,
-    am_addr_made_prim,
+    am_addr_made_prim,
+#if HAVE_DECL_SCTP_ADDR_CONFIRMED
+    am_addr_confirmed,
+#endif
     
     /* For #sctp_remote_error{}: */
     am_short_recv,                     am_wrong_anc_data,
@@ -3007,6 +3010,11 @@
 	    case SCTP_ADDR_MADE_PRIM:
 		i = LOAD_ATOM (spec, i, am_addr_made_prim);
 		break;
+#if HAVE_DECL_SCTP_ADDR_CONFIRMED
+	    case SCTP_ADDR_CONFIRMED:
+		i = LOAD_ATOM (spec, i, am_addr_confirmed);
+		break;
+#endif
 	    default:
 		ASSERT(0);
 	    }
@@ -3840,6 +3848,9 @@
     INIT_ATOM(addr_removed);
     INIT_ATOM(addr_added);
     INIT_ATOM(addr_made_prim);
+#if HAVE_DECL_SCTP_ADDR_CONFIRMED
+    INIT_ATOM(addr_confirmed);
+#endif
     
     INIT_ATOM(short_recv);
     INIT_ATOM(wrong_anc_data);
--- erlang-12.b.2.orig/lib/kernel/include/inet_sctp.hrl
+++ erlang-12.b.2/lib/kernel/include/inet_sctp.hrl
@@ -73,7 +73,7 @@
 %% sctp_paddr_change: Peer address is a list. Possible "state" values:
 %%			addr_available, addr_unreachable,
 %%			addr_removed,   addr_added,
-%%			addr_made_prim
+%%			addr_made_prim, addr_confirmed
 -record(sctp_paddr_change,
 	{
 	  addr	    = [0,0,0,0],

-- 

/ Raimo Niskanen, Erlang/OTP, Ericsson AB



More information about the erlang-bugs mailing list