lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20171108230023.2656-1-stephen@networkplumber.org>
Date:   Thu,  9 Nov 2017 08:00:23 +0900
From:   Stephen Hemminger <stephen@...workplumber.org>
To:     netdev@...r.kernel.org
Cc:     Stephen Hemminger <stephen@...workplumber.org>
Subject: [PATCH iproute2] include file cleanup

This cleans up the #include usage in the code.
Started with IncludeWhatYouUse to identify extra include
and add missing ones. The most common extra include was syslog.h
which is only used by arpd. I suspect lots of this was just copy/paste
from one file to next.

Drop the linux/param.h which was no longer used anywhere in current code.

Signed-off-by: Stephen Hemminger <stephen@...workplumber.org>
---
 bridge/fdb.c                         |  1 -
 bridge/link.c                        |  1 -
 bridge/mdb.c                         |  1 -
 bridge/monitor.c                     |  1 -
 bridge/vlan.c                        |  2 --
 devlink/devlink.c                    |  1 +
 genl/ctrl.c                          |  3 ---
 genl/genl.c                          |  3 ---
 include/libiptc/ipt_kernel_headers.h |  1 -
 include/uapi/linux/param.h           |  6 ------
 include/xtables.h                    |  1 -
 ip/ip.c                              |  3 ---
 ip/ip6tunnel.c                       |  1 +
 ip/ipaddress.c                       |  2 --
 ip/ipaddrlabel.c                     |  3 ---
 ip/ipila.c                           |  1 +
 ip/iplink.c                          | 12 +++++-------
 ip/iplink_bridge.c                   |  1 -
 ip/iplink_bridge_slave.c             |  1 -
 ip/iplink_geneve.c                   |  3 +++
 ip/iplink_vxlan.c                    |  2 ++
 ip/ipmacsec.c                        |  1 +
 ip/ipmaddr.c                         |  3 ---
 ip/ipmonitor.c                       |  3 ---
 ip/ipmroute.c                        |  3 ---
 ip/ipneigh.c                         |  3 ---
 ip/ipnetconf.c                       |  3 ---
 ip/ipnetns.c                         |  2 +-
 ip/iproute.c                         |  6 +++---
 ip/iproute_lwtunnel.c                | 20 +++++++++++---------
 ip/iprule.c                          |  3 ---
 ip/iptoken.c                         |  3 ---
 ip/iptunnel.c                        |  2 +-
 ip/ipxfrm.c                          |  1 +
 ip/link_gre.c                        |  1 +
 ip/link_gre6.c                       |  5 ++++-
 ip/link_ip6tnl.c                     | 13 +++++++++----
 ip/link_iptnl.c                      | 12 +++++++++---
 ip/link_vti.c                        | 14 +++++++++-----
 ip/link_vti6.c                       | 15 +++++++++------
 ip/rtm_map.c                         |  3 ---
 ip/rtmon.c                           |  3 ---
 lib/bpf.c                            |  8 +++-----
 lib/dnet_ntop.c                      |  2 +-
 lib/dnet_pton.c                      |  2 +-
 lib/exec.c                           |  4 +++-
 lib/fs.c                             |  1 -
 lib/inet_proto.c                     |  3 ---
 lib/ipx_ntop.c                       |  1 +
 lib/ipx_pton.c                       |  1 -
 lib/libgenl.c                        |  4 ++--
 lib/libnetlink.c                     |  8 ++++----
 lib/ll_addr.c                        |  3 ---
 lib/ll_map.c                         |  8 ++++----
 lib/ll_proto.c                       | 10 ++--------
 lib/ll_types.c                       | 11 -----------
 lib/mpls_ntop.c                      |  3 ++-
 lib/mpls_pton.c                      |  2 --
 lib/namespace.c                      |  8 +++++++-
 lib/rt_names.c                       |  7 +------
 lib/utils.c                          |  7 ++-----
 misc/arpd.c                          |  1 -
 misc/ifstat.c                        |  1 -
 misc/nstat.c                         |  1 -
 misc/rtacct.c                        |  1 -
 misc/ss.c                            |  2 --
 tc/em_canid.c                        |  4 ----
 tc/em_cmp.c                          |  4 ----
 tc/em_meta.c                         |  4 ----
 tc/em_nbyte.c                        |  4 ----
 tc/em_u32.c                          |  3 ---
 tc/f_basic.c                         |  4 ----
 tc/f_flow.c                          |  1 +
 tc/f_flower.c                        |  2 +-
 tc/f_fw.c                            |  4 ----
 tc/f_matchall.c                      |  4 ----
 tc/f_route.c                         |  4 ----
 tc/f_rsvp.c                          |  2 --
 tc/f_tcindex.c                       |  3 ---
 tc/f_u32.c                           |  2 --
 tc/m_action.c                        |  4 ----
 tc/m_ematch.c                        |  4 ----
 tc/m_estimator.c                     |  4 ----
 tc/m_gact.c                          |  4 ----
 tc/m_ife.c                           |  4 ----
 tc/m_ipt.c                           |  4 ----
 tc/m_mirred.c                        |  4 ----
 tc/m_nat.c                           |  3 ---
 tc/m_pedit.c                         |  3 ---
 tc/m_pedit.h                         |  4 ----
 tc/m_police.c                        |  4 ----
 tc/m_simple.c                        |  4 ----
 tc/m_skbmod.c                        |  4 ----
 tc/m_vlan.c                          |  4 +++-
 tc/m_xt.c                            |  4 ----
 tc/m_xt_old.c                        |  4 ----
 tc/p_eth.c                           |  4 ----
 tc/p_icmp.c                          |  4 ----
 tc/p_ip.c                            |  4 ----
 tc/p_ip6.c                           |  4 ----
 tc/p_tcp.c                           |  4 ----
 tc/p_udp.c                           |  4 ----
 tc/q_atm.c                           |  4 ----
 tc/q_cbq.c                           |  4 ----
 tc/q_choke.c                         |  4 ----
 tc/q_codel.c                         |  4 ----
 tc/q_drr.c                           |  4 ----
 tc/q_dsmark.c                        |  4 ----
 tc/q_fifo.c                          |  4 ----
 tc/q_fq.c                            |  4 ----
 tc/q_fq_codel.c                      |  4 ----
 tc/q_gred.c                          |  4 ----
 tc/q_hfsc.c                          |  4 ----
 tc/q_hhf.c                           |  4 ----
 tc/q_htb.c                           |  4 ----
 tc/q_mqprio.c                        |  4 ----
 tc/q_multiq.c                        |  4 ----
 tc/q_netem.c                         |  4 ----
 tc/q_pie.c                           |  4 ----
 tc/q_prio.c                          |  4 ----
 tc/q_qfq.c                           |  4 ----
 tc/q_red.c                           |  4 ----
 tc/q_rr.c                            |  4 ----
 tc/q_sfb.c                           |  4 ----
 tc/q_sfq.c                           |  4 ----
 tc/q_tbf.c                           |  4 ----
 tc/tc.c                              |  3 ---
 tc/tc_cbq.c                          |  4 ----
 tc/tc_class.c                        |  4 ----
 tc/tc_core.c                         |  4 ----
 tc/tc_estimator.c                    |  4 ----
 tc/tc_filter.c                       |  3 ---
 tc/tc_monitor.c                      |  4 ----
 tc/tc_qdisc.c                        |  4 ----
 tc/tc_red.c                          |  4 ----
 tc/tc_stab.c                         |  4 ----
 tc/tc_util.c                         |  4 ----
 tipc/bearer.c                        |  1 +
 138 files changed, 111 insertions(+), 427 deletions(-)
 delete mode 100644 include/uapi/linux/param.h

diff --git a/bridge/fdb.c b/bridge/fdb.c
index c2f654c4a062..996211fd3cf6 100644
--- a/bridge/fdb.c
+++ b/bridge/fdb.c
@@ -11,7 +11,6 @@
 #include <unistd.h>
 #include <netdb.h>
 #include <time.h>
