Quit using NULL macro.
This commit is contained in:
parent
05a075aeb2
commit
56b6ae2cd3
@ -55,12 +55,12 @@ static int get_udp_unicast_socket(struct client_state_t cs[static 1])
|
|||||||
char buf[32];
|
char buf[32];
|
||||||
buf[0] = 'u';
|
buf[0] = 'u';
|
||||||
memcpy(buf + 1, &cs->clientAddr, sizeof cs->clientAddr);
|
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)
|
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])
|
static int get_raw_listen_socket(struct client_state_t cs[static 1])
|
||||||
|
@ -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,
|
return perform_ip_subnet_bcast(ip4_addr, ip4_subnet,
|
||||||
have_bcast ? ip4_bcast : NULL);
|
have_bcast ? ip4_bcast : (char *)0);
|
||||||
}
|
}
|
||||||
|
|
||||||
%%{
|
%%{
|
||||||
|
@ -426,8 +426,8 @@ static void ipbcpfx_clear_others_do(const struct nlmsghdr *nlh, void *data)
|
|||||||
erase:
|
erase:
|
||||||
r = rtnl_addr_broadcast_send(ipx->fd, RTM_DELADDR, ifm->ifa_flags,
|
r = rtnl_addr_broadcast_send(ipx->fd, RTM_DELADDR, ifm->ifa_flags,
|
||||||
ifm->ifa_scope,
|
ifm->ifa_scope,
|
||||||
tb[IFA_ADDRESS] ? RTA_DATA(tb[IFA_ADDRESS]) : NULL,
|
tb[IFA_ADDRESS] ? RTA_DATA(tb[IFA_ADDRESS]) : (uint32_t *)0,
|
||||||
tb[IFA_BROADCAST] ? RTA_DATA(tb[IFA_BROADCAST]) : NULL,
|
tb[IFA_BROADCAST] ? RTA_DATA(tb[IFA_BROADCAST]) : (uint32_t *)0,
|
||||||
ifm->ifa_prefixlen);
|
ifm->ifa_prefixlen);
|
||||||
if (r < 0 && r != -2) {
|
if (r < 0 && r != -2) {
|
||||||
log_warning("%s: (%s) Failed to delete IP and broadcast addresses.",
|
log_warning("%s: (%s) Failed to delete IP and broadcast addresses.",
|
||||||
|
@ -166,7 +166,7 @@ static void setup_signals_ndhc(void)
|
|||||||
sigaddset(&mask, SIGUSR2);
|
sigaddset(&mask, SIGUSR2);
|
||||||
sigaddset(&mask, SIGCHLD);
|
sigaddset(&mask, SIGCHLD);
|
||||||
sigaddset(&mask, SIGTERM);
|
sigaddset(&mask, SIGTERM);
|
||||||
if (sigprocmask(SIG_BLOCK, &mask, NULL) < 0)
|
if (sigprocmask(SIG_BLOCK, &mask, (sigset_t *)0) < 0)
|
||||||
suicide("sigprocmask failed");
|
suicide("sigprocmask failed");
|
||||||
if (cs.signalFd >= 0) {
|
if (cs.signalFd >= 0) {
|
||||||
epoll_del(cs.epollFd, cs.signalFd);
|
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];
|
uint8_t mac[6];
|
||||||
for (size_t i = 0; i < sizeof mac; ++i)
|
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
|
client_config.clientid[0] = 1; // Ethernet MAC type
|
||||||
memcpy(client_config.clientid + 1, mac,
|
memcpy(client_config.clientid + 1, mac,
|
||||||
min_size_t(sizeof mac, sizeof client_config.clientid - 1));
|
min_size_t(sizeof mac, sizeof client_config.clientid - 1));
|
||||||
@ -471,7 +471,7 @@ static void ndhc_main(void) {
|
|||||||
|
|
||||||
nk_set_chroot(chroot_dir);
|
nk_set_chroot(chroot_dir);
|
||||||
memset(chroot_dir, '\0', sizeof 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 (!carrier_isup()) {
|
||||||
if (ifchange_deconfig(&cs) < 0)
|
if (ifchange_deconfig(&cs) < 0)
|
||||||
|
@ -319,7 +319,7 @@ static int create_raw_broadcast_socket(void)
|
|||||||
.sll_halen = 6,
|
.sll_halen = 6,
|
||||||
};
|
};
|
||||||
memcpy(da.sll_addr, "\xff\xff\xff\xff\xff\xff", 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)
|
static bool arp_set_bpf_basic(int fd)
|
||||||
|
@ -77,7 +77,7 @@ int setup_signals_subprocess(void)
|
|||||||
sigaddset(&mask, SIGHUP);
|
sigaddset(&mask, SIGHUP);
|
||||||
sigaddset(&mask, SIGINT);
|
sigaddset(&mask, SIGINT);
|
||||||
sigaddset(&mask, SIGTERM);
|
sigaddset(&mask, SIGTERM);
|
||||||
if (sigprocmask(SIG_BLOCK, &mask, NULL) < 0)
|
if (sigprocmask(SIG_BLOCK, &mask, (sigset_t *)0) < 0)
|
||||||
suicide("sigprocmask failed");
|
suicide("sigprocmask failed");
|
||||||
int sfd = signalfd(-1, &mask, SFD_NONBLOCK);
|
int sfd = signalfd(-1, &mask, SFD_NONBLOCK);
|
||||||
if (sfd < 0)
|
if (sfd < 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user