Cosmetic: compare sa_family with AF_UNSPEC instead of testing truth.
Join a line. Compare sa_len with 0 instead of testing truth.
This commit is contained in:
parent
df0b11bb4e
commit
62c140415f
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: in.c,v 1.125 2008/04/28 20:24:09 martin Exp $ */
|
||||
/* $NetBSD: in.c,v 1.126 2008/05/11 20:17:59 dyoung Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
|
||||
|
@ -91,7 +91,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: in.c,v 1.125 2008/04/28 20:24:09 martin Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: in.c,v 1.126 2008/05/11 20:17:59 dyoung Exp $");
|
||||
|
||||
#include "opt_inet.h"
|
||||
#include "opt_inet_conf.h"
|
||||
|
@ -657,10 +657,9 @@ in_lifaddr_ioctl(struct socket *so, u_long cmd, void *data,
|
|||
return EINVAL;
|
||||
/* XXX need improvement */
|
||||
sa = (struct sockaddr *)&iflr->dstaddr;
|
||||
if (sa->sa_family
|
||||
&& sa->sa_family != AF_INET)
|
||||
if (sa->sa_family != AF_UNSPEC && sa->sa_family != AF_INET)
|
||||
return EINVAL;
|
||||
if (sa->sa_len && sa->sa_len != sizeof(struct sockaddr_in))
|
||||
if (sa->sa_len != 0 && sa->sa_len != sizeof(struct sockaddr_in))
|
||||
return EINVAL;
|
||||
break;
|
||||
default: /*shouldn't happen*/
|
||||
|
|
Loading…
Reference in New Issue