From: "YOSHIFUJI Hideaki / 吉藤英明" <yoshfuji@linux-ipv6.org>
To: davem@redhat.com
Cc: netdev@oss.sgi.com, linux-kernel@vger.kernel.org,
yoshfuji@linux-ipv6.org, felix-kernel@fefe.de
Subject: Re: ipv4-mapped ipv4 connect() for UDP broken in test10
Date: Thu, 27 Nov 2003 21:11:35 +0900 (JST) [thread overview]
Message-ID: <20031127.211135.09649297.yoshfuji@linux-ipv6.org> (raw)
In-Reply-To: <20031126.190407.102714104.yoshfuji@linux-ipv6.org>
In article <20031126.190407.102714104.yoshfuji@linux-ipv6.org> (at Wed, 26 Nov 2003 19:04:07 +0900 (JST)), YOSHIFUJI Hideaki / 吉藤英明 <yoshfuji@linux-ipv6.org> says:
> (But I'm not sure this fix your problem...)
Well, let me clarify:
I'm sure the original code has a bug.
I do think that it is related to your report
(but I don't have time to confirm it.)
s6_addr[3] should be s6_addr32[3] because the code is intended to extract
IPv4 address from the IPv4-mapped address (::ffff:0.0.0.0/96)
to convert sockaddr_in6{} to sockaddr_in{}.
My analysis against the report is as follows:
Because the address is IPv4-mapped address (::ffff:0.0.0.0/96) at the point,
s6_addr[3] is always 0. The socket will be always connected to 0.0.0.0,
which means 127.0.0.1.
The patch is definitely logically correct.
Please apply this. Thanks.
===== net/ipv6/udp.c 1.54 vs edited =====
--- 1.54/net/ipv6/udp.c Tue Nov 18 11:41:56 2003
+++ edited/net/ipv6/udp.c Wed Nov 26 19:01:15 2003
@@ -825,7 +825,7 @@
struct sockaddr_in sin;
sin.sin_family = AF_INET;
sin.sin_port = sin6 ? sin6->sin6_port : inet->dport;
- sin.sin_addr.s_addr = daddr->s6_addr[3];
+ sin.sin_addr.s_addr = daddr->s6_addr32[3];
msg->msg_name = &sin;
msg->msg_namelen = sizeof(sin);
do_udp_sendmsg:
--yoshfuji
next prev parent reply other threads:[~2003-11-27 12:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-11-26 8:17 Felix von Leitner
2003-11-26 10:04 ` YOSHIFUJI Hideaki / 吉藤英明
2003-11-27 12:11 ` YOSHIFUJI Hideaki / 吉藤英明 [this message]
2003-11-28 1:03 ` David S. Miller
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=20031127.211135.09649297.yoshfuji@linux-ipv6.org \
--to=yoshfuji@linux-ipv6.org \
--cc=davem@redhat.com \
--cc=felix-kernel@fefe.de \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@oss.sgi.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®