Re: Linux RedHat 6.x bug: IPv4/UDP bind() allocates same port number by

Dan Kegel (dank@alumni.caltech.edu)
Tue, 16 Nov 1999 09:20:18 -0800


Lars Marowsky-Bree wrote:
> Dan Kegel <dank@alumni.caltech.edu> said:
>
> > Having written user-mode connection-oriented
> > UDP stuff myself, I know that this would be annoying.
> > When you kill and restart a program, the other side can notice
> > you have the wrong sequence number, and do a reset, but that's
> > hard to debug; it's safer to use a different port number for
> > each instance of the program.
>
> UDP is stateless. The behaviour is not specified. If your application cannot
> cope with this, your application has a bug.
>
> If you rely on changing port numbers, what do you do if you are using up the
> port number space too quickly, get a wrap, and accidentially assign the same
> port number again, but your application relied on the fact that this can't
> happen? Now THATS a bug hard to trace.

I agree, the application has a bug.

It should at least notice the re-use,
if not deal with it totally gracefully.

It's somewhat painful for Linux to be the OS that
exposes the bugs in applications, though.
Why not sweep them under the carpet, if it's easy?

Pragmatically yours,
Dan

-- 
(The above is just my personal opinion; I don't speak for my employer,
 except on the occasional talk show.)

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/