diff options
author | Thomas Haller <thaller@redhat.com> | 2020-12-13 16:08:56 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2020-12-22 16:33:33 +0100 |
commit | 0fca809bfddd42f779e49dd5181f089c20e93320 (patch) | |
tree | 8303596f5a706e18dc8b252fb13c58efe1478702 | |
parent | e711aa1423ecd48e7913812464c2105a24673370 (diff) | |
download | NetworkManager-0fca809bfddd42f779e49dd5181f089c20e93320.tar.gz |
all: explicit include <linux/if_{ether,infiniband,vlan}.h> as needed
Currently libnm headers include <linux/if_{ether,infiniband,vlan}.h>.
These are public headers, that means we drag in the linux header to all
users of <NetworkManager.h>.
Often the linux headers work badly together with certain headers from libc.
Depending on the libc version, you have to order linux headers in the right
order with respect to libc headers.
We should do better about libnm headers. As a first step, assume that
the linux headers don't get included by libnm, and explicitly include
them where they are needed.
46 files changed, 73 insertions, 0 deletions
diff --git a/clients/cli/devices.c b/clients/cli/devices.c index 62f4fed1ad..c45bbc2319 100644 --- a/clients/cli/devices.c +++ b/clients/cli/devices.c @@ -10,6 +10,7 @@ #include <stdio.h> #include <stdlib.h> #include <readline/readline.h> +#include <linux/if_ether.h> #include "nm-glib-aux/nm-secret-utils.h" #include "common.h" diff --git a/clients/cloud-setup/nm-cloud-setup-utils.c b/clients/cloud-setup/nm-cloud-setup-utils.c index 0820ed59ea..4740ea62a9 100644 --- a/clients/cloud-setup/nm-cloud-setup-utils.c +++ b/clients/cloud-setup/nm-cloud-setup-utils.c @@ -4,6 +4,9 @@ #include "nm-cloud-setup-utils.h" +#include <linux/if_ether.h> +#include <linux/if_infiniband.h> + #include "nm-glib-aux/nm-time-utils.h" #include "nm-glib-aux/nm-logging-base.h" #include "nm-glib-aux/nm-str-buf.h" diff --git a/clients/common/nm-meta-setting-desc.c b/clients/common/nm-meta-setting-desc.c index e4b74751cb..d16757d983 100644 --- a/clients/common/nm-meta-setting-desc.c +++ b/clients/common/nm-meta-setting-desc.c @@ -9,6 +9,8 @@ #include <stdlib.h> #include <arpa/inet.h> +#include <linux/if_ether.h> +#include <linux/if_infiniband.h> #include "nm-libnm-core-intern/nm-common-macros.h" #include "nm-glib-aux/nm-enum-utils.h" diff --git a/clients/tui/nmt-mac-entry.c b/clients/tui/nmt-mac-entry.c index 51c6d95755..1d4f612bf7 100644 --- a/clients/tui/nmt-mac-entry.c +++ b/clients/tui/nmt-mac-entry.c @@ -17,6 +17,9 @@ #include "nmt-mac-entry.h" +#include <linux/if_ether.h> +#include <linux/if_infiniband.h> + #include "nm-libnm-core-intern/nm-common-macros.h" G_DEFINE_TYPE(NmtMacEntry, nmt_mac_entry, NMT_TYPE_NEWT_ENTRY) diff --git a/clients/tui/nmt-page-bond.c b/clients/tui/nmt-page-bond.c index ea68ae1b01..2430a39fae 100644 --- a/clients/tui/nmt-page-bond.c +++ b/clients/tui/nmt-page-bond.c @@ -16,6 +16,9 @@ #include "nmt-page-bond.h" +#include <linux/if_ether.h> +#include <linux/if_infiniband.h> + #include "nm-libnm-core-intern/nm-libnm-core-utils.h" #include "nmt-mac-entry.h" #include "nmt-address-list.h" diff --git a/clients/tui/nmt-page-ethernet.c b/clients/tui/nmt-page-ethernet.c index 35694b0e49..1ddf51c9c8 100644 --- a/clients/tui/nmt-page-ethernet.c +++ b/clients/tui/nmt-page-ethernet.c @@ -11,6 +11,10 @@ #include "nm-default.h" #include "nmt-page-ethernet.h" + +#include <linux/if_ether.h> +#include <linux/if_infiniband.h> + #include "nmt-mac-entry.h" #include "nmt-mtu-entry.h" diff --git a/clients/tui/nmt-page-vlan.c b/clients/tui/nmt-page-vlan.c index 675bcaacb5..32c44323ed 100644 --- a/clients/tui/nmt-page-vlan.c +++ b/clients/tui/nmt-page-vlan.c @@ -12,6 +12,8 @@ #include "nm-editor-bindings.h" +#include <linux/if_ether.h> + #include "nmt-page-vlan.h" #include "nmt-device-entry.h" #include "nmt-mac-entry.h" diff --git a/clients/tui/nmt-page-wifi.c b/clients/tui/nmt-page-wifi.c index 02e022bf83..5b2862ed02 100644 --- a/clients/tui/nmt-page-wifi.c +++ b/clients/tui/nmt-page-wifi.c @@ -15,6 +15,7 @@ #include "nm-default.h" #include <stdlib.h> +#include <linux/if_ether.h> #include "nmt-page-wifi.h" #include "nmt-mac-entry.h" diff --git a/libnm-core/nm-keyfile/nm-keyfile.c b/libnm-core/nm-keyfile/nm-keyfile.c index 910fd0e603..3fa82da3bd 100644 --- a/libnm-core/nm-keyfile/nm-keyfile.c +++ b/libnm-core/nm-keyfile/nm-keyfile.c @@ -15,6 +15,8 @@ #include <sys/types.h> #include <arpa/inet.h> #include <linux/pkt_sched.h> +#include <linux/if_ether.h> +#include <linux/if_infiniband.h> #include "nm-glib-aux/nm-str-buf.h" #include "nm-glib-aux/nm-secret-utils.h" diff --git a/libnm-core/nm-setting-bond.c b/libnm-core/nm-setting-bond.c index 0cb38342a6..8d8a5b2ab4 100644 --- a/libnm-core/nm-setting-bond.c +++ b/libnm-core/nm-setting-bond.c @@ -10,6 +10,7 @@ #include <stdlib.h> #include <netinet/in.h> #include <arpa/inet.h> +#include <linux/if_ether.h> #include "nm-libnm-core-intern/nm-libnm-core-utils.h" #include "nm-utils.h" diff --git a/libnm-core/nm-setting-bridge.c b/libnm-core/nm-setting-bridge.c index ec5e54ee2d..096f1cca9c 100644 --- a/libnm-core/nm-setting-bridge.c +++ b/libnm-core/nm-setting-bridge.c @@ -9,6 +9,7 @@ #include <ctype.h> #include <stdlib.h> +#include <linux/if_ether.h> #include "nm-glib-aux/nm-str-buf.h" #include "nm-connection-private.h" diff --git a/libnm-core/nm-setting-infiniband.c b/libnm-core/nm-setting-infiniband.c index 02a92cad13..28de3cb430 100644 --- a/libnm-core/nm-setting-infiniband.c +++ b/libnm-core/nm-setting-infiniband.c @@ -8,6 +8,7 @@ #include "nm-setting-infiniband.h" #include <stdlib.h> +#include <linux/if_infiniband.h> #include "nm-utils.h" #include "nm-utils-private.h" diff --git a/libnm-core/nm-setting-olpc-mesh.c b/libnm-core/nm-setting-olpc-mesh.c index a39cbd1533..9276e704dd 100644 --- a/libnm-core/nm-setting-olpc-mesh.c +++ b/libnm-core/nm-setting-olpc-mesh.c @@ -9,6 +9,8 @@ #include "nm-setting-olpc-mesh.h" +#include <linux/if_ether.h> + #include "nm-utils.h" #include "nm-utils-private.h" #include "nm-setting-private.h" diff --git a/libnm-core/nm-utils.c b/libnm-core/nm-utils.c index 1b6ebfd5a3..162964d957 100644 --- a/libnm-core/nm-utils.c +++ b/libnm-core/nm-utils.c @@ -16,6 +16,7 @@ #include <gmodule.h> #include <sys/stat.h> #include <linux/pkt_sched.h> +#include <linux/if_infiniband.h> #include "nm-glib-aux/nm-json-aux.h" #include "nm-glib-aux/nm-str-buf.h" diff --git a/libnm-core/tests/test-general.c b/libnm-core/tests/test-general.c index 5ab1922044..60921e69a2 100644 --- a/libnm-core/tests/test-general.c +++ b/libnm-core/tests/test-general.c @@ -10,6 +10,8 @@ #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> +#include <linux/if_ether.h> +#include <linux/if_infiniband.h> #include "nm-std-aux/c-list-util.h" #include "nm-glib-aux/nm-enum-utils.h" diff --git a/libnm/nm-access-point.c b/libnm/nm-access-point.c index 25ce44a134..c46f68d299 100644 --- a/libnm/nm-access-point.c +++ b/libnm/nm-access-point.c @@ -8,6 +8,8 @@ #include "nm-access-point.h" +#include <linux/if_ether.h> + #include "nm-connection.h" #include "nm-setting-connection.h" #include "nm-setting-wireless.h" diff --git a/libnm/nm-device-bt.c b/libnm/nm-device-bt.c index ef6cc869f0..e8bbe69f41 100644 --- a/libnm/nm-device-bt.c +++ b/libnm/nm-device-bt.c @@ -8,6 +8,8 @@ #include "nm-device-bt.h" +#include <linux/if_ether.h> + #include "nm-setting-connection.h" #include "nm-setting-bluetooth.h" #include "nm-utils.h" diff --git a/libnm/nm-device-ethernet.c b/libnm/nm-device-ethernet.c index 6513e7b7da..52cc39f9da 100644 --- a/libnm/nm-device-ethernet.c +++ b/libnm/nm-device-ethernet.c @@ -8,6 +8,8 @@ #include "nm-device-ethernet.h" +#include <linux/if_ether.h> + #include "nm-libnm-utils.h" #include "nm-setting-connection.h" #include "nm-setting-wired.h" diff --git a/libnm/nm-device-infiniband.c b/libnm/nm-device-infiniband.c index f254ecef87..21834dc1af 100644 --- a/libnm/nm-device-infiniband.c +++ b/libnm/nm-device-infiniband.c @@ -7,6 +7,8 @@ #include "nm-device-infiniband.h" +#include <linux/if_infiniband.h> + #include "nm-setting-connection.h" #include "nm-setting-infiniband.h" #include "nm-utils.h" diff --git a/libnm/nm-device-wifi.c b/libnm/nm-device-wifi.c index df7d26316d..f76b98d7f8 100644 --- a/libnm/nm-device-wifi.c +++ b/libnm/nm-device-wifi.c @@ -8,6 +8,8 @@ #include "nm-device-wifi.h" +#include <linux/if_ether.h> + #include "nm-glib-aux/nm-dbus-aux.h" #include "nm-setting-connection.h" #include "nm-setting-wireless.h" diff --git a/src/NetworkManagerUtils.c b/src/NetworkManagerUtils.c index 35b892abed..b9ded4c2f2 100644 --- a/src/NetworkManagerUtils.c +++ b/src/NetworkManagerUtils.c @@ -10,6 +10,7 @@ #include <linux/fib_rules.h> #include <linux/pkt_sched.h> +#include <linux/if_ether.h> #include "nm-glib-aux/nm-c-list.h" diff --git a/src/devices/bluetooth/nm-bluez-manager.c b/src/devices/bluetooth/nm-bluez-manager.c index 32c316d607..c8c8251691 100644 --- a/src/devices/bluetooth/nm-bluez-manager.c +++ b/src/devices/bluetooth/nm-bluez-manager.c @@ -10,6 +10,7 @@ #include <signal.h> #include <stdlib.h> #include <gmodule.h> +#include <linux/if_ether.h> #include "nm-glib-aux/nm-dbus-aux.h" #include "nm-glib-aux/nm-c-list.h" diff --git a/src/devices/bluetooth/nm-device-bt.c b/src/devices/bluetooth/nm-device-bt.c index ca2a59731d..8523a69c33 100644 --- a/src/devices/bluetooth/nm-device-bt.c +++ b/src/devices/bluetooth/nm-device-bt.c @@ -8,6 +8,7 @@ #include "nm-device-bt.h" #include <stdio.h> +#include <linux/if_ether.h> #include "nm-core-internal.h" #include "nm-bluez-common.h" diff --git a/src/devices/nm-acd-manager.c b/src/devices/nm-acd-manager.c index c9992ff5c1..e4ac81b2c0 100644 --- a/src/devices/nm-acd-manager.c +++ b/src/devices/nm-acd-manager.c @@ -10,6 +10,7 @@ #include <netinet/in.h> #include <sys/types.h> #include <sys/wait.h> +#include <linux/if_ether.h> #include "platform/nm-platform.h" #include "nm-utils.h" diff --git a/src/devices/nm-device-bridge.c b/src/devices/nm-device-bridge.c index 64a530a26b..2b428beffe 100644 --- a/src/devices/nm-device-bridge.c +++ b/src/devices/nm-device-bridge.c @@ -8,6 +8,7 @@ #include "nm-device-bridge.h" #include <stdlib.h> +#include <linux/if_ether.h> #include "NetworkManagerUtils.h" #include "nm-device-private.h" diff --git a/src/devices/nm-device-ethernet.c b/src/devices/nm-device-ethernet.c index 9f149c73db..6d11c59414 100644 --- a/src/devices/nm-device-ethernet.c +++ b/src/devices/nm-device-ethernet.c @@ -12,6 +12,7 @@ #include <stdlib.h> #include <unistd.h> #include <libudev.h> +#include <linux/if_ether.h> #include "nm-device-private.h" #include "nm-act-request.h" diff --git a/src/devices/nm-device-ip-tunnel.c b/src/devices/nm-device-ip-tunnel.c index dad64cd4aa..5ae8d48b77 100644 --- a/src/devices/nm-device-ip-tunnel.c +++ b/src/devices/nm-device-ip-tunnel.c @@ -12,6 +12,7 @@ #include <linux/ip.h> #include <linux/if_tunnel.h> #include <linux/ip6_tunnel.h> +#include <linux/if_ether.h> #include "nm-device-private.h" #include "nm-manager.h" diff --git a/src/devices/nm-device-macsec.c b/src/devices/nm-device-macsec.c index 2be87b3459..c27927454d 100644 --- a/src/devices/nm-device-macsec.c +++ b/src/devices/nm-device-macsec.c @@ -7,6 +7,8 @@ #include "nm-device-macsec.h" +#include <linux/if_ether.h> + #include "nm-act-request.h" #include "nm-device-private.h" #include "platform/nm-platform.h" diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 21662aaa61..2341ffe527 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -19,6 +19,8 @@ #include <linux/if_addr.h> #include <linux/if_arp.h> #include <linux/rtnetlink.h> +#include <linux/if_ether.h> +#include <linux/if_infiniband.h> #include "nm-std-aux/unaligned.h" #include "nm-glib-aux/nm-dedup-multi.h" diff --git a/src/devices/tests/test-acd.c b/src/devices/tests/test-acd.c index da7b3c3d29..8d6c645b05 100644 --- a/src/devices/tests/test-acd.c +++ b/src/devices/tests/test-acd.c @@ -7,6 +7,8 @@ #include "n-acd/src/n-acd.h" +#include <linux/if_ether.h> + #include "devices/nm-acd-manager.h" #include "platform/tests/test-common.h" diff --git a/src/devices/wifi/nm-device-iwd.c b/src/devices/wifi/nm-device-iwd.c index d3bebef216..46169095a8 100644 --- a/src/devices/wifi/nm-device-iwd.c +++ b/src/devices/wifi/nm-device-iwd.c @@ -7,6 +7,8 @@ #include "nm-device-iwd.h" +#include <linux/if_ether.h> + #include "devices/nm-device-private.h" #include "devices/nm-device.h" #include "nm-act-request.h" diff --git a/src/devices/wifi/nm-device-wifi.c b/src/devices/wifi/nm-device-wifi.c index bbd2b130d8..2af00196f3 100644 --- a/src/devices/wifi/nm-device-wifi.c +++ b/src/devices/wifi/nm-device-wifi.c @@ -10,6 +10,7 @@ #include <netinet/in.h> #include <unistd.h> +#include <linux/if_ether.h> #include "nm-glib-aux/nm-ref-string.h" #include "nm-glib-aux/nm-c-list.h" diff --git a/src/devices/wifi/nm-wifi-ap.c b/src/devices/wifi/nm-wifi-ap.c index 4fa44f0126..f0fac9dcd4 100644 --- a/src/devices/wifi/nm-wifi-ap.c +++ b/src/devices/wifi/nm-wifi-ap.c @@ -9,6 +9,7 @@ #include "nm-wifi-ap.h" #include <stdlib.h> +#include <linux/if_ether.h> #include "NetworkManagerUtils.h" #include "devices/nm-device.h" diff --git a/src/devices/wifi/nm-wifi-p2p-peer.c b/src/devices/wifi/nm-wifi-p2p-peer.c index cfcf96ab90..d67ee96761 100644 --- a/src/devices/wifi/nm-wifi-p2p-peer.c +++ b/src/devices/wifi/nm-wifi-p2p-peer.c @@ -8,6 +8,7 @@ #include "nm-wifi-p2p-peer.h" #include <stdlib.h> +#include <linux/if_ether.h> #include "NetworkManagerUtils.h" #include "devices/nm-device.h" diff --git a/src/dhcp/nm-dhcp-dhclient-utils.c b/src/dhcp/nm-dhcp-dhclient-utils.c index f0eed6f513..7e3dd0ec94 100644 --- a/src/dhcp/nm-dhcp-dhclient-utils.c +++ b/src/dhcp/nm-dhcp-dhclient-utils.c @@ -10,6 +10,7 @@ #include <ctype.h> #include <arpa/inet.h> #include <net/if.h> +#include <linux/if_ether.h> #include "nm-glib-aux/nm-dedup-multi.h" diff --git a/src/initrd/nmi-cmdline-reader.c b/src/initrd/nmi-cmdline-reader.c index eedcf17878..a8ad2b1b24 100644 --- a/src/initrd/nmi-cmdline-reader.c +++ b/src/initrd/nmi-cmdline-reader.c @@ -5,6 +5,9 @@ #include "nm-default.h" +#include <linux/if_ether.h> +#include <linux/if_infiniband.h> + #include "nm-core-internal.h" #include "nm-initrd-generator.h" #include "systemd/nm-sd-utils-shared.h" diff --git a/src/initrd/nmi-dt-reader.c b/src/initrd/nmi-dt-reader.c index 3039d90233..b3646b36a4 100644 --- a/src/initrd/nmi-dt-reader.c +++ b/src/initrd/nmi-dt-reader.c @@ -8,6 +8,7 @@ #include "nm-initrd-generator.h" #include <arpa/inet.h> +#include <linux/if_ether.h> #include "nm-core-internal.h" diff --git a/src/initrd/nmi-ibft-reader.c b/src/initrd/nmi-ibft-reader.c index b7ce467197..40ac7db2bf 100644 --- a/src/initrd/nmi-ibft-reader.c +++ b/src/initrd/nmi-ibft-reader.c @@ -15,6 +15,7 @@ #include <sys/inotify.h> #include <sys/ioctl.h> #include <unistd.h> +#include <linux/if_ether.h> #include "nm-core-internal.h" #include "NetworkManagerUtils.h" diff --git a/src/nm-l3-ipv4ll.c b/src/nm-l3-ipv4ll.c index fe76b96955..1ef25b2511 100644 --- a/src/nm-l3-ipv4ll.c +++ b/src/nm-l3-ipv4ll.c @@ -5,6 +5,7 @@ #include "nm-l3-ipv4ll.h" #include <net/if.h> +#include <linux/if_ether.h> #include "n-acd/src/n-acd.h" #include "nm-core-utils.h" diff --git a/src/nm-l3cfg.c b/src/nm-l3cfg.c index de5f80e5a2..acdb176c3b 100644 --- a/src/nm-l3cfg.c +++ b/src/nm-l3cfg.c @@ -6,6 +6,7 @@ #include <net/if.h> #include <linux/if_addr.h> +#include <linux/if_ether.h> #include <linux/rtnetlink.h> #include "platform/nm-platform.h" diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c index 4e98ae9e99..28e6df1c6b 100644 --- a/src/platform/nm-linux-platform.c +++ b/src/platform/nm-linux-platform.c @@ -19,6 +19,7 @@ #include <linux/if_link.h> #include <linux/if_tun.h> #include <linux/if_tunnel.h> +#include <linux/if_vlan.h> #include <linux/ip6_tunnel.h> #include <linux/tc_act/tc_mirred.h> #include <netinet/icmp6.h> diff --git a/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c b/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c index 9b7873c01b..350d174412 100644 --- a/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c +++ b/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c @@ -16,6 +16,7 @@ #include <sys/ioctl.h> #include <unistd.h> #include <linux/rtnetlink.h> +#include <linux/if_ether.h> #include "nm-glib-aux/nm-secret-utils.h" #include "nm-connection.h" diff --git a/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c b/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c index a4e9d8047e..5493801621 100644 --- a/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c +++ b/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c @@ -14,6 +14,8 @@ #include <sys/socket.h> #include <sys/types.h> #include <sys/stat.h> +#include <linux/if_ether.h> +#include <linux/if_infiniband.h> #include "nm-glib-aux/nm-json-aux.h" #include "nm-utils.h" diff --git a/src/settings/plugins/keyfile/tests/test-keyfile-settings.c b/src/settings/plugins/keyfile/tests/test-keyfile-settings.c index 4e8d89b12b..27410bc5ba 100644 --- a/src/settings/plugins/keyfile/tests/test-keyfile-settings.c +++ b/src/settings/plugins/keyfile/tests/test-keyfile-settings.c @@ -12,6 +12,8 @@ #include <arpa/inet.h> #include <sys/socket.h> #include <linux/pkt_sched.h> +#include <linux/if_ether.h> +#include <linux/if_infiniband.h> #include "nm-core-internal.h" diff --git a/src/supplicant/nm-supplicant-interface.c b/src/supplicant/nm-supplicant-interface.c index 611372d5da..9b0b15f9d5 100644 --- a/src/supplicant/nm-supplicant-interface.c +++ b/src/supplicant/nm-supplicant-interface.c @@ -9,6 +9,7 @@ #include "nm-supplicant-interface.h" #include <stdio.h> +#include <linux/if_ether.h> #include "NetworkManagerUtils.h" #include "nm-core-internal.h" diff --git a/src/tests/test-utils.c b/src/tests/test-utils.c index 4635d98285..66368bf4be 100644 --- a/src/tests/test-utils.c +++ b/src/tests/test-utils.c @@ -6,6 +6,7 @@ #include "nm-default.h" #include <arpa/inet.h> +#include <linux/if_ether.h> #include "nm-test-utils-core.h" |