Skip to contentSkip to conversation

ip link: Remove unnecessary device checking

PATCH In review Vadim Kochan 2 participants 2 messages Aug 30, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ip link: Remove unnecessary device checking

The real checking is performed later in iplink_modify(..) func which checks device existence if NLM_F_CREATE flag is set.

Also it fixes the case when impossible to add veth link which was caused by 9a02651a87 (ip: check for missing dev arg when doing VF rate) because these devices are not exist yet.

---
 ip/iplink.c | 2 --
 1 file changed, 2 deletions(-)
ip/iplink.c +0 -2
index 1a907d9..ea06871 100644
@@ -593,8 +593,6 @@ int iplink_parse(int argc, char **argv, struct iplink_req *req,
 				duparg2("dev", *argv);
 			*dev = *argv;
 			dev_index = ll_name_to_index(*dev);
-			if (dev_index == 0)
-				invarg("Unknown device", *argv);
 		}
 		argc--; argv++;
 	}
Signature · 1 line
2.1.0
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Vadim Kochan

The real checking is performed later in iplink_modify(..) func which checks device existence if NLM_F_CREATE flag is set.

Also it fixes the case when impossible to add veth link which was caused by 9a02651a87 (ip: check for missing dev arg when doing VF rate) because these devices are not exist yet.

This also fixes this issue from Mehdi Abaakouk here:
http://marc.info/?l=linux-netdev&m=140912053421637

And the stuff I needed to change here:
https://gitorious.org/linux-can/can-tests/commit/578d07b0a13e0c171801cde8c048ac657373491e

Thanks for figuring out the detailed problem Vadim!

Regards,
Oliver

Quoted 18 lines
---
 ip/iplink.c | 2 --
 1 file changed, 2 deletions(-)
ip/iplink.c +0 -2
index 1a907d9..ea06871 100644
@@ -593,8 +593,6 @@ int iplink_parse(int argc, char **argv, struct iplink_req *req,
 				duparg2("dev", *argv);
 			*dev = *argv;
 			dev_index = ll_name_to_index(*dev);
-			if (dev_index == 0)
-				invarg("Unknown device", *argv);
 		}
 		argc--; argv++;
 	}