-#include <fcntl.h>
 #include <sys/socket.h>
 #include <sys/time.h>
 #include <net/if.h>
diff --git a/bridge/link.c b/bridge/link.c
index 9e4206f5dba1..2952ce187e9d 100644
--- a/bridge/link.c
+++ b/bridge/link.c
@@ -5,7 +5,6 @@
 #include <time.h>
 #include <sys/socket.h>
 #include <sys/time.h>
-#include <netinet/in.h>
 #include <linux/if.h>
 #include <linux/if_bridge.h>
 #include <string.h>
diff --git a/bridge/mdb.c b/bridge/mdb.c
index 748091b8d83a..7d82d296b4c7 100644
--- a/bridge/mdb.c
+++ b/bridge/mdb.c
@@ -5,7 +5,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <fcntl.h>
 #include <sys/socket.h>
 #include <net/if.h>
 #include <netinet/in.h>
diff --git a/bridge/monitor.c b/bridge/monitor.c
index d294269e1092..5e2a808861dd 100644
--- a/bridge/monitor.c
+++ b/bridge/monitor.c
@@ -17,7 +17,6 @@
 #include <sys/socket.h>
 #include <sys/time.h>
 #include <net/if.h>
-#include <netinet/in.h>
 #include <linux/if_bridge.h>
 #include <linux/neighbour.h>
 #include <string.h>
diff --git a/bridge/vlan.c b/bridge/vlan.c
index ccd14bf4c5e3..dea18bb45e42 100644
--- a/bridge/vlan.c
+++ b/bridge/vlan.c
@@ -1,10 +1,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <fcntl.h>
 #include <sys/socket.h>
 #include <net/if.h>
-#include <netinet/in.h>
 #include <linux/if_bridge.h>
 #include <linux/if_ether.h>
 #include <json_writer.h>
diff --git a/devlink/devlink.c b/devlink/devlink.c
index 39cda0676317..7737e6eb665f 100644
--- a/devlink/devlink.c
+++ b/devlink/devlink.c
@@ -17,6 +17,7 @@
 #include <getopt.h>
 #include <limits.h>
 #include <errno.h>
+#include <netinet/in.h>
 #include <linux/genetlink.h>
 #include <linux/devlink.h>
 #include <libmnl/libmnl.h>
diff --git a/genl/ctrl.c b/genl/ctrl.c
index 448988eb90e2..ba5c521aee43 100644
--- a/genl/ctrl.c
+++ b/genl/ctrl.c
@@ -13,10 +13,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
 #include <arpa/inet.h>
 #include <string.h>
 
diff --git a/genl/genl.c b/genl/genl.c
index 747074b029a7..a3e85579b2f7 100644
--- a/genl/genl.c
+++ b/genl/genl.c
@@ -13,11 +13,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <dlfcn.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
 #include <arpa/inet.h>
 #include <string.h>
 #include <errno.h>
diff --git a/include/libiptc/ipt_kernel_headers.h b/include/libiptc/ipt_kernel_headers.h
index a5963e9441fc..42f8610948cd 100644
--- a/include/libiptc/ipt_kernel_headers.h
+++ b/include/libiptc/ipt_kernel_headers.h
@@ -6,7 +6,6 @@
 #include <limits.h>
 
 #include <netinet/ip.h>
-#include <netinet/in.h>
 #include <netinet/ip_icmp.h>
 #include <netinet/tcp.h>
 #include <netinet/udp.h>
diff --git a/include/uapi/linux/param.h b/include/uapi/linux/param.h
deleted file mode 100644
index 092e92f67b50..000000000000
--- a/include/uapi/linux/param.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef _LINUX_PARAM_H
-#define _LINUX_PARAM_H
-
-#include <asm/param.h>
-
-#endif
diff --git a/include/xtables.h b/include/xtables.h
index 978ae0d150f5..a9a52ab10977 100644
--- a/include/xtables.h
+++ b/include/xtables.h
@@ -12,7 +12,6 @@
 #include <stdbool.h>
 #include <stddef.h>
 #include <stdint.h>
-#include <netinet/in.h>
 #include <net/if.h>
 #include <linux/types.h>
 #include <linux/netfilter.h>
diff --git a/ip/ip.c b/ip/ip.c
index e66f69700105..66e4eb7f43b1 100644
--- a/ip/ip.c
+++ b/ip/ip.c
@@ -12,10 +12,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
 #include <string.h>
 #include <errno.h>
 
diff --git a/ip/ip6tunnel.c b/ip/ip6tunnel.c
index bc44bef7f030..e428c095ca0e 100644
--- a/ip/ip6tunnel.c
+++ b/ip/ip6tunnel.c
@@ -25,6 +25,7 @@
 #include <unistd.h>
 #include <sys/types.h>
 #include <sys/socket.h>
+#include <netinet/in.h>
 #include <arpa/inet.h>
 #include <sys/ioctl.h>
 #include <linux/ip.h>
diff --git a/ip/ipaddress.c b/ip/ipaddress.c
index 9e9a7e0a6477..182a568248b7 100644
--- a/ip/ipaddress.c
+++ b/ip/ipaddress.c
@@ -13,9 +13,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
 #include <inttypes.h>
-#include <fcntl.h>
 #include <sys/ioctl.h>
 #include <sys/socket.h>
 #include <sys/param.h>
diff --git a/ip/ipaddrlabel.c b/ip/ipaddrlabel.c
index 1d324dac0211..20fad48d1c38 100644
--- a/ip/ipaddrlabel.c
+++ b/ip/ipaddrlabel.c
@@ -26,10 +26,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
 #include <netinet/ip.h>
 #include <arpa/inet.h>
 #include <string.h>
diff --git a/ip/ipila.c b/ip/ipila.c
index 843cc1652589..d5489026301d 100644
--- a/ip/ipila.c
+++ b/ip/ipila.c
@@ -14,6 +14,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <net/if.h>
+#include <netinet/in.h>
 #include <linux/ila.h>
 #include <linux/genetlink.h>
 #include <linux/ip.h>
diff --git a/ip/iplink.c b/ip/iplink.c
index 6a96ea9ff56a..ece4e2aeb326 100644
--- a/ip/iplink.c
+++ b/ip/iplink.c
@@ -13,20 +13,18 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <dlfcn.h>
 #include <errno.h>
 #include <sys/socket.h>
-#include <linux/if.h>
-#include <linux/if_packet.h>
-#include <linux/if_ether.h>
-#include <linux/sockios.h>
 #include <netinet/in.h>
-#include <arpa/inet.h>
 #include <string.h>
 #include <sys/ioctl.h>
 #include <stdbool.h>
+#include <linux/if.h>
+#include <linux/sockios.h>
+#include <linux/if_packet.h>
+#include <linux/if_ether.h>
+#include <linux/if_link.h>
 #include <linux/mpls.h>
 
 #include "rt_names.h"
diff --git a/ip/iplink_bridge.c b/ip/iplink_bridge.c
index d3250980c68d..6e5502bb3764 100644
--- a/ip/iplink_bridge.c
+++ b/ip/iplink_bridge.c
@@ -12,7 +12,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <netinet/in.h>
 #include <netinet/ether.h>
 #include <linux/if_link.h>
 #include <linux/if_bridge.h>
diff --git a/ip/iplink_bridge_slave.c b/ip/iplink_bridge_slave.c
index 80272b094110..fc22bb36b68c 100644
--- a/ip/iplink_bridge_slave.c
+++ b/ip/iplink_bridge_slave.c
@@ -11,7 +11,6 @@
 
 #include <stdio.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
 #include <linux/if_link.h>
 #include <linux/if_bridge.h>
 
