summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2019-07-23 18:27:21 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2019-10-15 01:57:19 +0900
commit2be081ffd6228a0c0f9321c9ce722348c2ef4abd (patch)
tree7c9ed901a6475f22cf40b511212dca2bc5d9f4a6
parent4e8f0ef92160267e7d4725735e948258dfb9bbec (diff)
downloadsystemd-2be081ffd6228a0c0f9321c9ce722348c2ef4abd.tar.gz
sd-netlink: support NLMSG_DONE
-rw-r--r--src/libsystemd/sd-netlink/generic-netlink.c2
-rw-r--r--src/libsystemd/sd-netlink/netlink-types.c3
-rw-r--r--src/systemd/sd-netlink.h1
3 files changed, 5 insertions, 1 deletions
diff --git a/src/libsystemd/sd-netlink/generic-netlink.c b/src/libsystemd/sd-netlink/generic-netlink.c
index bfbfb0fd39..cfd9b4973d 100644
--- a/src/libsystemd/sd-netlink/generic-netlink.c
+++ b/src/libsystemd/sd-netlink/generic-netlink.c
@@ -144,6 +144,8 @@ int nlmsg_type_to_genl_family(sd_netlink *nl, uint16_t type, sd_genl_family *ret
if (type == NLMSG_ERROR)
*ret = SD_GENL_ERROR;
+ else if (type == NLMSG_DONE)
+ *ret = SD_GENL_DONE;
else if (type == GENL_ID_CTRL)
*ret = SD_GENL_ID_CTRL;
else {
diff --git a/src/libsystemd/sd-netlink/netlink-types.c b/src/libsystemd/sd-netlink/netlink-types.c
index ae4b6c72f7..c9e20d6ed7 100644
--- a/src/libsystemd/sd-netlink/netlink-types.c
+++ b/src/libsystemd/sd-netlink/netlink-types.c
@@ -991,7 +991,7 @@ static const NLTypeSystem genl_macsec_device_type_system = {
static const NLType genl_families[] = {
[SD_GENL_ID_CTRL] = { .type = NETLINK_TYPE_NESTED, .type_system = &genl_ctrl_id_ctrl_type_system },
[SD_GENL_WIREGUARD] = { .type = NETLINK_TYPE_NESTED, .type_system = &genl_wireguard_type_system },
- [SD_GENL_FOU] = { .type = NETLINK_TYPE_NESTED, .type_system = &genl_fou_cmds_type_system},
+ [SD_GENL_FOU] = { .type = NETLINK_TYPE_NESTED, .type_system = &genl_fou_cmds_type_system },
[SD_GENL_L2TP] = { .type = NETLINK_TYPE_NESTED, .type_system = &genl_l2tp_tunnel_session_type_system },
[SD_GENL_MACSEC] = { .type = NETLINK_TYPE_NESTED, .type_system = &genl_macsec_device_type_system },
};
@@ -1004,6 +1004,7 @@ const NLTypeSystem genl_family_type_system_root = {
static const NLType genl_types[] = {
[SD_GENL_ERROR] = { .type = NETLINK_TYPE_NESTED, .type_system = &empty_type_system, .size = sizeof(struct nlmsgerr) },
+ [SD_GENL_DONE] = { .type = NETLINK_TYPE_NESTED, .type_system = &empty_type_system },
[SD_GENL_ID_CTRL] = { .type = NETLINK_TYPE_NESTED, .type_system = &genl_get_family_type_system, .size = sizeof(struct genlmsghdr) },
};
diff --git a/src/systemd/sd-netlink.h b/src/systemd/sd-netlink.h
index 04bb2e547a..283c2dd35b 100644
--- a/src/systemd/sd-netlink.h
+++ b/src/systemd/sd-netlink.h
@@ -36,6 +36,7 @@ typedef struct sd_netlink_slot sd_netlink_slot;
typedef enum sd_gen_family {
SD_GENL_ERROR,
+ SD_GENL_DONE,
SD_GENL_ID_CTRL,
SD_GENL_WIREGUARD,
SD_GENL_FOU,