The difference between sk_err_soft and sk_err

Simon Liu simohayha.bobo at gmail.com
Tue Feb 15 08:40:28 EST 2011


Hi all.

I read kernel's source, there is sk_err_soft and sk_err  in struct sock.
this is their comment:

  * @sk_err: last error
  * @sk_err_soft: errors that don't cause failure but are the cause of a
  *      persistent failure not just 'timed out'

this make me confuse, why need sk_err_soft?

I search linux kernel tree, and find use sk_err_soft  in ICMP module.

after that in man 2 connect :

EINPROGRESS
              The socket is nonblocking and the connection cannot be
completed immediately.  It is possible to select(2) or  poll(2)  for
 completion  by
              selecting the socket for writing.  After select(2) indicates
writability, use getsockopt(2) to read the SO_ERROR option at level
SOL_SOCKET
              to determine whether connect() completed successfully
(SO_ERROR is zero) or unsuccessfully (SO_ERROR is one of the usual error
codes listed
              here, explaining the reason for the failure).

i know SO_ERROR will detect sk_err_soft and sk_err,  further more there is
not detect sk_err_soft in tcp_poll.  my question is why not return EPOLLERR
in tcp_poll( detect sk_err_soft).

Thank!


-- 
博观约取

豆瓣:www.douban.com/people/mustang/

blog: www.pagefault.info

twitter: www.twitter.com/minibobo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20110215/850f7f2e/attachment.html 


More information about the Kernelnewbies mailing list