if (r < 0)
return r;
- memcpy_safe(*buf, optval, optlen);
-
- *buf += optlen;
+ *buf = mempcpy_safe(*buf, optval, optlen);
*buflen -= optlen;
return 0;
if (r < 0)
return r;
- memcpy(*buf, &a, sizeof(struct iaaddr));
-
- *buf += sizeof(struct iaaddr);
+ *buf = mempcpy(*buf, &a, sizeof(struct iaaddr));
*buflen -= sizeof(struct iaaddr);
return offsetof(DHCP6Option, data) + sizeof(struct iaaddr);
if (r < 0)
return r;
- memcpy(*buf, &p, sizeof(struct iapdprefix));
-
- *buf += sizeof(struct iapdprefix);
+ *buf = mempcpy(*buf, &p, sizeof(struct iapdprefix));
*buflen -= sizeof(struct iapdprefix);
return offsetof(DHCP6Option, data) + sizeof(struct iapdprefix);
break;
case SD_DHCP6_OPTION_IA_TA:
- len = sizeof(be32_t); /* IA_TA does not have lifetime. */
+ len = sizeof(header.id); /* IA_TA does not have lifetime. */
header = (struct ia_header) {
.id = ia->header.id,
};
*buf += offsetof(DHCP6Option, data);
*buflen -= offsetof(DHCP6Option, data);
- memcpy(*buf, &header, len);
- *buf += len;
+ *buf = mempcpy(*buf, &header, len);
*buflen -= len;
LIST_FOREACH(addresses, addr, ia->addresses) {