ip{, 6}tunnel: unify behaviour if physical device is not found
Make ip6tunnel print an error message as well. While there, get rid of unnecessary line breaking. Signed-off-by: Phil Sutter <phil@nwl.cc>
This commit is contained in:
parent
a7ed1520ee
commit
6ddb1e8c90
|
|
@ -278,8 +278,10 @@ static int parse_args(int argc, char **argv, int cmd, struct ip6_tnl_parm2 *p)
|
||||||
}
|
}
|
||||||
if (medium[0]) {
|
if (medium[0]) {
|
||||||
p->link = ll_name_to_index(medium);
|
p->link = ll_name_to_index(medium);
|
||||||
if (p->link == 0)
|
if (p->link == 0) {
|
||||||
|
fprintf(stderr, "Cannot find device \"%s\"\n", medium);
|
||||||
return -1;
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -228,8 +228,7 @@ static int parse_args(int argc, char **argv, int cmd, struct ip_tunnel_parm *p)
|
||||||
if (medium[0]) {
|
if (medium[0]) {
|
||||||
p->link = if_nametoindex(medium);
|
p->link = if_nametoindex(medium);
|
||||||
if (p->link == 0) {
|
if (p->link == 0) {
|
||||||
fprintf(stderr, "Cannot find device \"%s\"\n",
|
fprintf(stderr, "Cannot find device \"%s\"\n", medium);
|
||||||
medium);
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue