bug in net/ipv4/af_inet.c inet_release() ?

bug in net/ipv4/af_inet.c inet_release() ?

Post by Juergen Kah » Thu, 19 Nov 1998 04:00:00


in af_inet.c, there is a comment in function inet_release():

Quote:>          * If linger is set, we don't return until the close
>          * is complete.  Otherwise we return immediately. The

It is OK to wait for completion if linger is set.
But it is not OK to return immediately otherwise.

Quote:>          * actually closing is done the same either way.
>          *
>          * If the close is due to the process exiting, we never
>          * linger..

Never linger when exiting ? Is this really accepted behaviour ?

Quote:>          */
>         timeout = 0;
>         if (sk->linger) {
>                 timeout = ~0UL;
>                 if (!sk->lingertime)
>                         timeout = jiffies + HZ*sk->lingertime;
>         }
>         if (current->flags & PF_EXITING)
>                 timeout = 0;

It looks like Linux 2.0 is behaving different from IRIX5 here.
Who is right ? I ran into much trouble this summer because of this.
IRIX5 and WinNT/Cygwin seem to always "flush" when linger is off.
I switched on lingering because Linux needed it. But this got me
into REAL trouble with WinNT/Cygwin (IRIX5 is still fine).

In the socket FAQ, Andrew Gierth says:

  If SO_LINGER has not been called on a socket, then close() is not
  supposed to discard data. This is true on SVR4.2 (and, apparently,
  on all non-SVR4 systems) but apparently not on SVR4; the use of
  either shutdown() or SO_LINGER seems to be required to guarantee
  delivery of all data.

Stevens agrees on this. But Stevens (UNP Vol1, 2nd Ed) also says on
page 188 that BSD measures linger time in 1/100 seconds while
Posix.1g measures time in seconds. This is a factor of 100 !
0.3 seconds or 5 minutes !


Juergen Kahrs                                       Tel.  0421  249 666
Millstaetter Strasse 15                             Tel.  0421  457 2819
D 28359 Bremen                                      Fax   0421  457 3578
____________ http://home.t-online.de/home/Juergen.Kahrs/ _______________


1. ipv4: move proc stuff from net/ipv4/af_inet.c to net/ipv4/proc.c

   Date: Tue, 29 Oct 2002 11:42:07 -0200 (BRDT)

        Please consider pulling from:


Pulled, thanks.

I just did a push to Linus, so this will go show up in the next round.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

2. WebSite connections monitoring

3. net/ipv4/af_inet.c: remove include seq_file.h and proc_fs.h, not needed anymore

4. Welcome to OpenBSD discussion boards, forums

5. [ipv4] move proc init to newly created net/ipv4/ip_proc.c

6. Radeon8500 / Redhat 7.2 / XFree 4.2.0

7. ipv4 /proc/net/route bug in 2.4 and 2.5 kernels

8. New version of Linux-Gnu for the Alpha not working

9. Bug in net/ipv4/udp.c (Linux 2.1)

10. Bug fix kernel 2.0.30 for alpha (net/ipv4/ip_fw.c)

11. move /proc/net/udp support back to net/ipv4/udp.c

12. Patch?: linux-2.5.45/net - __secpath_destroy made net depend on ipv4

13. net/ipv4/*, net/core/neighbour.c jiffies cleanup