diff options
Diffstat (limited to 'sys/net/if.c')
-rw-r--r-- | sys/net/if.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/net/if.c b/sys/net/if.c index 43a8461..a85d29a 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1348,11 +1348,13 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, caddr_t data, struct thread *td) case SIOCSIFNAME: error = suser(td); - if (error) + if (error != 0) return (error); error = copyinstr(ifr->ifr_data, new_name, IFNAMSIZ, NULL); - if (error) + if (error != 0) return (error); + if (new_name[0] == '\0') + return (EINVAL); if (ifunit(new_name) != NULL) return (EEXIST); |