[PATCH v3 3/5] Move nl_route_types definition from netlink.c to netlink_route.c

JingPiao Chen chenjingpiao at gmail.com
Wed Aug 9 02:07:40 UTC 2017


The side effect of #include "xlat/nl_route_types.h" is
RTM_* constants properly defined in that header file.
While netlink.c does not use these constants itself,
netlink_route.c is going to need them soon.

* defs.h (nl_route_types): New xlat prototype.
* netlink.c: Move inclusion of "xlat/nl_route_types.h" ...
* netlink_route.c: ... here.
---
 defs.h          | 1 +
 netlink.c       | 1 -
 netlink_route.c | 2 ++
 3 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/defs.h b/defs.h
index 44a6296..5b09f2e 100644
--- a/defs.h
+++ b/defs.h
@@ -292,6 +292,7 @@ extern const struct xlat evdev_abs[];
 extern const struct xlat inet_protocols[];
 extern const struct xlat msg_flags[];
 extern const struct xlat netlink_protocols[];
+extern const struct xlat nl_route_types[];
 extern const struct xlat open_access_modes[];
 extern const struct xlat open_mode_flags[];
 extern const struct xlat resource_flags[];
diff --git a/netlink.c b/netlink.c
index 2a0353f..ab40b14 100644
--- a/netlink.c
+++ b/netlink.c
@@ -43,7 +43,6 @@
 #include "xlat/nl_crypto_types.h"
 #include "xlat/nl_netfilter_msg_types.h"
 #include "xlat/nl_netfilter_subsys_ids.h"
-#include "xlat/nl_route_types.h"
 #include "xlat/nl_selinux_types.h"
 #include "xlat/nl_sock_diag_types.h"
 #include "xlat/nl_xfrm_types.h"
diff --git a/netlink_route.c b/netlink_route.c
index 2e7faa4..dc5a13f 100644
--- a/netlink_route.c
+++ b/netlink_route.c
@@ -30,6 +30,8 @@
 #include "defs.h"
 #include "netlink.h"
 
+#include "xlat/nl_route_types.h"
+
 static void
 decode_family(struct tcb *const tcp, const uint8_t family,
 	      const kernel_ulong_t addr, const unsigned int len)
-- 
2.7.4





More information about the Strace-devel mailing list