Detection of connection abort during accept

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Hi all,

Consider the following scenario in a userspace app, while
establishing a tcp connection.

1. SYN, SYN/ACK, ACK            (connection accepted)
2. select/poll wakes up  
3. RST arrives                  (connection aborted)
4. user calls accept()

Under Linux accept won't fail with ECONNABORTED, but sockaddr
will be filled with garbage (or be not filled in at all).

What is the correct way to detect this scenario? Checking the
contents of sockaddr for sa_len == 0 or sa_family == 0 or
calling getsockopt (fd, SOL_SOCKET, SO_ERROR, ...)?

-Udo.
-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux