Permalink
Browse files

- sshttp: moving conditional include (issue#7), untested

  • Loading branch information...
stealth committed Aug 27, 2016
1 parent 0a1edf6 commit 333b0c322b808ed25d41f91cd73def99d931f7d9
Showing with 10 additions and 5 deletions.
  1. +10 −5 socket.cc
View
@@ -44,6 +44,16 @@
#include "socket.h"
#include "config.h"
#if defined(LINUX24) || defined(LINUX26)
#include <linux/netfilter_ipv4.h>
#include <linux/netfilter_ipv6.h>
#ifndef IP6T_SO_ORIGINAL_DST
#define IP6T_SO_ORIGINAL_DST 80
#endif
#endif
namespace NS_Socket {
@@ -128,18 +138,13 @@ int dstaddr(int sock, sockaddr *dst, socklen_t dlen)
return -1;
}
#elif defined(LINUX24) || defined(LINUX26)
#include <linux/netfilter_ipv4.h>
if (dlen == sizeof(sockaddr_in)) {
if (getsockopt(sock, SOL_IP, SO_ORIGINAL_DST, dst, &dlen) < 0) {
error = "NS_Socket::dstaddr::getsockopt:";
error += strerror(errno);
return -1;
}
} else {
#include <linux/netfilter_ipv6.h>
#ifndef IP6T_SO_ORIGINAL_DST
#define IP6T_SO_ORIGINAL_DST 80
#endif
if (getsockopt(sock, SOL_IPV6, IP6T_SO_ORIGINAL_DST, dst, &dlen) < 0) {
error = "NS_Socket::dstaddr::getsockopt:";
error += strerror(errno);

0 comments on commit 333b0c3

Please sign in to comment.