diff options
author | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2015-10-22 15:37:48 +0000 |
---|---|---|
committer | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2015-10-22 15:37:48 +0000 |
commit | cd0470e770532da488df19612134f01231b21b2e (patch) | |
tree | feceac48a5b68b927fd09abf0a0a6b9929724c07 /sys/net/if.c | |
parent | efda7364db1f8aac179ecbcaaaaee19ad75027bf (diff) |
Inspired by satosin(), use inline functions to convert sockaddr dl.
Instead of casts they check wether the incoming object has the
expected type. So introduce satosdl() and sdltosa() in the kernel.
OK mpi@
Diffstat (limited to 'sys/net/if.c')
-rw-r--r-- | sys/net/if.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/net/if.c b/sys/net/if.c index 7ea0265100f..fb1e0aecb8f 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if.c,v 1.390 2015/10/22 10:46:26 mpi Exp $ */ +/* $OpenBSD: if.c,v 1.391 2015/10/22 15:37:47 bluhm Exp $ */ /* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */ /* @@ -1945,7 +1945,7 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, struct proc *p) case SIOCSIFLLADDR: if ((error = suser(p, 0))) return (error); - sdl = (struct sockaddr_dl *)ifp->if_sadl; + sdl = ifp->if_sadl; if (sdl == NULL) return (EINVAL); if (ifr->ifr_addr.sa_len != ETHER_ADDR_LEN) |