Description: SDLNet_UDP_Bind does not behave as described Original bug report: The comment, which is the same as in the header file, describes one behaviour. The code implements another: if channel is -1, it binds to the first channel that has not yet been bound to the maximum number of addresses. The if (binding->numbound... line should be just if ( binding->numbound) { (i.e. choose an unused channel). (Although this may break any apps using the incorrect behaviour.) . Debian changelog: * Changed comment for SDLNet_UDP_Bind to reflect implementation - Since upstream has not responded to this (and seems dead), and a fair number of packages use sdl-net, I don't want to change the behavior just for debian, only properly document the actual behavior. - (Closes: 211570) Author: cph@cph.demon.co.uk Last-Update: 2003-09-18 Bug-Debian: http://bugs.debian.org/211570 --- a/SDL_net.h +++ b/SDL_net.h @@ -200,7 +200,8 @@ extern DECLSPEC void SDLCALL SDLNet_UDP_SetPacketLoss(UDPsocket sock, int percent); /* Bind the address 'address' to the requested channel on the UDP socket. - If the channel is -1, then the first unbound channel will be bound with + If the channel is -1, then the first unbound channel that has not yet + been bound to the maximum number of addresses will be bound with the given address as it's primary address. If the channel is already bound, this new address will be added to the list of valid source addresses for packets arriving on the channel. --- a/SDLnetUDP.c +++ b/SDLnetUDP.c @@ -246,7 +246,8 @@ } /* Bind the address 'address' to the requested channel on the UDP socket. - If the channel is -1, then the first unbound channel will be bound with + If the channel is -1, then the first unbound channel that has not yet + been bound to the maximum number of addresses will be bound with the given address as it's primary address. If the channel is already bound, this new address will be added to the list of valid source addresses for packets arriving on the channel.