diff options
author | Maria Matejka <mq@ucw.cz> | 2022-03-25 19:51:35 +0100 |
---|---|---|
committer | Maria Matejka <mq@ucw.cz> | 2022-05-04 15:37:41 +0200 |
commit | bc17fee1bfdbd330f5a4377bf40f6de0681afa5c (patch) | |
tree | ad1a32b216cdb28d13f4cfbae1cf8c711c5d556c /sysdep/linux/netlink.c | |
parent | d4bcef0e0bfee911d403c0cf830de3e3007eeb38 (diff) |
Filter: Bitfield eattrs reading / writing moved to filter code
Before this change, fetch-update-write and bitmasking was hardcoded in
attribute access code cased by the attribute type. Several filter
instructions are used to do it instead.
As this is certainly going to be a little bit slower than before, the
switch block in attribute access code should be completely removed in
near future, helping with both performance and code cleanliness.
The user interface should have stayed intact.
Diffstat (limited to 'sysdep/linux/netlink.c')
-rw-r--r-- | sysdep/linux/netlink.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sysdep/linux/netlink.c b/sysdep/linux/netlink.c index e103c8ef..6c8228fd 100644 --- a/sysdep/linux/netlink.c +++ b/sysdep/linux/netlink.c @@ -1928,7 +1928,7 @@ nl_parse_route(struct nl_parse_state *s, struct nlmsghdr *h) { ea->attrs[n].id = EA_CODE(PROTOCOL_KERNEL, KRT_METRICS_OFFSET + t); ea->attrs[n].flags = 0; - ea->attrs[n].type = EAF_TYPE_INT; /* FIXME: Some are EAF_TYPE_BITFIELD */ + ea->attrs[n].type = EAF_TYPE_INT; ea->attrs[n].u.data = metrics[t]; n++; } |