mirror of
https://github.com/systemd/systemd
synced 2024-10-15 04:24:19 +00:00
tree-wide: also use CMSG_TYPED_DATA() on writing message header
This commit is contained in:
parent
1ebb0953f0
commit
b5d39bb3ca
|
@ -407,7 +407,7 @@ static int dhcp_server_send_udp(sd_dhcp_server *server, be32_t destination,
|
|||
rather than binding the socket. This will be mostly useful
|
||||
when we gain support for arbitrary number of server addresses
|
||||
*/
|
||||
pktinfo = (struct in_pktinfo*) CMSG_DATA(cmsg);
|
||||
pktinfo = CMSG_TYPED_DATA(cmsg, struct in_pktinfo);
|
||||
assert(pktinfo);
|
||||
|
||||
pktinfo->ipi_ifindex = server->ifindex;
|
||||
|
|
|
@ -567,7 +567,7 @@ _public_ int sd_pid_notify_with_fds(
|
|||
cmsg->cmsg_type = SCM_CREDENTIALS;
|
||||
cmsg->cmsg_len = CMSG_LEN(sizeof(struct ucred));
|
||||
|
||||
ucred = (struct ucred*) CMSG_DATA(cmsg);
|
||||
ucred = CMSG_TYPED_DATA(cmsg, struct ucred);
|
||||
ucred->pid = pid != 0 ? pid : getpid_cached();
|
||||
ucred->uid = getuid();
|
||||
ucred->gid = getgid();
|
||||
|
|
|
@ -1017,7 +1017,7 @@ static int manager_ipv4_send(
|
|||
cmsg->cmsg_level = IPPROTO_IP;
|
||||
cmsg->cmsg_type = IP_PKTINFO;
|
||||
|
||||
pi = (struct in_pktinfo*) CMSG_DATA(cmsg);
|
||||
pi = CMSG_TYPED_DATA(cmsg, struct in_pktinfo);
|
||||
pi->ipi_ifindex = ifindex;
|
||||
|
||||
if (source)
|
||||
|
@ -1073,7 +1073,7 @@ static int manager_ipv6_send(
|
|||
cmsg->cmsg_level = IPPROTO_IPV6;
|
||||
cmsg->cmsg_type = IPV6_PKTINFO;
|
||||
|
||||
pi = (struct in6_pktinfo*) CMSG_DATA(cmsg);
|
||||
pi = CMSG_TYPED_DATA(cmsg, struct in6_pktinfo);
|
||||
pi->ipi6_ifindex = ifindex;
|
||||
|
||||
if (source)
|
||||
|
|
Loading…
Reference in a new issue