]> granicus.if.org Git - strace/commitdiff
rtnl_neigh: fix ndm_type field decode in struct ndmsg
authorJingPiao Chen <chenjingpiao@gmail.com>
Mon, 28 Aug 2017 08:13:56 +0000 (16:13 +0800)
committerJingPiao Chen <chenjingpiao@gmail.com>
Tue, 29 Aug 2017 04:16:03 +0000 (12:16 +0800)
* defs.h (routing_types): New xlat prototype.
* rtnl_neigh.c (decode_ndmsg): Fix ndm_type decode.
* xlat/nda_types.in: Remove it.
* tests/netlink_route.c (test_rtnl_neigh): Update the test.
* tests/nlattr_ndmsg.c (init_ndmsg, print_ndmsg): Likewise.

defs.h
rtnl_neigh.c
tests/netlink_route.c
tests/nlattr_ndmsg.c
xlat/nda_types.in [deleted file]

diff --git a/defs.h b/defs.h
index e37c555bd9002062fbe477d675f5b13c73cc698b..5323920cceee774a4517592ae5cd6e87a8528653 100644 (file)
--- a/defs.h
+++ b/defs.h
@@ -294,6 +294,7 @@ extern const struct xlat open_mode_flags[];
 extern const struct xlat resource_flags[];
 extern const struct xlat routing_scopes[];
 extern const struct xlat routing_table_ids[];
+extern const struct xlat routing_types[];
 extern const struct xlat setns_types[];
 extern const struct xlat sg_io_info[];
 extern const struct xlat socketlayers[];
index 2ce237a64d49df717818a091fca83e4160f6e665..7191ecbab241a7476270757c508a7835a81424ea 100644 (file)
@@ -38,7 +38,6 @@
 # include <linux/neighbour.h>
 #endif
 
-#include "xlat/nda_types.h"
 #include "xlat/neighbor_cache_entry_flags.h"
 #include "xlat/neighbor_cache_entry_states.h"
 #include "xlat/rtnl_neigh_attrs.h"
@@ -64,7 +63,7 @@ DECL_NETLINK_ROUTE_DECODER(decode_ndmsg)
                                          neighbor_cache_entry_flags,
                                          "NTF_???");
                        PRINT_FIELD_XVAL(", ", ndmsg, ndm_type,
-                                        nda_types, "NDA_???");
+                                        routing_types, "RTN_???");
                        decode_nla = true;
                }
        } else
index f9bd0d8efe3a84954ea544878b6028281474c864..6af3b13aa451b11ba8c53439ea47b0c36c098321 100644 (file)
@@ -308,7 +308,7 @@ test_rtnl_neigh(const int fd)
                .ndm_ifindex = ifindex_lo(),
                .ndm_state = NUD_PERMANENT,
                .ndm_flags = NTF_PROXY,
-               .ndm_type = NDA_UNSPEC
+               .ndm_type = RTN_UNSPEC
        };
 
        TEST_NL_ROUTE(fd, nlh0, RTM_GETNEIGH, msg,
@@ -316,7 +316,7 @@ test_rtnl_neigh(const int fd)
                      printf(", ndm_ifindex=" IFINDEX_LO_STR
                             ", ndm_state=NUD_PERMANENT"
                             ", ndm_flags=NTF_PROXY"
-                            ", ndm_type=NDA_UNSPEC}"));
+                            ", ndm_type=RTN_UNSPEC}"));
 }
 
 static void
index adf51479e42420844ce32b2b802a5eae9035d928..67aee883fe11fa716a9811a65f9b565ae89b1bae 100644 (file)
@@ -50,7 +50,7 @@ init_ndmsg(struct nlmsghdr *const nlh, const unsigned int msg_len)
                .ndm_ifindex = ifindex_lo(),
                .ndm_state = NUD_PERMANENT,
                .ndm_flags = NTF_PROXY,
-               .ndm_type = NDA_UNSPEC
+               .ndm_type = RTN_UNSPEC
        );
 }
 
@@ -62,7 +62,7 @@ print_ndmsg(const unsigned int msg_len)
               ", ndm_ifindex=" IFINDEX_LO_STR
               ", ndm_state=NUD_PERMANENT"
               ", ndm_flags=NTF_PROXY"
-              ", ndm_type=NDA_UNSPEC}",
+              ", ndm_type=RTN_UNSPEC}",
               msg_len);
 }
 
diff --git a/xlat/nda_types.in b/xlat/nda_types.in
deleted file mode 100644 (file)
index fed013a..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-NDA_UNSPEC             0
-NDA_DST                        1
-NDA_LLADDR             2
-NDA_CACHEINFO          3
-NDA_PROBES             4
-NDA_VLAN               5
-NDA_PORT               6
-NDA_VNI                        7
-NDA_IFINDEX            8
-NDA_MASTER             9
-NDA_LINK_NETNSID       10
-NDA_SRC_VNI            11