All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lorenzo Colitti <lorenzo@google.com>
To: Lorenzo Colitti <lorenzo@google.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>,
	David Miller <davem@davemloft.net>,
	Eric Dumazet <eric.dumazet@gmail.com>
Subject: Re: [PATCH net-next v4 1/3] net: ipv6: Unduplicate {raw,udp}v6_sendmsg code
Date: Fri, 25 Apr 2014 20:09:49 +0900	[thread overview]
Message-ID: <CAKD1Yr0MoyjBwUVG+Bjf5D-k0-JkvzOL3mDaNtjF4rUeWJ21Ew@mail.gmail.com> (raw)
In-Reply-To: <20140424154305.GI1960@order.stressinduktion.org>

On Fri, Apr 25, 2014 at 12:43 AM, Hannes Frederic Sowa
<hannes@stressinduktion.org> wrote:
>> I wonder, is it better to just initialize dontfrag to np->dontfrag
>> instead of -1 in the caller? ip6_datagram_send_ctl seems to just
>> overwrite dontfrag with whatever comes from userspace, so nobody ever
>> checks that it's < 0.
>
> Yes, that is what I had in mind. So we must not reset dontfrag to -1 in
> datagram_common_send and leave the check just after do_append_data as is.

Thinking about it some more, it seems that that might be confusing as
well. Someone might trip up over it again - it's already happened
twice.

Instead, I've moved the initialization back into
ip6_datagram_send_common, so the variables are now obviously
uninitialized in the callers, and in udpv6_sendmsg I explicitly set
hlimit and tclass to -1, and dontfrag to np->dontfrag, before the goto
do_append data. That way, if the goto is taken, it's immediately
obvious that the variables are being set, and if it's not, it's clear
that they are uninitialized and being set in ip6_datagram_send_common.

      reply	other threads:[~2014-04-25 11:10 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-22  8:13 [PATCH net-next 1/3] net: ipv6: unduplicate {raw,udp}v6_sendmsg code Lorenzo Colitti
2014-04-22  8:13 ` [PATCH net-next 2/3] net: ipv6: Use ip6_datagram_send_common in L2TP IPv6 Lorenzo Colitti
2014-04-22  8:13 ` [PATCH net-next 3/3] net: ipv6: Use ip6_datagram_send_common in ping Lorenzo Colitti
2014-04-22  9:06 ` [PATCH net-next 1/3] net: ipv6: unduplicate {raw,udp}v6_sendmsg code YOSHIFUJI Hideaki
2014-04-22  9:38 ` [PATCH net-next v2 " Lorenzo Colitti
2014-04-22  9:38   ` [PATCH net-next v2 2/3] net: ipv6: Use ip6_datagram_send_common in L2TP IPv6 Lorenzo Colitti
2014-04-22 14:23     ` Eric Dumazet
2014-04-22 15:11       ` Lorenzo Colitti
2014-04-22  9:38   ` [PATCH net-next v2 3/3] net: ipv6: Use ip6_datagram_send_common in ping Lorenzo Colitti
2014-04-22 15:14 ` [PATCH net-next v3 1/3] net: ipv6: Unduplicate {raw,udp}v6_sendmsg code Lorenzo Colitti
2014-04-22 15:14   ` [PATCH net-next v3 2/3] net: ipv6: Use ip6_datagram_send_common in L2TP IPv6 Lorenzo Colitti
2014-04-22 15:14   ` [PATCH net-next v3 3/3] net: ipv6: Use ip6_datagram_send_common in ping Lorenzo Colitti
2014-04-22 15:48   ` [PATCH net-next v3 1/3] net: ipv6: Unduplicate {raw,udp}v6_sendmsg code Hannes Frederic Sowa
2014-04-23  6:37     ` Lorenzo Colitti
2014-04-22 15:59   ` Eric Dumazet
2014-04-23  6:38     ` Lorenzo Colitti
2014-04-23  6:37 ` [PATCH net-next v4 " Lorenzo Colitti
2014-04-23  6:37   ` [PATCH net-next v4 2/3] net: ipv6: Use ip6_datagram_send_common in L2TP IPv6 Lorenzo Colitti
2014-04-23  6:37   ` [PATCH net-next v4 3/3] net: ipv6: Use ip6_datagram_send_common in ping Lorenzo Colitti
2014-04-23 11:11     ` Florent Fourcot
2014-04-23 12:22       ` Lorenzo Colitti
2014-04-24 15:06         ` Hannes Frederic Sowa
2014-04-24 15:35           ` Lorenzo Colitti
2014-04-24 16:06             ` Lorenzo Colitti
2014-04-24 15:00   ` [PATCH net-next v4 1/3] net: ipv6: Unduplicate {raw,udp}v6_sendmsg code Hannes Frederic Sowa
2014-04-24 15:02     ` Hannes Frederic Sowa
2014-04-24 15:13       ` Lorenzo Colitti
2014-04-24 15:43         ` Hannes Frederic Sowa
2014-04-25 11:09           ` Lorenzo Colitti [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=CAKD1Yr0MoyjBwUVG+Bjf5D-k0-JkvzOL3mDaNtjF4rUeWJ21Ew@mail.gmail.com \
    --to=lorenzo@google.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=yoshfuji@linux-ipv6.org \
    /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.