mirror of
https://github.com/rsmarples/dhcpcd.git
synced 2024-12-01 05:53:47 +08:00
Fix compile on BSD.
This commit is contained in:
parent
a9819bfb1f
commit
5c7da81448
3
bpf.c
3
bpf.c
@ -47,9 +47,10 @@
|
||||
|
||||
#include "config.h"
|
||||
#include "dhcp.h"
|
||||
#include "interface.h"
|
||||
#include "if.h"
|
||||
#include "logger.h"
|
||||
#include "socket.h"
|
||||
#include "bpf-filter.h"
|
||||
|
||||
void
|
||||
setup_packet_filters(void)
|
||||
|
4
if-bsd.c
4
if-bsd.c
@ -48,7 +48,7 @@
|
||||
#include "config.h"
|
||||
#include "common.h"
|
||||
#include "dhcp.h"
|
||||
#include "interface.h"
|
||||
#include "if.h"
|
||||
#include "logger.h"
|
||||
|
||||
/* Darwin doesn't define this for some very odd reason */
|
||||
@ -164,7 +164,7 @@ if_route(const char *ifname, struct in_addr destination,
|
||||
rtm.hdr.rtm_flags |= RTF_HOST;
|
||||
|
||||
hwaddr = xmalloc(sizeof(unsigned char) * HWADDR_LEN);
|
||||
_do_interface(ifname, hwaddr, &hwlen, NULL, false, false);
|
||||
do_interface(ifname, hwaddr, &hwlen, NULL, false, false);
|
||||
memset(&su, 0, sizeof(su));
|
||||
su.sdl.sdl_len = sizeof(su.sdl);
|
||||
su.sdl.sdl_family = AF_LINK;
|
||||
|
5
if.c
5
if.c
@ -29,6 +29,9 @@
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
#include <arpa/inet.h>
|
||||
#ifdef AF_LINK
|
||||
# include <net/if_dl.h>
|
||||
#endif
|
||||
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
@ -150,7 +153,7 @@ hwaddr_aton(unsigned char *buffer, const char *addr)
|
||||
return len;
|
||||
}
|
||||
|
||||
static int
|
||||
int
|
||||
do_interface(const char *ifname,
|
||||
_unused unsigned char *hwaddr, _unused size_t *hwlen,
|
||||
struct in_addr *addr, bool flush, bool get)
|
||||
|
2
if.h
2
if.h
@ -147,6 +147,8 @@ void log_route(struct in_addr, struct in_addr, struct in_addr, int, int, int);
|
||||
int inet_ntocidr(struct in_addr);
|
||||
int inet_cidrtoaddr(int, struct in_addr *);
|
||||
|
||||
int do_interface(const char *, unsigned char *, size_t *, struct in_addr *,
|
||||
bool, bool);
|
||||
int if_address(const char *, struct in_addr, struct in_addr, struct in_addr,
|
||||
int del);
|
||||
int if_route(const char *, struct in_addr, struct in_addr, struct in_addr,
|
||||
|
Loading…
Reference in New Issue
Block a user