diff --git a/ip/iplink_geneve.c b/ip/iplink_geneve.c
index f0f1d1c76e3a..bef9956a0ea5 100644
--- a/ip/iplink_geneve.c
+++ b/ip/iplink_geneve.c
@@ -10,6 +10,9 @@
  */
 
 #include <stdio.h>
+#include <string.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
 
 #include "rt_names.h"
 #include "utils.h"
diff --git a/ip/iplink_vxlan.c b/ip/iplink_vxlan.c
index a0530dda9d1b..1a865959d181 100644
--- a/ip/iplink_vxlan.c
+++ b/ip/iplink_vxlan.c
@@ -12,6 +12,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
 #include <net/if.h>
 #include <linux/ip.h>
 #include <linux/if_link.h>
diff --git a/ip/ipmacsec.c b/ip/ipmacsec.c
index ecc371a51a20..806905a0ebf3 100644
--- a/ip/ipmacsec.c
+++ b/ip/ipmacsec.c
@@ -13,6 +13,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <errno.h>
+#include <netinet/in.h>
 #include <linux/genetlink.h>
 #include <linux/if_ether.h>
 #include <linux/if_macsec.h>
diff --git a/ip/ipmaddr.c b/ip/ipmaddr.c
index 46b86a3a7723..fa3861ef1bfe 100644
--- a/ip/ipmaddr.c
+++ b/ip/ipmaddr.c
@@ -13,11 +13,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/ioctl.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
 #include <arpa/inet.h>
 #include <string.h>
 
diff --git a/ip/ipmonitor.c b/ip/ipmonitor.c
index 3171d4712887..f28568a6153c 100644
--- a/ip/ipmonitor.c
+++ b/ip/ipmonitor.c
@@ -13,10 +13,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
 #include <arpa/inet.h>
 #include <string.h>
 #include <time.h>
diff --git a/ip/ipmroute.c b/ip/ipmroute.c
index b51c23cc50e2..8650f43905d3 100644
--- a/ip/ipmroute.c
+++ b/ip/ipmroute.c
@@ -13,12 +13,9 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <inttypes.h>
 #include <sys/ioctl.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
 #include <arpa/inet.h>
 #include <string.h>
 
diff --git a/ip/ipneigh.c b/ip/ipneigh.c
index 9c38a60ddf4f..d3f908165486 100644
--- a/ip/ipneigh.c
+++ b/ip/ipneigh.c
@@ -13,12 +13,9 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <string.h>
 #include <sys/time.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
 #include <netinet/ip.h>
 
 #include "rt_names.h"
diff --git a/ip/ipnetconf.c b/ip/ipnetconf.c
index 696e3dd51a1c..2fdbe63d2988 100644
--- a/ip/ipnetconf.c
+++ b/ip/ipnetconf.c
@@ -13,12 +13,9 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <string.h>
 #include <sys/time.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
 #include <errno.h>
 
 #include "rt_names.h"
diff --git a/ip/ipnetns.c b/ip/ipnetns.c
index bad7933188e6..6c53362992fc 100644
--- a/ip/ipnetns.c
+++ b/ip/ipnetns.c
@@ -1,6 +1,7 @@
 #define _ATFILE_SOURCE
 #include <sys/types.h>
 #include <sys/stat.h>
+#include <fcntl.h>
 #include <sys/wait.h>
 #include <sys/inotify.h>
 #include <sys/mount.h>
@@ -8,7 +9,6 @@
 #include <stdio.h>
 #include <string.h>
 #include <sched.h>
-#include <fcntl.h>
 #include <dirent.h>
 #include <errno.h>
 #include <unistd.h>
diff --git a/ip/iproute.c b/ip/iproute.c
index e81bc05ec16c..9e54c75f9f2c 100644
--- a/ip/iproute.c
+++ b/ip/iproute.c
@@ -13,13 +13,13 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <string.h>
 #include <time.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
 #include <sys/time.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
 #include <netinet/ip.h>
 #include <arpa/inet.h>
 #include <linux/in_route.h>
diff --git a/ip/iproute_lwtunnel.c b/ip/iproute_lwtunnel.c
index 1c8adbe78ed2..d19eeac84c03 100644
--- a/ip/iproute_lwtunnel.c
+++ b/ip/iproute_lwtunnel.c
@@ -13,24 +13,26 @@
 
 #include <stdio.h>
 #include <stdlib.h>
-#include <unistd.h>
-#include <fcntl.h>
 #include <string.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <net/if.h>
 #include <linux/ila.h>
+#include <linux/bpf.h>
+#include <linux/rtnetlink.h>
 #include <linux/lwtunnel.h>
 #include <linux/mpls_iptunnel.h>
-#include <errno.h>
+#include <linux/seg6.h>
+#include <linux/seg6_iptunnel.h>
+#include <linux/seg6_hmac.h>
+#include <linux/seg6_local.h>
 
-#include "rt_names.h"
 #include "utils.h"
+#include "libnetlink.h"
+#include "rt_names.h"
 #include "iproute_lwtunnel.h"
 #include "bpf_util.h"
 
