diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-06-10 19:10:47 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-06-10 19:29:47 +0200 |
commit | 2a1288ff89322a2f49c79f6d1832c8164c14a05c (patch) | |
tree | 02cc41ade7b814d258b183c0ac88670163194913 /src/libsystemd-network/sd-dhcp-server.c | |
parent | 5410b2ed62289d8ab6575e64951ac7b6bda51d40 (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.c | 2 |
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))) { |