for (; RTA_OK(rta, rt_len); rta = RTA_NEXT(rta, rt_len)) {
type = rta->rta_type;
- if (type > max) {
- log_debug("rtnl: message parse - ignore out of range attribute type");
+ /* if the kernel is newer than the headers we used
+ when building, we ignore out-of-range attributes
+ */
+ if (type > max)
continue;
- }
if (tb[type])
log_debug("rtnl: message parse - overwriting repeated attribute");
&m->rta_offset_tb[m->n_containers],
&m->rta_tb_size[m->n_containers],
type_system->max,
- (char*)NLMSG_DATA(m->hdr) + NLMSG_ALIGN(type->size),
+ (struct rtattr*)((uint8_t*)NLMSG_DATA(m->hdr) +
+ NLMSG_ALIGN(type->size)),
NLMSG_PAYLOAD(m->hdr, type->size));
if (r < 0)
return r;