- From: Michael Tüxen <Michael.Tuexen AT micmac.franken.de>
- To: Amedeo Bonfiglio <amedeob AT prisma-eng.com>
- Cc: sctp-discussion AT sctp.de
- Subject: Re: [SCTP-Discussion] problems registering sctp instances using the same port
- Date: Thu, 21 Jan 2010 15:49:46 +0100
- List-archive: <http://lists.franken.de/pipermail/sctp-discussion>
- List-id: SCTP Discussions <sctp-discussion.sctp.de>
On Jan 18, 2010, at 2:33 PM, Amedeo Bonfiglio wrote:
>
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.
This does not violate the specification... It is a limitation of the
implementation.
This is done on purpose to keep things simple...
Best regards
Michael
>
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
>
>
_______________________________________________
>
sctp-discussion mailing list
>
sctp-discussion AT sctp.de
>
http://www.sctp.de/mailman/listinfo/sctp-discussion
>
Archive powered by MHonArc 2.6.19+.