diff options
author | Patrick McHardy <kaber@trash.net> | 2007-10-12 14:01:13 +0200 |
---|---|---|
committer | Stephen Hemminger <shemminger@linux-foundation.org> | 2007-10-12 15:45:12 -0700 |
commit | ca78b0e7d4042be7f7283d551d433b76da7f312b (patch) | |
tree | e57472fcdfbe45b26bb6b94399c4e77a2d06c924 /tc/p_icmp.c | |
parent | 5058332f3cd751cb0aa4970a0892ebc4b791b748 (diff) |
Prevent renaming interfaces to empty string.
Andreas Henriksson wrote:
> From: Alexander Wirt <formorer@debian.org>
>
>
> Signed-off-by: Andreas Henriksson <andreas@fatal.se>
> ---
> ip/iplink.c | 4 ++++
> 1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/ip/iplink.c b/ip/iplink.c
> index 4060845..da1f64e 100644
> --- a/ip/iplink.c
> +++ b/ip/iplink.c
> @@ -670,6 +670,10 @@ static int do_set(int argc, char **argv)
> }
>
> if (newname && strcmp(dev, newname)) {
> + if (strlen(newname) == 0) {
> + printf("\"\" is not valid device identifier\n");
> + return -1;
> + }
Indentation fixed, same change for the non-ioctl case, use invarg.
While I'm at it I also fixed the error message for "name too long",
*argv is NULL at this point.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'tc/p_icmp.c')
0 files changed, 0 insertions, 0 deletions