Merge pull request #64 from lbschenkel/smcroute
authorsbyx <steven@midlink.org>
Tue, 18 Nov 2014 08:47:24 +0000 (09:47 +0100)
committersbyx <steven@midlink.org>
Tue, 18 Nov 2014 08:47:24 +0000 (09:47 +0100)
smcroute: Use correct file name in conffiles.

miniupnpd/Makefile
miniupnpd/patches/101-musl-fixes.patch [deleted file]
miniupnpd/patches/101-pcp-third-party.patch [new file with mode: 0644]

index 16803d4308706e1f83900f06e0096e1193ac6710..2f05ec8124866a436c64933d9f8e01ef97946557 100644 (file)
@@ -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 (file)
index 36da566..0000000
+++ /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 (file)
index 0000000..b66621d
--- /dev/null
@@ -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
+