From 2be081ffd6228a0c0f9321c9ce722348c2ef4abd Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Tue, 23 Jul 2019 18:27:21 +0900 Subject: [PATCH] sd-netlink: support NLMSG_DONE --- src/libsystemd/sd-netlink/generic-netlink.c | 2 ++ src/libsystemd/sd-netlink/netlink-types.c | 3 ++- src/systemd/sd-netlink.h | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) 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,