You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
184 lines
5.1 KiB
Diff
184 lines
5.1 KiB
Diff
--- miniupnpd/configure
|
|
+++ miniupnpd/configure
|
|
@@ -144,11 +144,11 @@
|
|
OS_VERSION=$(cat ./os.astlinux)
|
|
fi
|
|
|
|
-# Tomato USB special case
|
|
+# FreshTomato special case
|
|
if [ -f ../shared/tomato_version ]; then
|
|
OS_NAME=Tomato
|
|
- TOMATO_VER=`cat ../shared/tomato_version | cut -d' ' -f2,3`
|
|
- OS_VERSION="Tomato $TOMATO_VER"
|
|
+ TOMATO_VER=`cat ../shared/tomato_version | cut -d' ' -f1,2`
|
|
+ OS_VERSION="FreshTomato $TOMATO_VER"
|
|
fi
|
|
|
|
# OpenEmbedded special case
|
|
@@ -468,8 +468,8 @@
|
|
FW=iptables
|
|
;;
|
|
Tomato)
|
|
- OS_NAME=UPnP
|
|
- OS_URL=http://tomatousb.org/
|
|
+ OS_NAME=FreshTomato
|
|
+ OS_URL=https://freshtomato.org/
|
|
echo "" >> ${CONFIGFILE}
|
|
echo "#ifndef TOMATO" >> ${CONFIGFILE}
|
|
echo "#define TOMATO" >> ${CONFIGFILE}
|
|
@@ -481,6 +481,7 @@
|
|
echo "#ifdef TCONFIG_IPV6" >> ${CONFIGFILE}
|
|
echo "#define ENABLE_IPV6" >> ${CONFIGFILE}
|
|
echo "#endif" >> ${CONFIGFILE}
|
|
+ HAVE_IP_MREQN=1
|
|
FW=iptables
|
|
;;
|
|
Darwin)
|
|
@@ -570,8 +571,14 @@
|
|
fi
|
|
if [ "$IPTABLES_143" = "1" ] ; then
|
|
echo "LDLIBS += ${IPTABLESPATH}/libiptc/.libs/libip4tc.o" >> config.mk
|
|
+ if [ "$TCONFIG_IPV6" = "y" ]; then
|
|
+ echo "LDLIBS += ${IPTABLESPATH}/libiptc/.libs/libip6tc.o" >> config.mk
|
|
+ fi
|
|
else
|
|
echo "LDLIBS += ${IPTABLESPATH}/libiptc/libiptc.a" >> config.mk
|
|
+ if [ "$TCONFIG_IPV6" = "y" ]; then
|
|
+ echo "LDLIBS += ${IPTABLESPATH}/libiptc/libip6tc.a" >> config.mk
|
|
+ fi
|
|
fi
|
|
else
|
|
# OpenWrt
|
|
--- miniupnpd/Makefile.linux
|
|
+++ miniupnpd/Makefile.linux
|
|
@@ -21,27 +21,29 @@
|
|
# ./configure them and build them then miniupnpd will build using :
|
|
# $ IPTABLESPATH=/path/to/iptables-1.4.1 make
|
|
#
|
|
+include ../common.mak
|
|
+
|
|
CONFIG_OPTIONS ?= $(cat .configure.cache)
|
|
CONFIG_OPTIONS += --firewall=iptables
|
|
#CFLAGS = -O -g -DDEBUG
|
|
CFLAGS ?= -Os
|
|
-CFLAGS += -fno-strict-aliasing
|
|
-CFLAGS += -fno-common
|
|
-CFLAGS += -fstack-protector -fPIE
|
|
-CFLAGS += -D_FORTIFY_SOURCE=2
|
|
+#CFLAGS += -fno-strict-aliasing
|
|
+#CFLAGS += -fno-common
|
|
+#CFLAGS += -fstack-protector -fPIE
|
|
+#CFLAGS += -D_FORTIFY_SOURCE=2
|
|
CPPFLAGS += -D_GNU_SOURCE
|
|
CFLAGS += -Wall
|
|
CFLAGS += -Wextra -Wstrict-prototypes -Wdeclaration-after-statement
|
|
#CFLAGS += -Wno-missing-field-initializers
|
|
#CFLAGS += -ansi # iptables headers does use typeof which is a gcc extension
|
|
-LDFLAGS += -Wl,-z,now -Wl,-z,relro -pie
|
|
+LDFLAGS ?= -Wl,-z,now -Wl,-z,relro -pie
|
|
CC ?= gcc
|
|
RM = rm -f
|
|
INSTALL = install
|
|
STRIP ?= strip
|
|
PKG_CONFIG ?= pkg-config
|
|
CP = cp
|
|
-DOXYGEN ?= doxygen
|
|
+#DOXYGEN ?= doxygen
|
|
|
|
DEPFLAGS = -MM -MG -MT $(patsubst %.d,%.o,$@) -MT $@
|
|
# -M : with system headers, -MM : without
|
|
@@ -52,7 +54,7 @@
|
|
MANINSTALLDIR = $(INSTALLPREFIX)/share/man/man8
|
|
|
|
include config.mk
|
|
-include $(SRCDIR)/gitrev.mk
|
|
+#include $(SRCDIR)/gitrev.mk
|
|
include $(SRCDIR)/objects.mk
|
|
|
|
# sources in netfilter/ directory
|
|
@@ -85,14 +87,14 @@
|
|
|
|
# OpenWrt packager disables https server for IGD v2 and hardcodes libuuid support
|
|
ifeq ($(TARGET_OPENWRT),)
|
|
-LDLIBS += $(shell $(PKG_CONFIG) --static --libs-only-l libssl)
|
|
+LDLIBS += $(if $(TCONFIG_HTTPS),$(shell $(PKG_CONFIG) --static --libs-only-l libssl))
|
|
|
|
-TEST := $(shell $(PKG_CONFIG) --exists uuid && echo 1)
|
|
-ifeq ($(TEST),1)
|
|
-LDLIBS += $(shell $(PKG_CONFIG) --static --libs-only-l uuid)
|
|
-else
|
|
-$(info please install uuid-dev package / libuuid)
|
|
-endif # ($(TEST),1)
|
|
+#TEST := $(shell $(PKG_CONFIG) --exists uuid && echo 1)
|
|
+#ifeq ($(TEST),1)
|
|
+#LDLIBS += $(shell $(PKG_CONFIG) --static --libs-only-l uuid)
|
|
+#else
|
|
+#$(info please install uuid-dev package / libuuid)
|
|
+#endif # ($(TEST),1)
|
|
endif # ($(TARGET_OPENWRT,)
|
|
|
|
ifneq ($(shell ldd --version | grep GLIBC),)
|
|
@@ -107,10 +109,11 @@
|
|
|
|
TESTUPNPDESCGENOBJS = testupnpdescgen.o upnpdescgen.o
|
|
|
|
-EXECUTABLES = miniupnpd testupnpdescgen testgetifstats \
|
|
- testupnppermissions miniupnpdctl testgetifaddr \
|
|
- testgetroute testasyncsendto testportinuse \
|
|
- testssdppktgen testminissdp
|
|
+EXECUTABLES = miniupnpd
|
|
+#EXECUTABLES = miniupnpd testupnpdescgen testgetifstats \
|
|
+# testupnppermissions miniupnpdctl testgetifaddr \
|
|
+# testgetroute testasyncsendto testportinuse \
|
|
+# testssdppktgen testminissdp
|
|
|
|
.PHONY: all clean install depend dox
|
|
|
|
--- miniupnpd/netfilter/iptcrdr.c
|
|
+++ miniupnpd/netfilter/iptcrdr.c
|
|
@@ -14,8 +14,12 @@
|
|
#include <netinet/in.h>
|
|
#include <arpa/inet.h>
|
|
#include <dlfcn.h>
|
|
+#ifdef BCMARM
|
|
#include <xtables.h>
|
|
+#else
|
|
+#include <iptables.h>
|
|
+#endif
|
|
#include <linux/netfilter/xt_DSCP.h>
|
|
#include <libiptc/libiptc.h>
|
|
|
|
#include <linux/version.h>
|
|
@@ -33,7 +37,7 @@
|
|
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
|
|
#define LIST_POISON2 ((void *) 0x00200200 )
|
|
|
|
-#if 0
|
|
+#ifndef BCMARM
|
|
#include <linux/netfilter/nf_nat.h>
|
|
#else
|
|
#include "tiny_nf_nat.h"
|
|
@@ -46,7 +46,7 @@
|
|
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
|
|
#include <linux/netfilter_ipv4/ip_nat.h>
|
|
#else
|
|
-#if 0
|
|
+#ifndef BCMARM
|
|
#include <linux/netfilter/nf_nat.h>
|
|
#else
|
|
#include "tiny_nf_nat.h"
|
|
--- miniupnpd/netfilter/iptpinhole.c
|
|
+++ miniupnpd/netfilter/iptpinhole.c
|
|
@@ -20,7 +20,11 @@
|
|
|
|
#ifdef ENABLE_UPNPPINHOLE
|
|
|
|
+#ifdef BCMARM
|
|
#include <xtables.h>
|
|
+#else
|
|
+#include <iptables.h>
|
|
+#endif
|
|
#include <libiptc/libip6tc.h>
|
|
#include "tiny_nf_nat.h"
|
|
|