From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Liping Zhang <zlpnobody@163.com>, davem@davemloft.net
Cc: netdev@vger.kernel.org, Liping Zhang <liping.zhang@spreadtrum.com>
Subject: Re: [PATCH] net: socket: return a proper error code when source address becomes nonlocal
Date: Mon, 4 Apr 2016 15:55:34 +0300 [thread overview]
Message-ID: <57026446.1010801@cogentembedded.com> (raw)
In-Reply-To: <1459753769-4290-1-git-send-email-zlpnobody@163.com>
Hello.
On 4/4/2016 10:09 AM, Liping Zhang wrote:
> From: Liping Zhang <liping.zhang@spreadtrum.com>
>
> 1. Socket can use bind(directly) or connect(indirectly) to bind to a local
> ip address, and later if the network becomes down, that cause the source
> address becomes nonlocal, then send() call will fail and return EINVAL.
> But this error code is confusing, acctually we did not pass any invalid
> arguments. Furthermore, send() maybe return ok at first, it now returns
> fail just because of a temporary network problem, i.e. when the network
> recovery, send() call will become ok. Return EADDRNOTAVAIL instead of
> EINVAL in such situation is better.
> 2. We can use IPV6_PKTINFO to specify the ipv6 source address when call
> sendmsg() to send packet, but if the address is not available, call will
> fail and EINVAL is returned. This error code is not very appropriate,
> it failed maybe just because of a temporary network problem. Also
> RFC3542, section 6.6 describe an example returns EADDRNOTAVAIL:
> "ipi6_ifindex specifies an interface but the address ipi6_addr is not
> available for use on that interface.". So return EADDRNOTAVAIL instead
> of EINVAL here.
>
> Signed-off-by: Liping Zhang <liping.zhang@spreadtrum.com>
I think this should be 2 patches as you seem to fix 2 separate problems.
[...]
MBR, Sergei
prev parent reply other threads:[~2016-04-04 12:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-04 7:09 [PATCH] net: socket: return a proper error code when source address becomes nonlocal Liping Zhang
2016-04-04 12:55 ` Sergei Shtylyov [this message]
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=57026446.1010801@cogentembedded.com \
--to=sergei.shtylyov@cogentembedded.com \
--cc=davem@davemloft.net \
--cc=liping.zhang@spreadtrum.com \
--cc=netdev@vger.kernel.org \
--cc=zlpnobody@163.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.