summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Stenberg2014-11-06 13:44:06 +0000
committerMarkus Stenberg2014-11-06 13:44:06 +0000
commitc8eeeee90ae1761da0dab8d99f95f938a5d54b3e (patch)
tree22f81f99b97f03e86474c7408cbbe6eefaf4ff50
parent67e007138a28e9d5e06bc854e40efcaeda3c5ce3 (diff)
downloadrouting-c8eeeee90ae1761da0dab8d99f95f938a5d54b3e.tar.gz
miniupnpd: Upgraded to 1.9 (+ third party PCP patch).
-rw-r--r--miniupnpd/Makefile6
-rw-r--r--miniupnpd/patches/101-musl-fixes.patch21
-rw-r--r--miniupnpd/patches/101-pcp-third-party.patch75
3 files changed, 78 insertions, 24 deletions
diff --git a/miniupnpd/Makefile b/miniupnpd/Makefile
index 16803d4..2f05ec8 100644
--- a/miniupnpd/Makefile
+++ b/miniupnpd/Makefile
@@ -8,12 +8,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=miniupnpd
-PKG_VERSION:=1.8.20140906
-PKG_RELEASE:=3
+PKG_VERSION:=1.9
+PKG_RELEASE:=1
PKG_SOURCE_URL:=http://miniupnp.free.fr/files
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=72a68c5757031d906a555f84e9a2a8f2
+PKG_MD5SUM:=9151502f84f130b0ef1245ac938c33f9
PKG_MAINTAINER:=Markus Stenberg <fingon@iki.fi>
PKG_LICENSE:=BSD-3-Clause
diff --git a/miniupnpd/patches/101-musl-fixes.patch b/miniupnpd/patches/101-musl-fixes.patch
deleted file mode 100644
index 36da566..0000000
--- a/miniupnpd/patches/101-musl-fixes.patch
+++ /dev/null
@@ -1,21 +0,0 @@
---- a/miniupnpd.c
-+++ b/miniupnpd.c
-@@ -39,7 +39,7 @@
- #include <sys/param.h>
- #if defined(sun)
- #include <kstat.h>
--#else
-+#elif !defined(__linux__)
- /* for BSD's sysctl */
- #include <sys/sysctl.h>
- #endif
---- a/netfilter/iptpinhole.h
-+++ b/netfilter/iptpinhole.h
-@@ -8,6 +8,7 @@
- #define IPTPINHOLE_H_INCLUDED
-
- #ifdef ENABLE_UPNPPINHOLE
-+#include <sys/types.h>
-
- int add_pinhole(const char * ifname,
- const char * rem_host, unsigned short rem_port,
diff --git a/miniupnpd/patches/101-pcp-third-party.patch b/miniupnpd/patches/101-pcp-third-party.patch
new file mode 100644
index 0000000..b66621d
--- /dev/null
+++ b/miniupnpd/patches/101-pcp-third-party.patch
@@ -0,0 +1,75 @@
+From 27d4d10a3ed3a4d87941247ed73bcb67c68b2bb9 Mon Sep 17 00:00:00 2001
+From: Thomas Bernard <miniupnp@free.fr>
+Date: Thu, 30 Oct 2014 20:37:35 +0100
+Subject: [PATCH] miniupnpd.c: fix PCP third party mode (in IPv4)
+
+fixes problem introduced in commit 16389fda3c5313bffc83fb6594f5bb5872e37e5e
+---
+ miniupnpd.c | 38 +++++++++++++++++++++++++++-----------
+ 1 file changed, 27 insertions(+), 11 deletions(-)
+
+diff --git a/miniupnpd.c b/miniupnpd.c
+index 6468075..06bcae2 100644
+--- a/miniupnpd.c
++++ b/miniupnpd.c
+@@ -2133,30 +2133,46 @@ main(int argc, char * * argv)
+ msg_buff, sizeof(msg_buff));
+ if (len < 1)
+ continue;
++#ifdef ENABLE_PCP
++ if (msg_buff[0]==0) { /* version equals to 0 -> means NAT-PMP */
++ /* Check if the packet is coming from a LAN to enforce RFC6886 :
++ * The NAT gateway MUST NOT accept mapping requests destined to the NAT
++ * gateway's external IP address or received on its external network
++ * interface. Only packets received on the internal interface(s) with a
++ * destination address matching the internal address(es) of the NAT
++ * gateway should be allowed. */
++ /* TODO : move to ProcessIncomingNATPMPPacket() ? */
++ lan_addr = get_lan_for_peer((struct sockaddr *)&senderaddr);
++ if(lan_addr == NULL) {
++ char sender_str[64];
++ sockaddr_to_string((struct sockaddr *)&senderaddr, sender_str, sizeof(sender_str));
++ syslog(LOG_WARNING, "NAT-PMP packet sender %s not from a LAN, ignoring",
++ sender_str);
++ continue;
++ }
++ ProcessIncomingNATPMPPacket(snatpmp[i], msg_buff, len,
++ &senderaddr);
++ } else { /* everything else can be PCP */
++ ProcessIncomingPCPPacket(snatpmp[i], msg_buff, len,
++ (struct sockaddr *)&senderaddr, NULL);
++ }
++
++#else
+ /* Check if the packet is coming from a LAN to enforce RFC6886 :
+ * The NAT gateway MUST NOT accept mapping requests destined to the NAT
+ * gateway's external IP address or received on its external network
+ * interface. Only packets received on the internal interface(s) with a
+ * destination address matching the internal address(es) of the NAT
+ * gateway should be allowed. */
++ /* TODO : move to ProcessIncomingNATPMPPacket() ? */
+ lan_addr = get_lan_for_peer((struct sockaddr *)&senderaddr);
+ if(lan_addr == NULL) {
+ char sender_str[64];
+ sockaddr_to_string((struct sockaddr *)&senderaddr, sender_str, sizeof(sender_str));
+- syslog(LOG_WARNING, "NAT-PMP/PCP packet sender %s not from a LAN, ignoring",
++ syslog(LOG_WARNING, "NAT-PMP packet sender %s not from a LAN, ignoring",
+ sender_str);
+ continue;
+ }
+-#ifdef ENABLE_PCP
+- if (msg_buff[0]==0) { /* version equals to 0 -> means NAT-PMP */
+- ProcessIncomingNATPMPPacket(snatpmp[i], msg_buff, len,
+- &senderaddr);
+- } else { /* everything else can be PCP */
+- ProcessIncomingPCPPacket(snatpmp[i], msg_buff, len,
+- (struct sockaddr *)&senderaddr, NULL);
+- }
+-
+-#else
+ ProcessIncomingNATPMPPacket(snatpmp[i], msg_buff, len, &senderaddr);
+ #endif
+ }
+--
+2.1.0
+