size_t len;
assert_return(client, -EINVAL);
- assert_return(duid_len == 0 || duid != NULL, -EINVAL);
+ assert_return(duid_len == 0 || duid, -EINVAL);
- if (duid != NULL) {
+ if (duid) {
r = dhcp_validate_duid_len(duid_type, duid_len, true);
if (r < 0)
return r;
}
}
- if (duid != NULL) {
+ if (duid) {
client->client_id.ns.duid.type = htobe16(duid_type);
memcpy(&client->client_id.ns.duid.raw.data, duid, duid_len);
len = sizeof(client->client_id.ns.duid.type) + duid_len;
} else if ((size_t)len < sizeof(DHCPPacket))
return 0;
- CMSG_FOREACH(cmsg, &msg) {
+ CMSG_FOREACH(cmsg, &msg)
if (cmsg->cmsg_level == SOL_PACKET &&
cmsg->cmsg_type == PACKET_AUXDATA &&
cmsg->cmsg_len == CMSG_LEN(sizeof(struct tpacket_auxdata))) {
checksum = !(aux->tp_status & TP_STATUS_CSUMNOTREADY);
break;
}
- }
r = dhcp_packet_verify_headers(packet, len, checksum, client->port);
if (r < 0)