mirror of
https://github.com/systemd/systemd.git
synced 2024-11-06 16:59:03 +03:00
sd-rtnl: message parsing - log when ignoring message attributes
This commit is contained in:
parent
d39edfc72f
commit
e634cd4096
@ -1040,7 +1040,7 @@ int rtnl_message_parse(sd_rtnl_message *m,
|
|||||||
int max,
|
int max,
|
||||||
struct rtattr *rta,
|
struct rtattr *rta,
|
||||||
unsigned int rt_len) {
|
unsigned int rt_len) {
|
||||||
int type;
|
unsigned short type;
|
||||||
size_t *tb;
|
size_t *tb;
|
||||||
|
|
||||||
tb = (size_t *) new0(size_t *, max);
|
tb = (size_t *) new0(size_t *, max);
|
||||||
@ -1052,8 +1052,15 @@ int rtnl_message_parse(sd_rtnl_message *m,
|
|||||||
for (; RTA_OK(rta, rt_len); rta = RTA_NEXT(rta, rt_len)) {
|
for (; RTA_OK(rta, rt_len); rta = RTA_NEXT(rta, rt_len)) {
|
||||||
type = rta->rta_type;
|
type = rta->rta_type;
|
||||||
|
|
||||||
if (type <= max)
|
if (type > max) {
|
||||||
tb[type] = (uint8_t *) rta - (uint8_t *) m->hdr;
|
log_debug("rtnl: message parse - ignore out of range attribute type");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tb[type])
|
||||||
|
log_debug("rtnl: message parse - overwriting repeated attribute");
|
||||||
|
|
||||||
|
tb[type] = (uint8_t *) rta - (uint8_t *) m->hdr;
|
||||||
}
|
}
|
||||||
|
|
||||||
*rta_offset_tb = tb;
|
*rta_offset_tb = tb;
|
||||||
|
Loading…
Reference in New Issue
Block a user