summaryrefslogtreecommitdiff
path: root/src/libsystemd-network/sd-dhcp-server.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-06-10 19:10:47 +0200
committerLennart Poettering <lennart@poettering.net>2015-06-10 19:29:47 +0200
commit2a1288ff89322a2f49c79f6d1832c8164c14a05c (patch)
tree02cc41ade7b814d258b183c0ac88670163194913 /src/libsystemd-network/sd-dhcp-server.c
parent5410b2ed62289d8ab6575e64951ac7b6bda51d40 (diff)
util: introduce CMSG_FOREACH() macro and make use of it everywhere
It's only marginally shorter then the usual for() loop, but certainly more readable.
Diffstat (limited to 'src/libsystemd-network/sd-dhcp-server.c')
-rw-r--r--src/libsystemd-network/sd-dhcp-server.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libsystemd-network/sd-dhcp-server.c b/src/libsystemd-network/sd-dhcp-server.c
index a0a2320efa..cc5e032344 100644
--- a/src/libsystemd-network/sd-dhcp-server.c
+++ b/src/libsystemd-network/sd-dhcp-server.c
@@ -902,7 +902,7 @@ static int server_receive_message(sd_event_source *s, int fd,
else if ((size_t)len < sizeof(DHCPMessage))
return 0;
- for (cmsg = CMSG_FIRSTHDR(&msg); cmsg; cmsg = CMSG_NXTHDR(&msg, cmsg)) {
+ CMSG_FOREACH(cmsg, &msg) {
if (cmsg->cmsg_level == IPPROTO_IP &&
cmsg->cmsg_type == IP_PKTINFO &&
cmsg->cmsg_len == CMSG_LEN(sizeof(struct in_pktinfo))) {