Commit 23af2c17 authored by Tom Gundersen's avatar Tom Gundersen

n-dhcp4: avoid {net,linux}/if.h clashes on old distros

In particular, avoid including linux/netdevice.h from headers. This is
not a problem on newer distros, but required for CentOS 7.6.
Signed-off-by: Tom Gundersen's avatarTom Gundersen <teg@jklm.no>
parent 6c20e802
Pipeline #40486 failed with stage
in 29 minutes and 22 seconds
......@@ -13,6 +13,8 @@
#include <stdlib.h>
#include <string.h>
#include <sys/epoll.h>
#include <sys/socket.h>
#include <linux/netdevice.h>
#include "n-dhcp4-private.h"
#include "util/packet.h"
......
......@@ -7,7 +7,6 @@
#include <endian.h>
#include <inttypes.h>
#include <limits.h>
#include <linux/netdevice.h>
#include <stdbool.h>
#include <stdlib.h>
#include <time.h>
......@@ -234,9 +233,9 @@ struct NDhcp4ClientConfig {
int ifindex;
unsigned int transport;
bool request_broadcast;
uint8_t mac[MAX_ADDR_LEN];
uint8_t mac[32]; /* MAX_ADDR_LEN */
size_t n_mac;
uint8_t broadcast_mac[MAX_ADDR_LEN];
uint8_t broadcast_mac[32]; /* MAX_ADDR_LEN */
size_t n_broadcast_mac;
uint8_t *client_id;
size_t n_client_id;
......
......@@ -5,9 +5,9 @@
#include <c-stdaux.h>
#include <errno.h>
#include <linux/filter.h>
#include <linux/if.h>
#include <linux/if_packet.h>
#include <linux/udp.h>
#include <net/if.h>
#include <netinet/ip.h>
#include <stddef.h>
#include <stdlib.h>
......@@ -15,6 +15,7 @@
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <linux/netdevice.h>
#include "n-dhcp4-private.h"
#include "util/packet.h"
#include "util/socket.h"
......
......@@ -7,7 +7,6 @@
#include <c-stdaux.h>
#include <inttypes.h>
#include <linux/if_packet.h>
#include <linux/netdevice.h>
#include <netinet/in.h>
#include <stdlib.h>
#include <unistd.h>
......@@ -25,7 +24,7 @@ struct packet_sockaddr_ll {
unsigned short sll_hatype;
unsigned char sll_pkttype;
unsigned char sll_halen;
unsigned char sll_addr[MAX_ADDR_LEN];
unsigned char sll_addr[32]; /* MAX_ADDR_LEN */
};
uint16_t packet_internet_checksum(const uint8_t *data, size_t len);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment