mirror of
https://github.com/oxen-io/lokinet
synced 2023-12-14 06:53:00 +01:00
Merge remote-tracking branch 'upstream/dev' into ed25519-signing
This commit is contained in:
commit
1621ca676b
|
@ -20,6 +20,7 @@ typedef SSIZE_T ssize_t;
|
|||
#else
|
||||
#include <netinet/in.h>
|
||||
#include <sys/socket.h>
|
||||
#include <net/net_if.hpp>
|
||||
#endif
|
||||
|
||||
#include <memory>
|
||||
|
|
|
@ -465,8 +465,10 @@ namespace llarp
|
|||
ILinkLayer* link = static_cast< ILinkLayer* >(udp->user);
|
||||
auto pkts = std::make_shared< llarp_pkt_list >();
|
||||
llarp_ev_udp_recvmany(&link->m_udp, pkts.get());
|
||||
|
||||
link->logic()->queue_func([pkts, link]() {
|
||||
auto logic = link->logic();
|
||||
if(logic == nullptr)
|
||||
return;
|
||||
logic->queue_func([pkts, link]() {
|
||||
auto itr = pkts->begin();
|
||||
while(itr != pkts->end())
|
||||
{
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
#include <net/net.hpp>
|
||||
|
||||
#include <net/net_if.hpp>
|
||||
|
||||
#ifdef ANDROID
|
||||
#include <android/ifaddrs.h>
|
||||
#endif
|
||||
|
@ -11,23 +13,6 @@
|
|||
#include <ifaddrs.h>
|
||||
#endif
|
||||
|
||||
// Work around for broken glibc/linux header definitions in xenial that makes
|
||||
// including both net/if.h (which we need for if_nametoindex) and linux/if.h
|
||||
// (which tuntap.h includes) impossible. When we stop supporting xenial we can
|
||||
// remove this mess and just include net/if.h here.
|
||||
#if defined(Linux) && __GLIBC__ == 2 && __GLIBC_MINOR__ == 23
|
||||
#include <linux/version.h>
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0) \
|
||||
&& LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0)
|
||||
#define _NET_IF_H 1
|
||||
#include <linux/if.h>
|
||||
extern "C" unsigned int
|
||||
if_nametoindex(const char* __ifname) __THROW;
|
||||
#endif
|
||||
#else
|
||||
#include <net/if.h>
|
||||
#endif
|
||||
|
||||
#include <net/net_addr.hpp>
|
||||
#include <net/ip.hpp>
|
||||
#include <util/logging/logger.hpp>
|
||||
|
|
22
llarp/net/net_if.hpp
Normal file
22
llarp/net/net_if.hpp
Normal file
|
@ -0,0 +1,22 @@
|
|||
#ifndef LLARP_NET_NET_IF_HPP
|
||||
#define LLARP_NET_NET_IF_HPP
|
||||
|
||||
// this file is a shim include for #include <net/if.h>
|
||||
|
||||
// Work around for broken glibc/linux header definitions in xenial that makes
|
||||
// including both net/if.h (which we need for if_nametoindex) and linux/if.h
|
||||
// (which tuntap.h includes) impossible. When we stop supporting xenial we can
|
||||
// remove this mess and just include net/if.h here.
|
||||
#if defined(Linux) && __GLIBC__ == 2 && __GLIBC_MINOR__ == 23
|
||||
#include <linux/version.h>
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0) \
|
||||
&& LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0)
|
||||
#define _NET_IF_H 1
|
||||
#include <linux/if.h>
|
||||
extern "C" unsigned int
|
||||
if_nametoindex(const char* __ifname) __THROW;
|
||||
#endif
|
||||
#else
|
||||
#include <net/if.h>
|
||||
#endif
|
||||
#endif
|
Loading…
Reference in a new issue