diff --git a/ethernet.c b/ethernet.c
index abec12f8df17bc4e64142c3c2768a605d857c124..9fb105b2ba8c936bbbf7005be0e44bc882b02f4d 100644
--- a/ethernet.c
+++ b/ethernet.c
@@ -33,6 +33,9 @@
 #include <linux/sockios.h>
 #include <linux/mii.h>
 
+#include <net/if.h>
+#include "easy.h"
+
 #include "ethernet.h"
 
 #ifdef IOPSYS_BROADCOM
diff --git a/ethernet.h b/ethernet.h
index 97618bc6c3eda3fb187e80810e4356c1dc4a588a..0116428d247bb8f903930ec083abe8f922f6d5b7 100644
--- a/ethernet.h
+++ b/ethernet.h
@@ -25,8 +25,6 @@
 #include <stdint.h>
 #include <stdbool.h>
 #include <linux/types.h>
-#include <net/if.h>
-#include "easy.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/test_stub/stub.c b/test_stub/stub.c
index 9cb4948f42001ab514b4c25880832c0f7c86fb78..e244500c68d70ccb05c2b46999a4ec88fa8d59e0 100644
--- a/test_stub/stub.c
+++ b/test_stub/stub.c
@@ -33,6 +33,9 @@
 #include <unistd.h>
 #include <stdlib.h>
 
+#include "easy.h"
+#include "ethernet.h"
+
 #include "stub.h"
 
 int test_eth_set_link_settings(const char *name, struct eth_link link)
diff --git a/test_stub/stub.h b/test_stub/stub.h
index b8e557f5bc7f907335fc281d683eef2436e07169..f104620ec388e4ea7a56183d58184565705b79d0 100644
--- a/test_stub/stub.h
+++ b/test_stub/stub.h
@@ -23,7 +23,6 @@
 #ifndef TEST_ETHERNET_H
 #define TEST_ETHERNET_H
 
-#include "ethernet.h"
 
 #define TESTSTATS(attr)    test ## _ ## attr