diff options
author | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2013-03-28 00:32:12 +0000 |
---|---|---|
committer | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2013-03-28 00:32:12 +0000 |
commit | 1682209d2280b7c51c61607fe7cb5e272b7ded92 (patch) | |
tree | 8fcd2b6f34fdee653fb7dc1f67f9c6884376de1c /sys/net/pf.c | |
parent | ef334395d0445f4d18ee8bba08b4532efdca84fc (diff) |
Unfortunately the satosin, sintosa, ifatoia, satosin6, sin6tosa,
ifatoia6 macros do not check the source type. They just cast
anything. Remove needless casts and do not use those macros if the
source type does not match. Remove duplicate defines.
No binary change. OK kettenis@ krw@
Diffstat (limited to 'sys/net/pf.c')
-rw-r--r-- | sys/net/pf.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/net/pf.c b/sys/net/pf.c index d8d63f348db..d4f9471db97 100644 --- a/sys/net/pf.c +++ b/sys/net/pf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf.c,v 1.819 2013/03/11 19:48:40 sthen Exp $ */ +/* $OpenBSD: pf.c,v 1.820 2013/03/28 00:32:11 bluhm Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -5730,7 +5730,7 @@ pf_routable(struct pf_addr *addr, sa_family_t af, struct pfi_kif *kif, switch (af) { #ifdef INET case AF_INET: - dst = satosin(&ro.ro_dst); + dst = (struct sockaddr_in *)&ro.ro_dst; dst->sin_family = AF_INET; dst->sin_len = sizeof(*dst); dst->sin_addr = addr->v4; @@ -5746,7 +5746,7 @@ pf_routable(struct pf_addr *addr, sa_family_t af, struct pfi_kif *kif, */ if (IN6_IS_SCOPE_EMBED(&addr->v6)) goto out; - dst6 = (struct sockaddr_in6 *)&ro.ro_dst; + dst6 = &ro.ro_dst; dst6->sin6_family = AF_INET6; dst6->sin6_len = sizeof(*dst6); dst6->sin6_addr = addr->v6; @@ -5811,7 +5811,7 @@ pf_rtlabel_match(struct pf_addr *addr, sa_family_t af, struct pf_addr_wrap *aw, switch (af) { #ifdef INET case AF_INET: - dst = satosin(&ro.ro_dst); + dst = (struct sockaddr_in *)(&ro.ro_dst); dst->sin_family = AF_INET; dst->sin_len = sizeof(*dst); dst->sin_addr = addr->v4; @@ -5819,7 +5819,7 @@ pf_rtlabel_match(struct pf_addr *addr, sa_family_t af, struct pf_addr_wrap *aw, #endif /* INET */ #ifdef INET6 case AF_INET6: - dst6 = (struct sockaddr_in6 *)&ro.ro_dst; + dst6 = &ro.ro_dst; dst6->sin6_family = AF_INET6; dst6->sin6_len = sizeof(*dst6); dst6->sin6_addr = addr->v6; |