-#include <linux/seg6.h>
-#include <linux/seg6_iptunnel.h>
-#include <linux/seg6_hmac.h>
-#include <linux/seg6_local.h>
-#include <net/if.h>
 
 static const char *format_encap_type(int type)
 {
diff --git a/ip/iprule.c b/ip/iprule.c
index 36c57fa70b74..e372838ea26b 100644
--- a/ip/iprule.c
+++ b/ip/iprule.c
@@ -13,10 +13,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
 #include <netinet/ip.h>
 #include <arpa/inet.h>
 #include <string.h>
diff --git a/ip/iptoken.c b/ip/iptoken.c
index 1869f764424f..d5badadb1ef0 100644
--- a/ip/iptoken.c
+++ b/ip/iptoken.c
@@ -13,11 +13,8 @@
 #include <stdlib.h>
 #include <stdbool.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <string.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
 #include <netinet/ip.h>
 #include <arpa/inet.h>
 #include <linux/types.h>
diff --git a/ip/iptunnel.c b/ip/iptunnel.c
index 208a1f06ab12..49ea902bedbe 100644
--- a/ip/iptunnel.c
+++ b/ip/iptunnel.c
@@ -13,9 +13,9 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <unistd.h>
 #include <sys/types.h>
 #include <sys/socket.h>
+#include <netinet/in.h>
 #include <arpa/inet.h>
 #include <sys/ioctl.h>
 #include <net/if.h>
diff --git a/ip/ipxfrm.c b/ip/ipxfrm.c
index 12c2f721571b..18ec39ff6eab 100644
--- a/ip/ipxfrm.c
+++ b/ip/ipxfrm.c
@@ -30,6 +30,7 @@
 #include <string.h>
 #include <sys/types.h>
 #include <sys/socket.h>
+#include <netinet/in.h>
 #include <time.h>
 #include <netdb.h>
 #include <linux/netlink.h>
diff --git a/ip/link_gre.c b/ip/link_gre.c
index 9ea2970cadc2..dc5d570bb3e3 100644
--- a/ip/link_gre.c
+++ b/ip/link_gre.c
@@ -14,6 +14,7 @@
 #include <net/if.h>
 #include <sys/types.h>
 #include <sys/socket.h>
+#include <netinet/in.h>
 #include <arpa/inet.h>
 
 #include <linux/ip.h>
diff --git a/ip/link_gre6.c b/ip/link_gre6.c
index 7d07932a60f0..95a9af8a1ec3 100644
--- a/ip/link_gre6.c
+++ b/ip/link_gre6.c
@@ -10,16 +10,19 @@
  *
  */
 
+#include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 #include <net/if.h>
 #include <sys/types.h>
 #include <sys/socket.h>
+#include <netinet/in.h>
 #include <arpa/inet.h>
 
-#include <linux/ip.h>
 #include <linux/if_tunnel.h>
 #include <linux/ip6_tunnel.h>
 
+#include "libnetlink.h"
 #include "rt_names.h"
 #include "utils.h"
 #include "ip_common.h"
diff --git a/ip/link_ip6tnl.c b/ip/link_ip6tnl.c
index a41990068f0f..760062e83cc7 100644
--- a/ip/link_ip6tnl.c
+++ b/ip/link_ip6tnl.c
@@ -10,19 +10,24 @@
  *
  */
 
+#include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 #include <net/if.h>
 #include <sys/types.h>
 #include <sys/socket.h>
-#include <arpa/inet.h>
+#include <netinet/in.h>
 
-#include <linux/ip.h>
+#include <linux/netlink.h>
+#include <linux/rtnetlink.h>
+#include <linux/if_link.h>
 #include <linux/if_tunnel.h>
 #include <linux/ip6_tunnel.h>
-#include "rt_names.h"
+
 #include "utils.h"
+#include "json_print.h"
+#include "libnetlink.h"
 #include "ip_common.h"
-#include "tunnel.h"
 
 #define IP6_FLOWINFO_TCLASS	htonl(0x0FF00000)
 #define IP6_FLOWINFO_FLOWLABEL	htonl(0x000FFFFF)
diff --git a/ip/link_iptnl.c b/ip/link_iptnl.c
index 6a725e91ea70..40048b9b4fae 100644
--- a/ip/link_iptnl.c
+++ b/ip/link_iptnl.c
@@ -10,19 +10,25 @@
  *
  */
 
+#include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 #include <net/if.h>
 #include <sys/types.h>
 #include <sys/socket.h>
+#include <netinet/in.h>
 #include <arpa/inet.h>
 
-#include <linux/in.h>
-#include <linux/ip.h>
+#include <linux/netlink.h>
+#include <linux/rtnetlink.h>
+#include <linux/if_link.h>
 #include <linux/if_tunnel.h>
+
+#include "json_print.h"
+#include "libnetlink.h"
 #include "rt_names.h"
 #include "utils.h"
 #include "ip_common.h"
-#include "tunnel.h"
 
 static void print_usage(FILE *f, int sit)
 {
diff --git a/ip/link_vti.c b/ip/link_vti.c
index 8bd4d90059fc..ef0b5f9985ee 100644
--- a/ip/link_vti.c
+++ b/ip/link_vti.c
@@ -10,18 +10,22 @@
  *          Saurabh Mohan <saurabh.mohan@...tta.com> Modified link_gre.c for VTI
  */
 
+#include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 #include <net/if.h>
 #include <sys/types.h>
 #include <sys/socket.h>
-#include <arpa/inet.h>
-
-#include <linux/ip.h>
+#include <netinet/in.h>
+#include <linux/netlink.h>
+#include <linux/rtnetlink.h>
+#include <linux/if_link.h>
 #include <linux/if_tunnel.h>
-#include "rt_names.h"
+
+#include "json_print.h"
+#include "libnetlink.h"
 #include "utils.h"
 #include "ip_common.h"
-#include "tunnel.h"
 
 
 static void print_usage(FILE *f)
diff --git a/ip/link_vti6.c b/ip/link_vti6.c
index 8198d4680b93..854f47f68d2e 100644
--- a/ip/link_vti6.c
+++ b/ip/link_vti6.c
@@ -11,19 +11,22 @@
  *		Steffen Klassert <steffen.klassert@...unet.com> Modified link_vti.c for IPv6
  */
 
+#include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 #include <net/if.h>
 #include <sys/types.h>
 #include <sys/socket.h>
-#include <arpa/inet.h>
-
-#include <linux/ip.h>
+#include <netinet/in.h>
+#include <linux/netlink.h>
+#include <linux/rtnetlink.h>
+#include <linux/if_link.h>
 #include <linux/if_tunnel.h>
-#include "rt_names.h"
+
+#include "json_print.h"
+#include "libnetlink.h"
 #include "utils.h"
 #include "ip_common.h"
-#include "tunnel.h"
-
 
 static void usage(void) __attribute__((noreturn));
 static void usage(void)
diff --git a/ip/rtm_map.c b/ip/rtm_map.c
index 1d7d2c7efa18..8a09b58693b6 100644
--- a/ip/rtm_map.c
+++ b/ip/rtm_map.c
@@ -13,11 +13,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <string.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
 
 #include "rt_names.h"
 #include "utils.h"
diff --git a/ip/rtmon.c b/ip/rtmon.c
index 1c2981f79d3d..7111bf30f810 100644
--- a/ip/rtmon.c
+++ b/ip/rtmon.c
@@ -13,11 +13,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/socket.h>
 #include <sys/time.h>
-#include <netinet/in.h>
 #include <string.h>
 
 #include "SNAPSHOT.h"
diff --git a/lib/bpf.c b/lib/bpf.c
index 10ea23a471ef..b052669d11bb 100644
--- a/lib/bpf.c
+++ b/lib/bpf.c
@@ -18,7 +18,6 @@
 #include <stdbool.h>
 #include <stdint.h>
 #include <errno.h>
-#include <fcntl.h>
 #include <stdarg.h>
 #include <limits.h>
 #include <assert.h>
@@ -30,14 +29,13 @@
 
 #include <sys/types.h>
 #include <sys/stat.h>
-#include <sys/un.h>
+#include <fcntl.h>
 #include <sys/vfs.h>
+#include <sys/un.h>
 #include <sys/mount.h>
-#include <sys/syscall.h>
 #include <sys/sendfile.h>
 #include <sys/resource.h>
-
-#include <arpa/inet.h>
+#include <netinet/in.h>
 
 #include "utils.h"
 #include "json_print.h"
diff --git a/lib/dnet_ntop.c b/lib/dnet_ntop.c
index 112dc0d90591..563f4e68df43 100644
--- a/lib/dnet_ntop.c
+++ b/lib/dnet_ntop.c
@@ -1,7 +1,7 @@
 #include <errno.h>
 #include <string.h>
 #include <sys/types.h>
-#include <netinet/in.h>
+#include <sys/socket.h>
 
 #include "utils.h"
 
diff --git a/lib/dnet_pton.c b/lib/dnet_pton.c
index 73857562be02..0ccfd4e4e548 100644
--- a/lib/dnet_pton.c
+++ b/lib/dnet_pton.c
@@ -1,7 +1,7 @@
 #include <errno.h>
 #include <string.h>
 #include <sys/types.h>
-#include <netinet/in.h>
+#include <sys/socket.h>
 
 #include "utils.h"
 
diff --git a/lib/exec.c b/lib/exec.c
index 97c991202aea..c7db8642772f 100644
--- a/lib/exec.c
+++ b/lib/exec.c
@@ -1,5 +1,7 @@
-#include <sys/wait.h>
 #include <stdio.h>
+#include <stdlib.h>    // for exit
+#include <string.h>    // for strerror
+#include <sys/wait.h>
 #include <errno.h>
 #include <unistd.h>
 
diff --git a/lib/fs.c b/lib/fs.c
index 86efd4ed2ed8..7e3dcdb81e6d 100644
--- a/lib/fs.c
+++ b/lib/fs.c
@@ -15,7 +15,6 @@
 #include <sys/socket.h>
 #include <sys/mount.h>
 #include <ctype.h>
-#include <fcntl.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
diff --git a/lib/inet_proto.c b/lib/inet_proto.c
index bdfd52fdafe5..90eb3ef1ecfb 100644
--- a/lib/inet_proto.c
+++ b/lib/inet_proto.c
@@ -13,10 +13,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
 #include <netdb.h>
 #include <string.h>
 
diff --git a/lib/ipx_ntop.c b/lib/ipx_ntop.c
index 5f646b3e0ec4..a448f8a516ac 100644
--- a/lib/ipx_ntop.c
+++ b/lib/ipx_ntop.c
@@ -1,3 +1,4 @@
+#include <stddef.h>
 #include <errno.h>
 #include <sys/types.h>
 #include <sys/socket.h>
diff --git a/lib/ipx_pton.c b/lib/ipx_pton.c
index 071a775e7437..ae0a0d18b7ac 100644
--- a/lib/ipx_pton.c
+++ b/lib/ipx_pton.c
@@ -2,7 +2,6 @@
 #include <string.h>
 #include <sys/types.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
 
 #include "utils.h"
 
diff --git a/lib/libgenl.c b/lib/libgenl.c
index 50d2d9217dcb..7878bc772af9 100644
--- a/lib/libgenl.c
+++ b/lib/libgenl.c
@@ -3,9 +3,9 @@
  */
 
 #include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
+#include <string.h>
 
+#include <linux/netlink.h>
 #include <linux/genetlink.h>
 #include "libgenl.h"
 
diff --git a/lib/libnetlink.c b/lib/libnetlink.c
index be7ac8658fa5..ec504fdc0a71 100644
--- a/lib/libnetlink.c
+++ b/lib/libnetlink.c
@@ -13,16 +13,16 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdbool.h>
+#include <stdint.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
-#include <net/if_arp.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
 #include <string.h>
 #include <errno.h>
 #include <time.h>
 #include <sys/uio.h>
+#include <linux/if_link.h>
+#include <linux/netlink.h>
+#include <linux/rtnetlink.h>
 
 #include "libnetlink.h"
 
diff --git a/lib/ll_addr.c b/lib/ll_addr.c
index 5b5caf3dbab8..35324f2f4450 100644
--- a/lib/ll_addr.c
+++ b/lib/ll_addr.c
@@ -12,11 +12,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/ioctl.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
 #include <arpa/inet.h>
 #include <string.h>
 
diff --git a/lib/ll_map.c b/lib/ll_map.c
index 70684b02042b..f8ae365b176b 100644
--- a/lib/ll_map.c
+++ b/lib/ll_map.c
@@ -13,12 +13,12 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
 #include <string.h>
 #include <net/if.h>
+#include <sys/socket.h>
+#include <linux/if_link.h>
+#include <linux/netlink.h>
+#include <linux/rtnetlink.h>
 
 #include "libnetlink.h"
 #include "ll_map.h"
diff --git a/lib/ll_proto.c b/lib/ll_proto.c
index ef5a5b7bbb50..a0299992a618 100644
--- a/lib/ll_proto.c
+++ b/lib/ll_proto.c
@@ -12,17 +12,11 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
+
 #include <sys/ioctl.h>
-#include <sys/socket.h>
 #include <netinet/in.h>
-#include <arpa/inet.h>
 #include <string.h>
-
-#include <linux/netdevice.h>
-#include <linux/if_arp.h>
-#include <linux/sockios.h>
+#include <linux/if_ether.h>
 
 #include "utils.h"
 #include "rt_names.h"
diff --git a/lib/ll_types.c b/lib/ll_types.c
index 8f294515be6f..4e278eef1d56 100644
--- a/lib/ll_types.c
+++ b/lib/ll_types.c
@@ -10,19 +10,8 @@
  */
 
 #include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
-#include <sys/ioctl.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 #include <string.h>
-
-#include <linux/netdevice.h>
 #include <linux/if_arp.h>
-#include <linux/sockios.h>
 
 #include "rt_names.h"
 
diff --git a/lib/mpls_ntop.c b/lib/mpls_ntop.c
index 5902f5037b13..d81c5bbd084e 100644
--- a/lib/mpls_ntop.c
+++ b/lib/mpls_ntop.c
@@ -1,6 +1,7 @@
 #include <errno.h>
 #include <string.h>
-#include <sys/types.h>
+#include <stdint.h>
+#include <sys/socket.h>
 #include <netinet/in.h>
 #include <linux/mpls.h>
 
diff --git a/lib/mpls_pton.c b/lib/mpls_pton.c
index 6d2e6a69436a..5d7ed9e4dee8 100644
--- a/lib/mpls_pton.c
+++ b/lib/mpls_pton.c
@@ -1,6 +1,4 @@
 #include <errno.h>
-#include <string.h>
-#include <sys/types.h>
 #include <netinet/in.h>
 #include <linux/mpls.h>
 
diff --git a/lib/namespace.c b/lib/namespace.c
index 30b513889e6e..91b5540b6f87 100644
--- a/lib/namespace.c
+++ b/lib/namespace.c
@@ -7,8 +7,14 @@
  *		2 of the License, or (at your option) any later version.
  */
 
-#include <fcntl.h>
+#include <stdio.h>
 #include <dirent.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <sched.h>
+#include <string.h>
+#include <sys/mount.h>
+#include <unistd.h>
 #include <limits.h>
 
 #include "utils.h"
diff --git a/lib/rt_names.c b/lib/rt_names.c
index e5efd78e6f81..88fafe3b3753 100644
--- a/lib/rt_names.c
+++ b/lib/rt_names.c
@@ -11,20 +11,15 @@
 
 #include <stdio.h>
 #include <stdlib.h>
-#include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <string.h>
-#include <sys/time.h>
-#include <sys/socket.h>
 #include <dirent.h>
 #include <limits.h>
 
 #include <asm/types.h>
+#include <linux/netlink.h>
 #include <linux/rtnetlink.h>
 
 #include "rt_names.h"
-#include "utils.h"
 
 #define NAME_MAX_LEN 512
 
diff --git a/lib/utils.c b/lib/utils.c
index ac155bf5a044..23d3ebf0a2ed 100644
--- a/lib/utils.c
+++ b/lib/utils.c
@@ -14,18 +14,15 @@
 #include <stdlib.h>
 #include <math.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <limits.h>
+#include <stdint.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <string.h>
-#include <ctype.h>
 #include <netdb.h>
 #include <arpa/inet.h>
 #include <asm/types.h>
-#include <linux/pkt_sched.h>
-#include <linux/param.h>
+#include <asm/param.h>
 #include <linux/if_arp.h>
 #include <linux/mpls.h>
 #include <time.h>
diff --git a/misc/arpd.c b/misc/arpd.c
index c2666f76fd5e..8f38ea7b09e3 100644
--- a/misc/arpd.c
+++ b/misc/arpd.c
@@ -20,7 +20,6 @@
 #include <sys/ioctl.h>
 #include <sys/poll.h>
 #include <errno.h>
-#include <fcntl.h>
 #include <sys/uio.h>
 #include <sys/socket.h>
 #include <sys/time.h>
diff --git a/misc/ifstat.c b/misc/ifstat.c
index ac3eff6b870a..8ada31347b86 100644
--- a/misc/ifstat.c
+++ b/misc/ifstat.c
@@ -12,7 +12,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <fcntl.h>
 #include <string.h>
 #include <errno.h>
 #include <time.h>
diff --git a/misc/nstat.c b/misc/nstat.c
index a4dd405d43a9..bcb84c3a34d5 100644
--- a/misc/nstat.c
+++ b/misc/nstat.c
@@ -12,7 +12,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <fcntl.h>
 #include <string.h>
 #include <errno.h>
 #include <time.h>
diff --git a/misc/rtacct.c b/misc/rtacct.c
index b1cb378818ab..48ab9159e135 100644
--- a/misc/rtacct.c
+++ b/misc/rtacct.c
@@ -13,7 +13,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <fcntl.h>
 #include <string.h>
 #include <errno.h>
 #include <time.h>
diff --git a/misc/ss.c b/misc/ss.c
index 56a9ad415ce1..31a550ee2001 100644
--- a/misc/ss.c
+++ b/misc/ss.c
@@ -12,8 +12,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/ioctl.h>
 #include <sys/socket.h>
 #include <sys/uio.h>
diff --git a/tc/em_canid.c b/tc/em_canid.c
index ceb64cb933f5..6cc6bd51a98c 100644
--- a/tc/em_canid.c
+++ b/tc/em_canid.c
@@ -20,11 +20,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 #include <string.h>
 #include <errno.h>
 #include <linux/can.h>
diff --git a/tc/em_cmp.c b/tc/em_cmp.c
index 8ea0accfb3e1..ae7707142a62 100644
--- a/tc/em_cmp.c
+++ b/tc/em_cmp.c
@@ -12,11 +12,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 #include <string.h>
 #include <errno.h>
 
diff --git a/tc/em_meta.c b/tc/em_meta.c
index bf47093799f4..d83e515a7eb7 100644
--- a/tc/em_meta.c
+++ b/tc/em_meta.c
@@ -12,11 +12,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 #include <string.h>
 #include <errno.h>
 
diff --git a/tc/em_nbyte.c b/tc/em_nbyte.c
index 52b4d10a13e2..f4e5fc337954 100644
--- a/tc/em_nbyte.c
+++ b/tc/em_nbyte.c
@@ -12,11 +12,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 #include <string.h>
 #include <errno.h>
 
diff --git a/tc/em_u32.c b/tc/em_u32.c
index 869ebde0f424..f9c01713fc4a 100644
--- a/tc/em_u32.c
+++ b/tc/em_u32.c
@@ -12,11 +12,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
-#include <arpa/inet.h>
 #include <string.h>
 #include <errno.h>
 
diff --git a/tc/f_basic.c b/tc/f_basic.c
index 8370ea604326..77e1ca1974c3 100644
--- a/tc/f_basic.c
+++ b/tc/f_basic.c
@@ -13,11 +13,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 #include <string.h>
 #include <linux/if.h>
 
diff --git a/tc/f_flow.c b/tc/f_flow.c
index b15710497d12..4b1b7530f6b0 100644
--- a/tc/f_flow.c
+++ b/tc/f_flow.c
@@ -13,6 +13,7 @@
 #include <unistd.h>
 #include <string.h>
 #include <errno.h>
+#include <netinet/in.h>
 
 #include "utils.h"
 #include "tc_util.h"
diff --git a/tc/f_flower.c b/tc/f_flower.c
index b18021071739..b4ce4cd1b1b3 100644
--- a/tc/f_flower.c
+++ b/tc/f_flower.c
@@ -12,9 +12,9 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
 #include <string.h>
 #include <net/if.h>
+#include <netinet/in.h>
 #include <linux/if_arp.h>
 #include <linux/if_ether.h>
 #include <linux/ip.h>
diff --git a/tc/f_fw.c b/tc/f_fw.c
index c39789b345f4..a8bf6b73a562 100644
--- a/tc/f_fw.c
+++ b/tc/f_fw.c
@@ -13,11 +13,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 #include <string.h>
 #include <linux/if.h> /* IFNAMSIZ */
 #include "utils.h"
diff --git a/tc/f_matchall.c b/tc/f_matchall.c
index d78660e79dbe..a8d715e53fc5 100644
--- a/tc/f_matchall.c
+++ b/tc/f_matchall.c
@@ -13,11 +13,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 #include <string.h>
 #include <linux/if.h>
 
diff --git a/tc/f_route.c b/tc/f_route.c
index e88313f6a7d5..c3b8fb9c157f 100644
--- a/tc/f_route.c
+++ b/tc/f_route.c
@@ -13,11 +13,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 #include <string.h>
 
 #include "utils.h"
diff --git a/tc/f_rsvp.c b/tc/f_rsvp.c
index 65caeb42bfe4..526407fbc1f6 100644
--- a/tc/f_rsvp.c
+++ b/tc/f_rsvp.c
@@ -13,8 +13,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
diff --git a/tc/f_tcindex.c b/tc/f_tcindex.c
index dd1cb475098c..413f45179208 100644
--- a/tc/f_tcindex.c
+++ b/tc/f_tcindex.c
@@ -7,10 +7,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <string.h>
-#include <netinet/in.h>
 
 #include "utils.h"
 #include "tc_util.h"
diff --git a/tc/f_u32.c b/tc/f_u32.c
index 14b958896088..8057fab65278 100644
--- a/tc/f_u32.c
+++ b/tc/f_u32.c
@@ -14,8 +14,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
diff --git a/tc/m_action.c b/tc/m_action.c
index 402228bbf833..f4e610444010 100644
--- a/tc/m_action.c
+++ b/tc/m_action.c
@@ -16,11 +16,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 #include <string.h>
 #include <dlfcn.h>
 
diff --git a/tc/m_ematch.c b/tc/m_ematch.c
index e18a395b048e..dde7c829a9d6 100644
--- a/tc/m_ematch.c
+++ b/tc/m_ematch.c
@@ -12,11 +12,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 #include <string.h>
 #include <dlfcn.h>
 #include <stdarg.h>
diff --git a/tc/m_estimator.c b/tc/m_estimator.c
index 87745cc2d4d6..c6052337887c 100644
--- a/tc/m_estimator.c
+++ b/tc/m_estimator.c
@@ -13,11 +13,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 #include <string.h>
 
 #include "utils.h"
diff --git a/tc/m_gact.c b/tc/m_gact.c
index 38949e903be3..4af2142d82fc 100644
--- a/tc/m_gact.c
+++ b/tc/m_gact.c
@@ -13,11 +13,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 #include <string.h>
 
 #include "utils.h"
diff --git a/tc/m_ife.c b/tc/m_ife.c
index 8d0fd31fb944..49f38bcaa3ba 100644
--- a/tc/m_ife.c
+++ b/tc/m_ife.c
@@ -13,11 +13,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 #include <string.h>
 #include <linux/netdevice.h>
 
diff --git a/tc/m_ipt.c b/tc/m_ipt.c
index 1b935ec0b266..d59deabca193 100644
--- a/tc/m_ipt.c
+++ b/tc/m_ipt.c
@@ -10,10 +10,7 @@
  * Authors:  J Hadi Salim (hadi@...erus.ca)
  */
 
-#include <syslog.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 #include <iptables.h>
 #include <linux/netfilter.h>
 #include <linux/netfilter_ipv4/ip_tables.h>
@@ -30,7 +27,6 @@
 #include <ctype.h>
 #include <stdarg.h>
 #include <unistd.h>
-#include <fcntl.h>
 #include <sys/wait.h>
 
 static const char *pname = "tc-ipt";
diff --git a/tc/m_mirred.c b/tc/m_mirred.c
index 2384bda1ff04..8e714e5f8722 100644
--- a/tc/m_mirred.c
+++ b/tc/m_mirred.c
@@ -15,11 +15,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 #include <string.h>
 #include "utils.h"
 #include "tc_util.h"
diff --git a/tc/m_nat.c b/tc/m_nat.c
index 31b68fb6bd78..b84b5b177d80 100644
--- a/tc/m_nat.c
+++ b/tc/m_nat.c
@@ -13,11 +13,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
-#include <arpa/inet.h>
 #include <string.h>
 #include "utils.h"
 #include "tc_util.h"
diff --git a/tc/m_pedit.c b/tc/m_pedit.c
index 5d89ab1d832a..d3c1e5e6362e 100644
--- a/tc/m_pedit.c
+++ b/tc/m_pedit.c
@@ -18,11 +18,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
-#include <arpa/inet.h>
 #include <string.h>
 #include <dlfcn.h>
 #include "utils.h"
diff --git a/tc/m_pedit.h b/tc/m_pedit.h
index 0bc0297100f0..6089a3745a87 100644
--- a/tc/m_pedit.h
+++ b/tc/m_pedit.h
@@ -16,11 +16,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 #include <string.h>
 #include "utils.h"
 #include "tc_util.h"
diff --git a/tc/m_police.c b/tc/m_police.c
index 86117db0482e..f1226278b89c 100644
--- a/tc/m_police.c
+++ b/tc/m_police.c
@@ -16,11 +16,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 #include <string.h>
 
 #include "utils.h"
diff --git a/tc/m_simple.c b/tc/m_simple.c
index f8937bcabb7a..e1d97a76b705 100644
--- a/tc/m_simple.c
+++ b/tc/m_simple.c
@@ -66,11 +66,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 #include <string.h>
 #include "utils.h"
 #include "tc_util.h"
diff --git a/tc/m_skbmod.c b/tc/m_skbmod.c
index ba79308ba835..6337559bbf7b 100644
--- a/tc/m_skbmod.c
+++ b/tc/m_skbmod.c
@@ -13,11 +13,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 #include <string.h>
 #include <linux/netdevice.h>
 
diff --git a/tc/m_vlan.c b/tc/m_vlan.c
index cccb4996b05f..53d0c8f6b137 100644
--- a/tc/m_vlan.c
+++ b/tc/m_vlan.c
@@ -13,11 +13,13 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <string.h>
+#include <netinet/in.h>
 #include <linux/if_ether.h>
+#include <linux/tc_act/tc_vlan.h>
+
 #include "utils.h"
 #include "rt_names.h"
 #include "tc_util.h"
-#include <linux/tc_act/tc_vlan.h>
 
 static const char * const action_names[] = {
 	[TCA_VLAN_ACT_POP] = "pop",
diff --git a/tc/m_xt.c b/tc/m_xt.c
index 9218b1459440..eedccf7ef263 100644
--- a/tc/m_xt.c
+++ b/tc/m_xt.c
@@ -10,10 +10,7 @@
  * Authors:  J Hadi Salim (hadi@...erus.ca)
  */
 
-#include <syslog.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 #include <net/if.h>
 #include <limits.h>
 #include <linux/netfilter.h>
@@ -32,7 +29,6 @@
 #include <ctype.h>
 #include <stdarg.h>
 #include <unistd.h>
-#include <fcntl.h>
 #include <sys/wait.h>
 #ifndef XT_LIB_DIR
 #       define XT_LIB_DIR "/lib/xtables"
diff --git a/tc/m_xt_old.c b/tc/m_xt_old.c
index e9cc624ecd93..548f63bd60e3 100644
--- a/tc/m_xt_old.c
+++ b/tc/m_xt_old.c
@@ -13,10 +13,7 @@
 /*XXX: in the future (xtables 1.4.3?) get rid of everything tagged
  * as TC_CONFIG_XT_H */
 
-#include <syslog.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 #include <net/if.h>
 #include <linux/netfilter.h>
 #include <linux/netfilter_ipv4/ip_tables.h>
@@ -34,7 +31,6 @@
 #include <stdarg.h>
 #include <limits.h>
 #include <unistd.h>
-#include <fcntl.h>
 #include <sys/wait.h>
 #ifdef TC_CONFIG_XT_H
 #include "xt-internal.h"
diff --git a/tc/p_eth.c b/tc/p_eth.c
index 2d2f96ca2f0f..5717c005c718 100644
--- a/tc/p_eth.c
+++ b/tc/p_eth.c
@@ -13,11 +13,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 #include <string.h>
 #include "utils.h"
 #include "tc_util.h"
diff --git a/tc/p_icmp.c b/tc/p_icmp.c
index 1c3a5d90006d..13db8be65682 100644
--- a/tc/p_icmp.c
+++ b/tc/p_icmp.c
@@ -13,11 +13,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 #include <string.h>
 #include "utils.h"
 #include "tc_util.h"
diff --git a/tc/p_ip.c b/tc/p_ip.c
index 0272a6eaaf48..b38fd9226a6b 100644
--- a/tc/p_ip.c
+++ b/tc/p_ip.c
@@ -13,11 +13,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 #include <string.h>
 #include "utils.h"
 #include "tc_util.h"
diff --git a/tc/p_ip6.c b/tc/p_ip6.c
index a4824bda90e8..2d3d6cd518d0 100644
--- a/tc/p_ip6.c
+++ b/tc/p_ip6.c
@@ -13,11 +13,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 #include <string.h>
 #include "utils.h"
 #include "tc_util.h"
diff --git a/tc/p_tcp.c b/tc/p_tcp.c
index cf14574c9c3e..196d5be60820 100644
--- a/tc/p_tcp.c
+++ b/tc/p_tcp.c
@@ -13,11 +13,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 #include <string.h>
 #include "utils.h"
 #include "tc_util.h"
diff --git a/tc/p_udp.c b/tc/p_udp.c
index 3916d9586040..24632d0902bc 100644
--- a/tc/p_udp.c
+++ b/tc/p_udp.c
@@ -13,11 +13,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 #include <string.h>
 #include "utils.h"
 #include "tc_util.h"
diff --git a/tc/q_atm.c b/tc/q_atm.c
index 56e7ad802a5d..f09d5e48f459 100644
--- a/tc/q_atm.c
+++ b/tc/q_atm.c
@@ -9,12 +9,8 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <ctype.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/socket.h>
 #include <sys/ioctl.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 #include <string.h>
 #include <atm.h>
 #include <linux/atmdev.h>
diff --git a/tc/q_cbq.c b/tc/q_cbq.c
index f148175cd76b..36d00fdf17ee 100644
--- a/tc/q_cbq.c
+++ b/tc/q_cbq.c
@@ -13,11 +13,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 #include <string.h>
 
 #include "utils.h"
diff --git a/tc/q_choke.c b/tc/q_choke.c
index a234d2e01708..37018d524856 100644
--- a/tc/q_choke.c
+++ b/tc/q_choke.c
@@ -12,11 +12,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 #include <string.h>
 #include <math.h>
 
diff --git a/tc/q_codel.c b/tc/q_codel.c
index 09222a17e46d..d061c362c38f 100644
--- a/tc/q_codel.c
+++ b/tc/q_codel.c
@@ -41,11 +41,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 #include <string.h>
 
 #include "utils.h"
diff --git a/tc/q_drr.c b/tc/q_drr.c
index 79c81a22c3d2..a9814e8407ad 100644
--- a/tc/q_drr.c
+++ b/tc/q_drr.c
@@ -13,11 +13,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 #include <string.h>
 
 #include "utils.h"
diff --git a/tc/q_dsmark.c b/tc/q_dsmark.c
index 79dfd9a27e34..ebb8d9c743fd 100644
--- a/tc/q_dsmark.c
+++ b/tc/q_dsmark.c
@@ -8,11 +8,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 #include <string.h>
 
 #include "utils.h"
diff --git a/tc/q_fifo.c b/tc/q_fifo.c
index 3ee8ce9a9fe5..dcf42fd63e52 100644
--- a/tc/q_fifo.c
+++ b/tc/q_fifo.c
@@ -13,11 +13,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 #include <string.h>
 
 #include "utils.h"
diff --git a/tc/q_fq.c b/tc/q_fq.c
index 45b2ffd9a6d3..448e2866cddb 100644
--- a/tc/q_fq.c
+++ b/tc/q_fq.c
@@ -38,11 +38,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 #include <string.h>
 #include <stdbool.h>
 
diff --git a/tc/q_fq_codel.c b/tc/q_fq_codel.c
index 500e6206ecd4..4be45ff410eb 100644
--- a/tc/q_fq_codel.c
+++ b/tc/q_fq_codel.c
@@ -38,11 +38,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 #include <string.h>
 
 #include "utils.h"
diff --git a/tc/q_gred.c b/tc/q_gred.c
index 0a9894966c82..462f8f69e515 100644
--- a/tc/q_gred.c
+++ b/tc/q_gred.c
@@ -15,11 +15,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 #include <string.h>
 #include <math.h>
 
diff --git a/tc/q_hfsc.c b/tc/q_hfsc.c
index cf784f158f4e..89d8d9f30c9b 100644
--- a/tc/q_hfsc.c
+++ b/tc/q_hfsc.c
@@ -13,11 +13,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 #include <string.h>
 #include <math.h>
 
diff --git a/tc/q_hhf.c b/tc/q_hhf.c
index 738b56360bcb..efe25adf46ea 100644
--- a/tc/q_hhf.c
+++ b/tc/q_hhf.c
@@ -5,11 +5,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 #include <string.h>
 
 #include "utils.h"
diff --git a/tc/q_htb.c b/tc/q_htb.c
index a811c2845e67..a4ad6a7583e8 100644
--- a/tc/q_htb.c
+++ b/tc/q_htb.c
@@ -13,11 +13,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 #include <string.h>
 
 #include "utils.h"
diff --git a/tc/q_mqprio.c b/tc/q_mqprio.c
index d6718fb1c2be..eccae6541ccf 100644
--- a/tc/q_mqprio.c
+++ b/tc/q_mqprio.c
@@ -12,11 +12,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 #include <string.h>
 
 #include "utils.h"
diff --git a/tc/q_multiq.c b/tc/q_multiq.c
index 9c09c9a7748f..5140893438c2 100644
--- a/tc/q_multiq.c
+++ b/tc/q_multiq.c
@@ -25,11 +25,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 #include <string.h>
 
 #include "utils.h"
diff --git a/tc/q_netem.c b/tc/q_netem.c
index b97c351e0773..def3f3c00448 100644
--- a/tc/q_netem.c
+++ b/tc/q_netem.c
@@ -15,12 +15,8 @@
 #include <math.h>
 #include <ctype.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <stdint.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 #include <string.h>
 #include <errno.h>
 
diff --git a/tc/q_pie.c b/tc/q_pie.c
index a697db752daf..8322f5caf63a 100644
--- a/tc/q_pie.c
+++ b/tc/q_pie.c
@@ -18,11 +18,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 #include <string.h>
 #include <math.h>
 
diff --git a/tc/q_prio.c b/tc/q_prio.c
index a28928a85a0b..d96a2062330e 100644
--- a/tc/q_prio.c
+++ b/tc/q_prio.c
@@ -13,11 +13,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 #include <string.h>
 
 #include "utils.h"
diff --git a/tc/q_qfq.c b/tc/q_qfq.c
index 0e026749a2ef..b14634711462 100644
--- a/tc/q_qfq.c
+++ b/tc/q_qfq.c
@@ -10,11 +10,7 @@
  *		Fabio Checconi <fabio@...dalf.sssup.it>
  *
  */
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 #include <string.h>
 
 #include "utils.h"
diff --git a/tc/q_red.c b/tc/q_red.c
index ec706aaf2e35..e5491d3698e9 100644
--- a/tc/q_red.c
+++ b/tc/q_red.c
@@ -13,11 +13,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 #include <string.h>
 #include <math.h>
 
diff --git a/tc/q_rr.c b/tc/q_rr.c
index f330311d2648..f93a8f81fcbc 100644
--- a/tc/q_rr.c
+++ b/tc/q_rr.c
@@ -13,11 +13,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 #include <string.h>
 
 #include "utils.h"
diff --git a/tc/q_sfb.c b/tc/q_sfb.c
index 05c5f1325aeb..a2325f32b272 100644
--- a/tc/q_sfb.c
+++ b/tc/q_sfb.c
@@ -15,11 +15,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 #include <string.h>
 
 #include "utils.h"
diff --git a/tc/q_sfq.c b/tc/q_sfq.c
index b5a989500cc0..eaeea502907e 100644
--- a/tc/q_sfq.c
+++ b/tc/q_sfq.c
@@ -13,11 +13,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 #include <string.h>
 #include <math.h>
 
diff --git a/tc/q_tbf.c b/tc/q_tbf.c
index 18b2193b43ab..8850369a3732 100644
--- a/tc/q_tbf.c
+++ b/tc/q_tbf.c
@@ -13,11 +13,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 #include <string.h>
 
 #include "utils.h"
diff --git a/tc/tc.c b/tc/tc.c
index 8e64a82b4271..8fe4e1ab1330 100644
--- a/tc/tc.c
+++ b/tc/tc.c
@@ -16,11 +16,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <dlfcn.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
 #include <arpa/inet.h>
 #include <string.h>
 #include <errno.h>
diff --git a/tc/tc_cbq.c b/tc/tc_cbq.c
index 5e50afa84907..73b7e458dffb 100644
--- a/tc/tc_cbq.c
+++ b/tc/tc_cbq.c
@@ -13,12 +13,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <math.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 #include <string.h>
 
 #include "tc_core.h"
diff --git a/tc/tc_class.c b/tc/tc_class.c
index 1a1f1fa225b4..00f50a80a91e 100644
--- a/tc/tc_class.c
+++ b/tc/tc_class.c
@@ -13,11 +13,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 #include <string.h>
 #include <math.h>
 
diff --git a/tc/tc_core.c b/tc/tc_core.c
index 821b741be17c..d81722cfc34d 100644
--- a/tc/tc_core.c
+++ b/tc/tc_core.c
@@ -14,12 +14,8 @@
 #include <stdlib.h>
 #include <stdint.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <math.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 #include <string.h>
 
 #include "tc_core.h"
diff --git a/tc/tc_estimator.c b/tc/tc_estimator.c
index c40eea96f693..3b5f60218ef9 100644
--- a/tc/tc_estimator.c
+++ b/tc/tc_estimator.c
@@ -13,12 +13,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <math.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 #include <string.h>
 
 #include "tc_core.h"
diff --git a/tc/tc_filter.c b/tc/tc_filter.c
index cf290ae8e252..a45f992425aa 100644
--- a/tc/tc_filter.c
+++ b/tc/tc_filter.c
@@ -13,11 +13,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
-#include <arpa/inet.h>
 #include <string.h>
 #include <linux/if_ether.h>
 
diff --git a/tc/tc_monitor.c b/tc/tc_monitor.c
index 83142cb21f54..2c2c2c825e84 100644
--- a/tc/tc_monitor.c
+++ b/tc/tc_monitor.c
@@ -13,11 +13,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 #include <string.h>
 #include <time.h>
 #include "rt_names.h"
diff --git a/tc/tc_qdisc.c b/tc/tc_qdisc.c
index 1e9d909789e6..6d343608bb57 100644
--- a/tc/tc_qdisc.c
+++ b/tc/tc_qdisc.c
@@ -13,11 +13,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 #include <string.h>
 #include <math.h>
 #include <malloc.h>
diff --git a/tc/tc_red.c b/tc/tc_red.c
index e9b2f0ee3baa..fe7f27e6bf80 100644
--- a/tc/tc_red.c
+++ b/tc/tc_red.c
@@ -13,12 +13,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <math.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 #include <string.h>
 
 #include "tc_core.h"
diff --git a/tc/tc_stab.c b/tc/tc_stab.c
index 1a0a3e3f0fb7..ee8cc8a78e99 100644
--- a/tc/tc_stab.c
+++ b/tc/tc_stab.c
@@ -13,13 +13,9 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <math.h>
 #include <sys/socket.h>
 #include <sys/param.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 #include <string.h>
 #include <malloc.h>
 
diff --git a/tc/tc_util.c b/tc/tc_util.c
index b39e5508235e..331dfe8c8471 100644
--- a/tc/tc_util.c
+++ b/tc/tc_util.c
@@ -13,12 +13,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
 #include <sys/socket.h>
 #include <sys/param.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 #include <string.h>
 #include <math.h>
 #include <errno.h>
diff --git a/tipc/bearer.c b/tipc/bearer.c
index 0d8457015062..da06571d1d8d 100644
--- a/tipc/bearer.c
+++ b/tipc/bearer.c
@@ -22,6 +22,7 @@
 
 #include <libmnl/libmnl.h>
 #include <sys/socket.h>
+#include <netinet/in.h>
 
 #include "cmdl.h"
 #include "msg.h"
-- 
2.11.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