diff --git a/src/dhcp.c b/src/dhcp.c index 3cf07cf..0514339 100644 --- a/src/dhcp.c +++ b/src/dhcp.c @@ -55,12 +55,12 @@ static int get_udp_unicast_socket(struct client_state_t cs[static 1]) char buf[32]; buf[0] = 'u'; memcpy(buf + 1, &cs->clientAddr, sizeof cs->clientAddr); - return request_sockd_fd(buf, 1 + sizeof cs->clientAddr, NULL); + return request_sockd_fd(buf, 1 + sizeof cs->clientAddr, (char *)0); } static int get_raw_broadcast_socket(void) { - return request_sockd_fd("s", 1, NULL); + return request_sockd_fd("s", 1, (char *)0); } static int get_raw_listen_socket(struct client_state_t cs[static 1]) diff --git a/src/ifchd-parse.rl b/src/ifchd-parse.rl index e37f9c4..7e604ed 100644 --- a/src/ifchd-parse.rl +++ b/src/ifchd-parse.rl @@ -109,7 +109,7 @@ static int perform_ip4set(const char buf[static 1], size_t len) } return perform_ip_subnet_bcast(ip4_addr, ip4_subnet, - have_bcast ? ip4_bcast : NULL); + have_bcast ? ip4_bcast : (char *)0); } %%{ diff --git a/src/ifset.c b/src/ifset.c index 577d878..94012bf 100644 --- a/src/ifset.c +++ b/src/ifset.c @@ -426,8 +426,8 @@ static void ipbcpfx_clear_others_do(const struct nlmsghdr *nlh, void *data) erase: r = rtnl_addr_broadcast_send(ipx->fd, RTM_DELADDR, ifm->ifa_flags, ifm->ifa_scope, - tb[IFA_ADDRESS] ? RTA_DATA(tb[IFA_ADDRESS]) : NULL, - tb[IFA_BROADCAST] ? RTA_DATA(tb[IFA_BROADCAST]) : NULL, + tb[IFA_ADDRESS] ? RTA_DATA(tb[IFA_ADDRESS]) : (uint32_t *)0, + tb[IFA_BROADCAST] ? RTA_DATA(tb[IFA_BROADCAST]) : (uint32_t *)0, ifm->ifa_prefixlen); if (r < 0 && r != -2) { log_warning("%s: (%s) Failed to delete IP and broadcast addresses.", diff --git a/src/ndhc.c b/src/ndhc.c index a44b13a..3a4714b 100644 --- a/src/ndhc.c +++ b/src/ndhc.c @@ -166,7 +166,7 @@ static void setup_signals_ndhc(void) sigaddset(&mask, SIGUSR2); sigaddset(&mask, SIGCHLD); sigaddset(&mask, SIGTERM); - if (sigprocmask(SIG_BLOCK, &mask, NULL) < 0) + if (sigprocmask(SIG_BLOCK, &mask, (sigset_t *)0) < 0) suicide("sigprocmask failed"); if (cs.signalFd >= 0) { epoll_del(cs.epollFd, cs.signalFd); @@ -232,7 +232,7 @@ int get_clientid_string(const char str[static 1], size_t slen) uint8_t mac[6]; for (size_t i = 0; i < sizeof mac; ++i) - mac[i] = strtol(str+i*3, NULL, 16); + mac[i] = strtol(str+i*3, (char **)0, 16); client_config.clientid[0] = 1; // Ethernet MAC type memcpy(client_config.clientid + 1, mac, min_size_t(sizeof mac, sizeof client_config.clientid - 1)); @@ -471,7 +471,7 @@ static void ndhc_main(void) { nk_set_chroot(chroot_dir); memset(chroot_dir, '\0', sizeof chroot_dir); - nk_set_uidgid(ndhc_uid, ndhc_gid, NULL, 0); + nk_set_uidgid(ndhc_uid, ndhc_gid, (const unsigned char *)0, 0); if (!carrier_isup()) { if (ifchange_deconfig(&cs) < 0) diff --git a/src/sockd.c b/src/sockd.c index e44b22a..ab2a066 100644 --- a/src/sockd.c +++ b/src/sockd.c @@ -319,7 +319,7 @@ static int create_raw_broadcast_socket(void) .sll_halen = 6, }; memcpy(da.sll_addr, "\xff\xff\xff\xff\xff\xff", 6); - return create_raw_socket(&da, NULL, NULL); + return create_raw_socket(&da, (bool *)0, (struct sock_fprog *)0); } static bool arp_set_bpf_basic(int fd) diff --git a/src/sys.c b/src/sys.c index 8bdbfd6..548e4d8 100644 --- a/src/sys.c +++ b/src/sys.c @@ -77,7 +77,7 @@ int setup_signals_subprocess(void) sigaddset(&mask, SIGHUP); sigaddset(&mask, SIGINT); sigaddset(&mask, SIGTERM); - if (sigprocmask(SIG_BLOCK, &mask, NULL) < 0) + if (sigprocmask(SIG_BLOCK, &mask, (sigset_t *)0) < 0) suicide("sigprocmask failed"); int sfd = signalfd(-1, &mask, SFD_NONBLOCK); if (sfd < 0)