]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-netlink: support NLMSG_DONE
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 23 Jul 2019 09:27:21 +0000 (18:27 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 14 Oct 2019 16:57:19 +0000 (01:57 +0900)
src/libsystemd/sd-netlink/generic-netlink.c
src/libsystemd/sd-netlink/netlink-types.c
src/systemd/sd-netlink.h

index bfbfb0fd390cbe9d0d17c191dc0b97b10128584b..cfd9b4973dfd8877ab7f347ee8e37bc7090a930f 100644 (file)
@@ -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 {
index ae4b6c72f776039434b0a116c7f1b60a43abf0bd..c9e20d6ed75128411abe2506c7d437055848503b 100644 (file)
@@ -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) },
 };
 
index 04bb2e547aef62d4d28416c52538da01afd3de32..283c2dd35b491d31f15c2ba042839e57287c1cbc 100644 (file)
@@ -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,