Subject: Re: [PATCH net v2] ip6_tunnel: fix error code when tunnel exists

From: Nicolas Dichtel <[email-masked]>
Date: Tue, 17 Mar 2015 09:27:28 +0100

Le 16/03/2015 21:34, David Miller a écrit :
> From: Nicolas Dichtel <[email-masked]>
> 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.