SCTP Discussions

Text archives Help


[SCTP-Discussion] problems registering sctp instances using the same port


Chronological Thread 
  • From: Amedeo Bonfiglio <amedeob AT prisma-eng.com>
  • To: sctp-discussion AT sctp.de
  • Subject: [SCTP-Discussion] problems registering sctp instances using the same port
  • Date: Mon, 18 Jan 2010 14:33:08 +0100
  • List-archive: <http://lists.franken.de/pipermail/sctp-discussion>
  • List-id: SCTP Discussions <sctp-discussion.sctp.de>

Hi all,
using sctplib-1.0.9 I found that it is not possible to register two sctp instances using the same port number, but different ip addresses.
This violates the SCTP specification, and so I fixed it modifying the file disribution.c.
I implemented a quick&dirt solution in order to go ahead with my tests.
NOTE: my solution is not really correct because I have removed any check about seizedPorts, while I should check for unique <port/ip> pairs.
Nevertheless, below is the output of 'diff distribution.c distribuion.c-fixed'

269c269
< static unsigned char portsSeized[0x10000];
---
> static char portsSeized[0x10000]; //Amedeo: see comment at allocatePort()
626,631c626,631
< if(portsSeized[port] == 0) {
< portsSeized[port] = 1;
< numberOfSeizedPorts++;
< return(port);
< }
< return(0);
---
> //Amedeo - Fix in order to allow to register two sctp instances using different IPs, but same port.
> // This fix is error-prone because it never checks if a port is avaiable or
> // not. A more complete fix must handle unique <ip/port> pairs.
> portsSeized[port]++;
> numberOfSeizedPorts++;
> return(port);
654c654
< portsSeized[seizePort] = 1;
---
> portsSeized[seizePort]++; //Amedeo: see comment at allocatePort()
672c672,676
< portsSeized[portSeized] = 0;
---
> if ( portsSeized[portSeized] < 0 ) //Amedeo: see comment at allocatePort()
> {
> portsSeized[portSeized] = 0;
> error_log(ERROR_MINOR, "Warning: releasePort - reset to 0");
> }


Kind regards,
Amedeo





Archive powered by MHonArc 2.6.19+.

Top of page