]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Use more void.
authorRoy Marples <roy@marples.name>
Thu, 19 May 2016 21:12:26 +0000 (21:12 +0000)
committerRoy Marples <roy@marples.name>
Thu, 19 May 2016 21:12:26 +0000 (21:12 +0000)
if-bsd.c
ipv4.h

index 959bae49d1ce787a880b90908fed1eb4d332f4dc..b3cd7a521b8a29c947fe419b04b33a70b93539a4 100644 (file)
--- a/if-bsd.c
+++ b/if-bsd.c
@@ -171,7 +171,7 @@ if_linkaddr(struct sockaddr_dl *sdl, const struct interface *ifp)
 #endif
 
 static int
-if_getssid1(int s, const char *ifname, uint8_t *ssid)
+if_getssid1(int s, const char *ifname, void *ssid)
 {
        int retval = -1;
 #if defined(SIOCG80211NWID)
@@ -263,7 +263,7 @@ if_vimaster(const struct dhcpcd_ctx *ctx, const char *ifname)
 }
 
 static void
-get_addrs(int type, uint8_t *cp, struct sockaddr **sa)
+get_addrs(int type, void *cp, struct sockaddr **sa)
 {
        int i;
 
@@ -492,7 +492,7 @@ if_readraw(struct interface *ifp, int fd, void *data, size_t len, int *flags)
 {
        struct bpf_hdr packet;
        ssize_t bytes;
-       const unsigned char *payload;
+       const char *payload;
        struct ipv4_state *state;
 
        state = IPV4_STATE(ifp);
@@ -769,7 +769,7 @@ if_route(unsigned char cmd, const struct rt *rt)
 }
 
 int
-if_initrt(struct dhcpcd_ctx *ctx) 
+if_initrt(struct dhcpcd_ctx *ctx)
 {
        struct rt_msghdr *rtm;
        int mib[6];
@@ -1350,7 +1350,6 @@ static void
 if_ifa(struct dhcpcd_ctx *ctx, struct ifa_msghdr *ifam)
 {
        struct interface *ifp;
-       uint8_t *cp;
        struct sockaddr *rti_info[RTAX_MAX];
 
        /* XXX We have no way of knowing who generated these
@@ -1358,8 +1357,7 @@ if_ifa(struct dhcpcd_ctx *ctx, struct ifa_msghdr *ifam)
         * avoid listening to our own delete messages. */
        if ((ifp = if_findindex(ctx->ifaces, ifam->ifam_index)) == NULL)
                return;
-       cp = (void *)(ifam + 1);
-       get_addrs(ifam->ifam_addrs, cp, rti_info);
+       get_addrs(ifam->ifam_addrs, ifam + 1, rti_info);
        if (rti_info[RTAX_IFA] == NULL)
                return;
        switch (rti_info[RTAX_IFA]->sa_family) {
@@ -1456,7 +1454,7 @@ int
 if_handlelink(struct dhcpcd_ctx *ctx)
 {
        /* route and ifwatchd like a msg buf size of 2048 */
-       uint8_t buf[2048], *p, *e;
+       char buf[2048], *p, *e;
        size_t msglen;
        ssize_t bytes;
 
diff --git a/ipv4.h b/ipv4.h
index 9b1b89f75d57b36ad5fde524c96b30d0d9beda9b..4def6361ee9f9aac011f2f8e91b72c8e764c0f2d 100644 (file)
--- a/ipv4.h
+++ b/ipv4.h
@@ -92,7 +92,7 @@ struct ipv4_state {
 #ifdef BSD
        /* Buffer for BPF */
        size_t buffer_size, buffer_len, buffer_pos;
-       uint8_t *buffer;
+       char *buffer;
 #endif
 };