mirror of
https://github.com/systemd/systemd.git
synced 2024-11-04 13:51:24 +03:00
sd-rtnl: fix reading of nla type
We must filter out the 'network-byteorder' and 'nested' flags.
This commit is contained in:
parent
9243e967a3
commit
0a2478a918
Notes:
Lennart Poettering
2014-12-09 18:30:48 +01:00
Backport: bugfix
@ -36,6 +36,8 @@
|
|||||||
#define GET_CONTAINER(m, i) ((i) < (m)->n_containers ? (struct rtattr*)((uint8_t*)(m)->hdr + (m)->container_offsets[i]) : NULL)
|
#define GET_CONTAINER(m, i) ((i) < (m)->n_containers ? (struct rtattr*)((uint8_t*)(m)->hdr + (m)->container_offsets[i]) : NULL)
|
||||||
#define PUSH_CONTAINER(m, new) (m)->container_offsets[(m)->n_containers ++] = (uint8_t*)(new) - (uint8_t*)(m)->hdr;
|
#define PUSH_CONTAINER(m, new) (m)->container_offsets[(m)->n_containers ++] = (uint8_t*)(new) - (uint8_t*)(m)->hdr;
|
||||||
|
|
||||||
|
#define RTA_TYPE(rta) ((rta)->rta_type & NLA_TYPE_MASK)
|
||||||
|
|
||||||
static int message_new_empty(sd_rtnl *rtnl, sd_rtnl_message **ret) {
|
static int message_new_empty(sd_rtnl *rtnl, sd_rtnl_message **ret) {
|
||||||
sd_rtnl_message *m;
|
sd_rtnl_message *m;
|
||||||
|
|
||||||
@ -1066,7 +1068,7 @@ int rtnl_message_parse(sd_rtnl_message *m,
|
|||||||
*rta_tb_size = max + 1;
|
*rta_tb_size = max + 1;
|
||||||
|
|
||||||
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_TYPE(rta);
|
||||||
|
|
||||||
/* if the kernel is newer than the headers we used
|
/* if the kernel is newer than the headers we used
|
||||||
when building, we ignore out-of-range attributes
|
when building, we ignore out-of-range attributes
|
||||||
|
Loading…
Reference in New Issue
Block a user