Hi Sergei,
I tested the patch and it seems to work fine.

The only problem i have with it is that if we compile OTP on an older
Linux kernel, and we run it on a recent one, we still can't expert
SCTP to work perfectly.

That problem does not affect sid or Lenny, but Etch has an older
kernel by default, so Etch users with newer kernels and backported
erlang may be affected.

The OTP guys also said that they use older kernels so their prebuilt
erlang will not work with newer kernels if they use your patch.
My first patch is worse, it won't even build with old kernels . :-)

So propose to define the missing SCTP_ADDR_CONFIRMED value when
compiling on older kernels. The attached patch works on Linux and
FreeBSD and will probably work with other OS-es, too.

Regards,
Balint

2008/4/11, Sergei Golovan <[EMAIL PROTECTED]>:
> On 4/11/08, "Bálint Réczey" <[EMAIL PROTECTED]> wrote:
>  >
>  >  A new SCTP_PEER_ADDR_CHANGE event named SCTP_ADDR_CONFIRMED was
>  >  introduced in draft-ietf-tsvwg-sctpsocket-13.txt.
>  >
>  >  It is implemented in the Linux kernel in post-2.6.21 versions
>  >  (commit 1ae4114dce35dd1d32ed847f60b599dbbdfd5829).
>  >
>  >  The attached patch maps the new event to the Erlang SCTP API.
>
>  I've slightly modified the patch (to keep it working with older SCTP).
>  Could you test it, and if it's OK I'll include it into the next
>  upload?
>
>  
> http://svn.berlios.de/viewcvs/erlang-pkg/erlang/trunk/debian/patches/sctp_addr_confirmed.diff?rev=737&view=log
>
>  --
>
> Sergei Golovan
>


-- 
Interri Kft. - http://hu.interri.com
8242 Balatonudvari, Kossuth Lajos u. 1.
19-09-509872, Veszprém Megyei Bíróság mint Cégbíróság
diff -Naur otp_src_R12B-1-notpatched/bootstrap/lib/kernel/include/inet_sctp.hrl otp_src_R12B-1/bootstrap/lib/kernel/include/inet_sctp.hrl
--- otp_src_R12B-1-notpatched/bootstrap/lib/kernel/include/inet_sctp.hrl	2008-04-14 11:43:16.000000000 +0200
+++ otp_src_R12B-1/bootstrap/lib/kernel/include/inet_sctp.hrl	2008-04-14 13:13:35.000000000 +0200
@@ -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],
diff -Naur otp_src_R12B-1-notpatched/debian/changelog otp_src_R12B-1/debian/changelog
--- otp_src_R12B-1-notpatched/debian/changelog	2008-04-14 11:42:27.000000000 +0200
+++ otp_src_R12B-1/debian/changelog	2008-04-14 13:13:35.000000000 +0200
@@ -1,3 +1,9 @@
+erlang (1:12.b.1-dfsg-3.99rbalint2) unstable; urgency=low
+
+  * applied otp-sctp-addr-confirmed-2.patch
+
+ -- Balint Reczey <[EMAIL PROTECTED]>  Mon, 14 Apr 2008 11:59:22 +0200
+
 erlang (1:12.b.1-dfsg-3.99rbalint1) unstable; urgency=low
 
   * applied otp-sctp-addr-confirmed.patch
diff -Naur otp_src_R12B-1-notpatched/erts/emulator/drivers/common/inet_drv.c otp_src_R12B-1/erts/emulator/drivers/common/inet_drv.c
--- otp_src_R12B-1-notpatched/erts/emulator/drivers/common/inet_drv.c	2008-04-14 11:43:16.000000000 +0200
+++ otp_src_R12B-1/erts/emulator/drivers/common/inet_drv.c	2008-04-14 13:15:30.000000000 +0200
@@ -280,6 +280,21 @@
 #     define    SCTP_EOF        MSG_EOF
 #endif
 
+/* This is introduced in draft 13, we define it to be compatible with 2.6.22
+   and later Linux kernels even when we are compiling on 2.6.21 or older.
+   We would like to have the same kind of forward compatibility for FreeBSD,
+   too.
+ */
+#if ! HAVE_DECL_SCTP_ADDR_CONFIRMED
+#if defined(__linux__)
+#     define    SCTP_ADDR_CONFIRMED  5
+#elif defined(__FreeBSD__)
+#     define    SCTP_ADDR_CONFIRMED  0x0006
+#else /* other SCTP implementation will probably work with that define */
+#     define    SCTP_ADDR_CONFIRMED  SCTP_ADDR_MADE_PRIM+1
+#endif
+#endif
+
 /* New spelling in lksctp 2.6.22 or maybe even earlier:
  *  adaption -> adaptation
  */
@@ -2752,7 +2767,7 @@
     /* For #sctp_paddr_change{}: */
     am_addr_available,                 am_addr_unreachable, 
     am_addr_removed,                   am_addr_added,
-    am_addr_made_prim,
+    am_addr_made_prim,                 am_addr_confirmed,
     
     /* For #sctp_remote_error{}: */
     am_short_recv,                     am_wrong_anc_data,
@@ -3007,6 +3022,9 @@
 	    case SCTP_ADDR_MADE_PRIM:
 		i = LOAD_ATOM (spec, i, am_addr_made_prim);
 		break;
+	    case SCTP_ADDR_CONFIRMED:
+		i = LOAD_ATOM (spec, i, am_addr_confirmed);
+		break;
 	    default:
 		ASSERT(0);
 	    }
@@ -3840,6 +3858,7 @@
     INIT_ATOM(addr_removed);
     INIT_ATOM(addr_added);
     INIT_ATOM(addr_made_prim);
+    INIT_ATOM(addr_confirmed);
     
     INIT_ATOM(short_recv);
     INIT_ATOM(wrong_anc_data);
diff -Naur otp_src_R12B-1-notpatched/lib/kernel/include/inet_sctp.hrl otp_src_R12B-1/lib/kernel/include/inet_sctp.hrl
--- otp_src_R12B-1-notpatched/lib/kernel/include/inet_sctp.hrl	2008-04-14 11:43:16.000000000 +0200
+++ otp_src_R12B-1/lib/kernel/include/inet_sctp.hrl	2008-04-14 13:13:35.000000000 +0200
@@ -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],

Reply via email to