mirror of
https://github.com/yarrick/iodine.git
synced 2024-11-22 14:41:28 +00:00
Fix build error and a warning on OpenBSD
This commit is contained in:
parent
031953e295
commit
b079b0eda5
|
@ -149,8 +149,8 @@ get_addr(char *host, int port, int addr_family, int flags, struct sockaddr_stora
|
||||||
|
|
||||||
memset(&hints, 0, sizeof(hints));
|
memset(&hints, 0, sizeof(hints));
|
||||||
hints.ai_family = addr_family;
|
hints.ai_family = addr_family;
|
||||||
#ifdef WINDOWS32
|
#if defined(WINDOWS32) || defined(OPENBSD)
|
||||||
/* AI_ADDRCONFIG misbehaves on windows */
|
/* AI_ADDRCONFIG misbehaves on windows, and does not exist in OpenBSD */
|
||||||
hints.ai_flags = flags;
|
hints.ai_flags = flags;
|
||||||
#else
|
#else
|
||||||
hints.ai_flags = AI_ADDRCONFIG | flags;
|
hints.ai_flags = AI_ADDRCONFIG | flags;
|
||||||
|
|
|
@ -440,6 +440,7 @@ tun_setip(const char *ip, const char *other_ip, int netbits)
|
||||||
int i;
|
int i;
|
||||||
#ifndef LINUX
|
#ifndef LINUX
|
||||||
int r;
|
int r;
|
||||||
|
struct in_addr netip;
|
||||||
#endif
|
#endif
|
||||||
#ifdef WINDOWS32
|
#ifdef WINDOWS32
|
||||||
DWORD status;
|
DWORD status;
|
||||||
|
@ -475,7 +476,6 @@ tun_setip(const char *ip, const char *other_ip, int netbits)
|
||||||
|
|
||||||
fprintf(stderr, "Setting IP of %s to %s\n", if_name, ip);
|
fprintf(stderr, "Setting IP of %s to %s\n", if_name, ip);
|
||||||
#ifndef LINUX
|
#ifndef LINUX
|
||||||
struct in_addr netip;
|
|
||||||
netip.s_addr = inet_addr(ip);
|
netip.s_addr = inet_addr(ip);
|
||||||
netip.s_addr = netip.s_addr & net.s_addr;
|
netip.s_addr = netip.s_addr & net.s_addr;
|
||||||
r = system(cmdline);
|
r = system(cmdline);
|
||||||
|
|
Loading…
Reference in a new issue