summaryrefslogtreecommitdiffstats
path: root/if.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2016-02-01 22:58:30 +0000
committerRoy Marples <roy@marples.name>2016-02-01 22:58:30 +0000
commitc2c4b87c5d64f67c27ebc9fdceb886002670aa7a (patch)
tree13ff50cacd4c4f7de68ca8e40f06826060065e0b /if.c
parenteeb3d111931a5b3e72638b5efecb054eb79549d2 (diff)
downloaddhcpcd-c2c4b87c5d64f67c27ebc9fdceb886002670aa7a.tar.xz
Reduce needless casts on void *
Diffstat (limited to 'if.c')
-rw-r--r--if.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/if.c b/if.c
index 997c5e4f..52609c93 100644
--- a/if.c
+++ b/if.c
@@ -198,10 +198,8 @@ static void if_learnaddrs1(struct dhcpcd_ctx *ctx, struct if_head *ifs,
switch(ifa->ifa_addr->sa_family) {
#ifdef INET
case AF_INET:
- addr = (const struct sockaddr_in *)
- (void *)ifa->ifa_addr;
- net = (const struct sockaddr_in *)
- (void *)ifa->ifa_netmask;
+ addr = (void *)ifa->ifa_addr;
+ net = (void *)ifa->ifa_netmask;
if (ifa->ifa_flags & IFF_POINTOPOINT)
dst = (const struct sockaddr_in *)
(void *)ifa->ifa_dstaddr;
@@ -216,8 +214,8 @@ static void if_learnaddrs1(struct dhcpcd_ctx *ctx, struct if_head *ifs,
#endif
#ifdef INET6
case AF_INET6:
- sin6 = (struct sockaddr_in6 *)(void *)ifa->ifa_addr;
- net6 = (struct sockaddr_in6 *)(void *)ifa->ifa_netmask;
+ sin6 = (void *)ifa->ifa_addr;
+ net6 = (void *)ifa->ifa_netmask;
#ifdef __KAME__
if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr))
/* Remove the scope from the address */
@@ -374,7 +372,7 @@ if_discover(struct dhcpcd_ctx *ctx, int argc, char * const *argv)
if (ifa->ifa_addr != NULL) {
#ifdef AF_LINK
- sdl = (const struct sockaddr_dl *)(void *)ifa->ifa_addr;
+ sdl = (const void *)ifa->ifa_addr;
#ifdef IFLR_ACTIVE
/* We need to check for active address */
@@ -458,7 +456,7 @@ if_discover(struct dhcpcd_ctx *ctx, int argc, char * const *argv)
#endif
memcpy(ifp->hwaddr, CLLADDR(sdl), ifp->hwlen);
#elif AF_PACKET
- sll = (const struct sockaddr_ll *)(void *)ifa->ifa_addr;
+ sll = (const void *)ifa->ifa_addr;
ifp->index = (unsigned int)sll->sll_ifindex;
ifp->family = sll->sll_hatype;
ifp->hwlen = sll->sll_halen;