diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2019-12-15 13:32:25 +0100 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2019-12-16 02:52:17 +0100 |
commit | 8f3c1859669230c2c8458675f41de13e369b47e7 (patch) | |
tree | 0bf783f8d3cb0089658f494f2476b8c403786755 /src/systemd/sd-netlink.h | |
parent | sd-netlink: support IFLA_PROP_LIST and IFLA_ALT_IFNAME attributes (diff) | |
download | systemd-8f3c1859669230c2c8458675f41de13e369b47e7.tar.xz systemd-8f3c1859669230c2c8458675f41de13e369b47e7.zip |
sd-netlink: introduce sd_netlink_message_read_strv()
The combination of sd_netlink_message_enter_container() and
sd_netlink_message_read_string() only reads the last element if the attribute is
duplicated, such a situation easily happens for IFLA_ALT_IFNAME.
The function introduced here reads all matched attributes.
Diffstat (limited to '')
-rw-r--r-- | src/systemd/sd-netlink.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/systemd/sd-netlink.h b/src/systemd/sd-netlink.h index b34befebc8..fbddcea3d7 100644 --- a/src/systemd/sd-netlink.h +++ b/src/systemd/sd-netlink.h @@ -100,6 +100,7 @@ int sd_netlink_message_close_container(sd_netlink_message *m); int sd_netlink_message_read(sd_netlink_message *m, unsigned short type, size_t size, void *data); int sd_netlink_message_read_string_strdup(sd_netlink_message *m, unsigned short type, char **data); int sd_netlink_message_read_string(sd_netlink_message *m, unsigned short type, const char **data); +int sd_netlink_message_read_strv(sd_netlink_message *m, unsigned short container_type, unsigned short type_id, char ***ret); int sd_netlink_message_read_u8(sd_netlink_message *m, unsigned short type, uint8_t *data); int sd_netlink_message_read_u16(sd_netlink_message *m, unsigned short type, uint16_t *data); int sd_netlink_message_read_u32(sd_netlink_message *m, unsigned short type, uint32_t *data); |