public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] netfilter: nf_sockopt_find() should return ERESTARTSYS
@ 2014-07-23 22:53 Eric Dumazet
  2014-07-24 17:19 ` Patrick McHardy
  0 siblings, 1 reply; 6+ messages in thread
From: Eric Dumazet @ 2014-07-23 22:53 UTC (permalink / raw)
  To: Pablo Neira Ayuso, David Miller; +Cc: netdev, netfilter-devel

From: Eric Dumazet <edumazet@google.com>

getsockopt() or setsockopt() sometimes returns -EINTR instead of
-ENOPROTOOPT, causing headaches to application developers.

This is because unsupported commands might go through nf_sockopt_find()
and this function returns -EINTR instead of -ERESTARTSYS if
a signal is pending.

Signed-off-by: Eric Dumazet <edumazet@google.com>
---
 net/netfilter/nf_sockopt.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/netfilter/nf_sockopt.c b/net/netfilter/nf_sockopt.c
index f042ae521557..37181447715b 100644
--- a/net/netfilter/nf_sockopt.c
+++ b/net/netfilter/nf_sockopt.c
@@ -66,7 +66,7 @@ static struct nf_sockopt_ops *nf_sockopt_find(struct sock *sk, u_int8_t pf,
 	struct nf_sockopt_ops *ops;
 
 	if (mutex_lock_interruptible(&nf_sockopt_mutex) != 0)
-		return ERR_PTR(-EINTR);
+		return ERR_PTR(-ERESTARTSYS);
 
 	list_for_each_entry(ops, &nf_sockopts, list) {
 		if (ops->pf == pf) {



^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-07-31 11:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-23 22:53 [PATCH] netfilter: nf_sockopt_find() should return ERESTARTSYS Eric Dumazet
2014-07-24 17:19 ` Patrick McHardy
2014-07-24 20:35   ` Eric Dumazet
2014-07-24 20:41   ` [PATCH v2] netfilter: nf_sockopt_find() / nf_register_sockopt() should not return EINTR Eric Dumazet
2014-07-31 10:55     ` Pablo Neira Ayuso
2014-07-31 11:05       ` Patrick McHardy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox