Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/reflector/default_address_monitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@
#include <cstring>
#include <span>
#include <vector>
#include <net/if.h>
#include <sys/socket.h>
#include <unistd.h>

#if defined(__linux__)
#include <linux/netlink.h>
#include <linux/rtnetlink.h>
#else
#include <net/if.h>
#include <net/route.h>
#endif

Expand Down
1 change: 0 additions & 1 deletion src/reflector/event_loop_dispatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include <ctime>
#include <utility>
#include <vector>
#include <unistd.h>

#if defined(__linux__)
#include <sys/epoll.h>
Expand Down
7 changes: 3 additions & 4 deletions src/reflector/interface_address.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
#include <string_view>
#include <vector>

#include <ifaddrs.h>
#include <net/if.h>
#include <netinet/in.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <unistd.h>

Expand All @@ -22,13 +25,9 @@
#include <linux/if_link.h>
#include <linux/netlink.h>
#include <linux/rtnetlink.h>
#include <cerrno>
#else
#include <ifaddrs.h>
#include <net/if_dl.h>
#include <netinet/in.h>
#include <netinet6/in6_var.h>
#include <sys/ioctl.h>
#endif

namespace {
Expand Down
4 changes: 0 additions & 4 deletions src/reflector/raw_socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,11 @@
#include <sys/socket.h>
#include <sys/types.h>
#include <unistd.h>
#include <utility>

#if defined(__linux__)
#include <linux/filter.h>
#include <linux/if_ether.h>
#include <linux/if_packet.h>
#include <sys/socket.h>
// Added to the UAPI in Linux 4.20; define it for older build headers. At runtime the setsockopt may
// still fail on a pre-4.20 kernel (or under user-mode QEMU), in which case Open falls back to dropping
// our own outgoing frames inside the BPF filter (DROP_OUTGOING_PROLOGUE).
Expand All @@ -42,8 +40,6 @@
#endif
#else
#include <net/bpf.h>
#include <net/ethernet.h>
#include <sys/uio.h>
#endif

namespace {
Expand Down
2 changes: 1 addition & 1 deletion tests/default_address_monitor_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <cstdint>
#include <cstring>
#include <fcntl.h>
#include <net/if.h>
#include <sys/socket.h>
#include <unistd.h>
#include <vector>
Expand All @@ -21,7 +22,6 @@
#include <linux/netlink.h>
#include <linux/rtnetlink.h>
#else
#include <net/if.h>
#include <net/route.h>
#endif

Expand Down
14 changes: 6 additions & 8 deletions tests/interface_address_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,20 @@

#include <gtest/gtest.h>

#include <array>
#include <cstddef>
#include <cstdint>
#include <vector>

#if defined(__linux__)
#include <net/if.h>
#include <string>
#else
#include <array>
#include <cstring>
#include <span>
#include <string>
#include <string_view>
#include <vector>
#include <net/if.h>
#include <sys/socket.h>

#if !defined(__linux__)
#include <net/if_dl.h>
#include <netinet6/in6_var.h>
#include <sys/socket.h>
#endif

namespace {
Expand Down
2 changes: 0 additions & 2 deletions tests/util/udp_socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@
#include "reflector/util/fd_util.h"

#include <cerrno>
#include <cstring>
#include <format>
#include <net/if.h>
#include <netinet/in.h>
#include <string>
#include <sys/socket.h>
#include <unistd.h>

namespace reflector {

Expand Down