public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Nicolas Dichtel <nicolas.dichtel@6wind•com>
To: David Miller <davem@davemloft•net>
Cc: netdev@vger•kernel.org, me@pierre-cheynier•net,
	eric.dumazet@gmail•com, steffen.klassert@secunet•com
Subject: Re: [PATCH net v2] ip6_tunnel: fix error code when tunnel exists
Date: Tue, 17 Mar 2015 09:27:28 +0100	[thread overview]
Message-ID: <5507E570.9050602@6wind.com> (raw)
In-Reply-To: <20150316.163413.1468551206666732117.davem@davemloft.net>

Le 16/03/2015 21:34, David Miller a écrit :
> From: Nicolas Dichtel <nicolas.dichtel@6wind•com>
> Date: Mon, 16 Mar 2015 15:56:05 +0100
>
>> @@ -1445,7 +1445,7 @@ ip6_tnl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
>>   		ip6_tnl_parm_from_user(&p1, &p);
>>   		t = ip6_tnl_locate(net, &p1, cmd == SIOCADDTUNNEL);
>>   		if (cmd == SIOCCHGTUNNEL) {
>> -			if (t != NULL) {
>> +			if (!IS_ERR(t)) {
>>   				if (t->dev != dev) {
>>   					err = -EEXIST;
>>   					break;
>
> Please convert that last assignment to "err = PTR_ERR(t);", thanks.
It's not possible, the if() statement checks that 't' is *not* an error.
And in this case, we report to the user that the tunnel already exists.

  reply	other threads:[~2015-03-17  8:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-13 12:58 [PATCH net] ip6_tunnel: fix error code when tunnel exists Nicolas Dichtel
2015-03-13 13:43 ` Eric Dumazet
2015-03-13 14:46   ` Nicolas Dichtel
2015-03-13 16:32   ` David Miller
2015-03-16 14:56     ` [PATCH net v2] " Nicolas Dichtel
2015-03-16 20:34       ` David Miller
2015-03-17  8:27         ` Nicolas Dichtel [this message]
2015-03-17 19:02           ` David 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=5507E570.9050602@6wind.com \
    --to=nicolas.dichtel@6wind$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=eric.dumazet@gmail$(echo .)com \
    --cc=me@pierre-cheynier$(echo .)net \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=steffen.klassert@secunet$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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