summaryrefslogtreecommitdiff
path: root/sys/netinet6/icmp6.c
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2015-10-22 15:37:48 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2015-10-22 15:37:48 +0000
commitcd0470e770532da488df19612134f01231b21b2e (patch)
treefeceac48a5b68b927fd09abf0a0a6b9929724c07 /sys/netinet6/icmp6.c
parentefda7364db1f8aac179ecbcaaaaee19ad75027bf (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/netinet6/icmp6.c')
-rw-r--r--sys/netinet6/icmp6.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c
index 42dc651222d..4f7034cbb84 100644
--- a/sys/netinet6/icmp6.c
+++ b/sys/netinet6/icmp6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: icmp6.c,v 1.173 2015/10/19 12:11:28 mpi Exp $ */
+/* $OpenBSD: icmp6.c,v 1.174 2015/10/22 15:37:47 bluhm Exp $ */
/* $KAME: icmp6.c,v 1.217 2001/06/20 15:03:29 jinmei Exp $ */
/*
@@ -1693,7 +1693,7 @@ icmp6_redirect_output(struct mbuf *m0, struct rtentry *rt)
if ((nrt != NULL) &&
(nrt->rt_flags & (RTF_GATEWAY|RTF_LLINFO)) == RTF_LLINFO &&
(nrt->rt_gateway->sa_family == AF_LINK) &&
- (sdl = (struct sockaddr_dl *)nrt->rt_gateway) &&
+ (sdl = satosdl(nrt->rt_gateway)) &&
sdl->sdl_alen) {
nd_opt = (struct nd_opt_hdr *)p;
nd_opt->nd_opt_type = ND_OPT_TARGET_LINKADDR;