[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5507E570.9050602@6wind.com>
Date: Tue, 17 Mar 2015 09:27:28 +0100
From: Nicolas Dichtel <nicolas.dichtel@...nd.com>
To: David Miller <davem@...emloft.net>
CC: netdev@...r.kernel.org, me@...rre-cheynier.net,
eric.dumazet@...il.com, steffen.klassert@...unet.com
Subject: Re: [PATCH net v2] ip6_tunnel: fix error code when tunnel exists
Le 16/03/2015 21:34, David Miller a écrit :
> From: Nicolas Dichtel <nicolas.dichtel@...nd.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.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists