From: Neil H. <nh...@tu...> - 2008-08-22 19:39:07
|
On Fri, Aug 22, 2008 at 07:39:18PM +0200, Florian Niederbacher wrote: > Hi, > is there a problem with bind() and sctp_bindx or do I missing something? > > If I make bind() with INADDR_ANY all local addresses are bound and if I > try then to remove an existing one with sctp_bindx() I get always: > device or resource busy. > Adding local addresses first with sctp_bindx() works and then I can also > remove existing addresses, how it should be. It would be convenient if > first all local addresses were bound and the only some of the removed. > Maybe. sctp_bind (reached via a user space bind() call), adds INADDR_ANY to the address list for a given endpoint. sctp_del_bind_addr (reachable via sctp_bindx on a remove operation, looks for an exact match for the address being removed. It returns -EINVAL if not found, but that might get munged to EBUSY somewhere, or it might have done something else previously. Either way, you won't get an exact match on bindx remove if you bind to INADDR_ANY. As for what the right thing to do is, I'm not sure. I can see the argument being made for understanding the intent of adding all interfaces, and then removing some of them (providing a blacklist instead of a whitelist), but then again, you never bindx added an interface, why should you successfully be able to remove it? Given that sctp_bindx lets you specify a list of addresses in one call, I'm inclined to believe the latter. Although perhaps there is room in the spec to define a behavior such that calling sctp_bindx with one address specifying INADDR_ANY (rather than using bind()) can product the desired behavior. Vlad? Regards Neil -- /**************************************************** * Neil Horman <nh...@tu...> * Software Engineer, Red Hat ****************************************************/ |