From: Fabienne Ducroquet <fabiduc@gmail.com>
To: Marcus Meissner <meissner@suse.de>
Cc: sundell.software@gmail.com, Reinhard Max <max@suse.de>,
"David S. Miller" <davem@davemloft.net>,
netdev@vger.kernel.org
Subject: net/ipv4: commit d0733d2e29b breaks rtorrent
Date: Wed, 22 Jun 2011 14:40:45 +0200 [thread overview]
Message-ID: <20110622124045.GA3247@localhost> (raw)
Hi,
With the latest versions of the Linux kernel (I've just tried
3.0.0-rc4-00034-g2992c4b) rtorrent (version 0.8.7 with libtorrent
0.12.7, from Debian unstable) fails to start with the error message:
rtorrent: Could not open/bind port for listening: Invalid argument
I bisected it down to:
commit d0733d2e29b652b2e7b1438ececa732e4eed98eb
Author: Marcus Meissner <meissner@suse.de>
Date: Wed Jun 1 21:05:22 2011 -0700
net/ipv4: Check for mistakenly passed in non-IPv4 address
Check against mistakenly passing in IPv6 addresses (which would result
in an INADDR_ANY bind) or similar incompatible sockaddrs.
Signed-off-by: Marcus Meissner <meissner@suse.de>
Cc: Reinhard Max <max@suse.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
net/ipv4/af_inet.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index cc14631..9c19260 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -465,6 +465,9 @@ int inet_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
if (addr_len < sizeof(struct sockaddr_in))
goto out;
+ if (addr->sin_family != AF_INET)
+ goto out;
+
chk_addr_ret = inet_addr_type(sock_net(sk), addr->sin_addr.s_addr);
/* Not specified by any standard per-se, however it breaks too
With this commit reverted rtorrent works again.
Fabienne
next reply other threads:[~2011-06-22 12:50 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-22 12:40 Fabienne Ducroquet [this message]
2011-06-22 12:47 ` net/ipv4: commit d0733d2e29b breaks rtorrent Marcus Meissner
2011-06-22 13:24 ` Reinhard Max
2011-06-22 14:51 ` Fabienne Ducroquet
2011-06-22 14:58 ` Reinhard Max
2011-06-22 15:53 ` Stephen Hemminger
2011-06-22 23:02 ` Fabienne Ducroquet
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110622124045.GA3247@localhost \
--to=fabiduc@gmail.com \
--cc=davem@davemloft.net \
--cc=max@suse.de \
--cc=meissner@suse.de \
--cc=netdev@vger.kernel.org \
--cc=sundell.software@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.