Merge pull request #1128 from samm-git/master
authorSteven Barth <steven@midlink.org>
Sat, 11 Apr 2015 12:32:42 +0000 (14:32 +0200)
committerSteven Barth <steven@midlink.org>
Sat, 11 Apr 2015 12:32:42 +0000 (14:32 +0200)
apinger: add apinger package

13 files changed:
admin/monit/Makefile
lang/luasocket/Makefile
mail/mailman/Makefile
net/coova-chilli/Makefile
net/mdnsresponder/patches/100-linux_fixes.patch
net/mosquitto/Makefile
net/mosquitto/patches/100-libwebsockets-fixes.patch [deleted file]
net/mosquitto/patches/101-qos2-inflight.patch [new file with mode: 0644]
net/ocserv/Makefile
net/ocserv/files/ocserv.conf.template
net/ocserv/files/ocserv.init
net/ocserv/patches/001-sec-mod-do-not-impose-timeouts-on-reads-from-main.patch [new file with mode: 0644]
net/ocserv/patches/002-reject-bad-commands-from-main.patch [new file with mode: 0644]

index 9d5570f9ecb848f1bcab532c9b8884d12f192f1b..b14b2225791bd020c3b292847a1b08a0cdce4f45 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=monit
-PKG_VERSION:=5.12.1
+PKG_VERSION:=5.12.2
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://mmonit.com/monit/dist
-PKG_MD5SUM:=1ffde79207270925f6f7df787d19100a
+PKG_MD5SUM:=5f5cf4c18b42e8091b49b4e07cf972ce
 
 PKG_LICENSE:=AGPL-3.0
 PKG_LICENSE_FILES:=COPYING
index ceb70772964cc14a7dd39152747fde29cda9243d..5e7c98300fd3988c15d5291312e846ea5b3ac055 100644 (file)
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=luasocket
 PKG_SOURCE_VERSION:=6d5e40c324c84d9c1453ae88e0ad5bdd0a631448
 PKG_VERSION:=3.0-rc1-20130909
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=https://github.com/diegonehab/luasocket.git
@@ -56,6 +56,7 @@ define Package/luasocket/install
        ln -sf ../mime.so.1.0.3 $(1)/usr/lib/lua/mime/core.so
        $(INSTALL_DIR) $(1)/usr/lib/lua/socket
        $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/{ftp,http,smtp,tp,url,headers}.lua $(1)/usr/lib/lua/socket
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/unix.so $(1)/usr/lib/lua/socket
        ln -sf ../socket.so.3.0-rc1 $(1)/usr/lib/lua/socket/core.so
 endef
 
index 2e1b9f83cbcce2c284a29a0975a4b72656fac5a8..eee50f85dc7a51258773f06e0f24623bf2b68a7d 100644 (file)
@@ -10,8 +10,8 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=mailman
 PKG_RELEASE:=1
 PKG_SOURCE_URL:=ftp://ftp.gnu.org/gnu/mailman/ http://ftp.gnu.org/gnu/mailman/
-PKG_VERSION:=2.1.19
-PKG_MD5SUM:=13a33d758f8a6308c91dd267fc3ba123
+PKG_VERSION:=2.1.20
+PKG_MD5SUM:=96819640406f90a12bc28edd3dc09d4a
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
 PKG_MAINTAINER:=Denis Shulyaka <Shulyaka@gmail.com>
 PKG_LICENSE:=GPL-2.0+
index 2ff8729edb2414932fc748171b7c1385d6a70d06..29bfca682c19ed8a7fd5a982a44873e025a943af 100644 (file)
@@ -80,7 +80,7 @@ define Build/Configure
        $(if $(CONFIG_COOVACHILLI_LARGELIMITS),--enable,--disable)-largelimits \
        $(if $(CONFIG_COOVACHILLI_UAMDOMAINFILE),--enable,--disable)-uamdomainfile \
        $(if $(CONFIG_COOVACHILLI_MATRIXSSL),--with,--without)-matrixssl \
-       $(if $(CONFIG_COOVACHILLI_CYASSL),--with,--without)-cyaxssl \
+       $(if $(CONFIG_COOVACHILLI_CYASSL),--with,--without)-cyassl \
        $(if $(CONFIG_COOVACHILLI_OPENSSL),--with,--without)-openssl \
        )
 endef
index 512c1738aa9b0e1f1ca3233c62ef8e9eb6a2a091..51b94848600e1d3265f849a77f6ed7924d7453f0 100644 (file)
@@ -1,3 +1,6 @@
+diff --git a/.gitignore b/.gitignore
+new file mode 100644
+index 0000000..920cdfc
 --- /dev/null
 +++ b/.gitignore
 @@ -0,0 +1,4 @@
@@ -5,6 +8,21 @@
 +mDNSPosix/build
 +mDNSPosix/objects
 +
+diff --git a/Clients/Makefile b/Clients/Makefile
+index 383af31..925c20e 100755
+--- a/Clients/Makefile
++++ b/Clients/Makefile
+@@ -34,7 +34,7 @@ TARGETS = build/dns-sd build/dns-sd64
+ LIBS =
+ else
+ TARGETS = build/dns-sd
+-LIBS = -L../mDNSPosix/build/prod/ -ldns_sd
++LIBS ?= -L../mDNSPosix/build/prod/ -ldns_sd
+ endif
+ all: $(TARGETS)
+diff --git a/mDNSPosix/PosixDaemon.c b/mDNSPosix/PosixDaemon.c
+index 88b3292..e86a6c7 100644
 --- a/mDNSPosix/PosixDaemon.c
 +++ b/mDNSPosix/PosixDaemon.c
 @@ -37,6 +37,11 @@
      if (mStatus_NoError == err)
          err = MainLoop(&mDNSStorage);
  
+diff --git a/mDNSPosix/Responder.c b/mDNSPosix/Responder.c
+index 3996b7b..e58d8eb 100755
 --- a/mDNSPosix/Responder.c
 +++ b/mDNSPosix/Responder.c
-@@ -603,7 +603,8 @@ static mStatus RegisterServicesInFile(co
+@@ -603,7 +603,8 @@ static mStatus RegisterServicesInFile(const char *filePath)
          status = mStatus_UnknownErr;
      }
  
  
      return status;
  }
+diff --git a/mDNSPosix/mDNSPosix.c b/mDNSPosix/mDNSPosix.c
+index 6effa12..d3acf99 100755
 --- a/mDNSPosix/mDNSPosix.c
 +++ b/mDNSPosix/mDNSPosix.c
-@@ -138,7 +138,7 @@ mDNSlocal void SockAddrTomDNSAddr(const
+@@ -138,7 +138,7 @@ mDNSlocal void SockAddrTomDNSAddr(const struct sockaddr *const sa, mDNSAddr *ipA
  
  // mDNS core calls this routine when it needs to send a packet.
  mDNSexport mStatus mDNSPlatformSendUDP(const mDNS *const m, const void *const msg, const mDNSu8 *const end,
                                         mDNSIPPort dstPort, mDNSBool useBackgroundTrafficClass)
  {
      int err = 0;
-@@ -583,9 +583,17 @@ mDNSlocal void FreePosixNetworkInterface
+@@ -583,9 +583,17 @@ mDNSlocal void FreePosixNetworkInterface(PosixNetworkInterface *intf)
  {
      assert(intf != NULL);
      if (intf->intfName != NULL) free((void *)intf->intfName);
  #endif
  
      // Move interface to the RecentInterfaces list for a minute
-@@ -724,6 +732,29 @@ mDNSlocal int SetupSocket(struct sockadd
+@@ -724,6 +732,29 @@ mDNSlocal int SetupSocket(struct sockaddr *intfAddr, mDNSIPPort port, int interf
              if (err < 0) { err = errno; perror("setsockopt - IP_MULTICAST_TTL"); }
          }
  
          // And start listening for packets
          if (err == 0)
          {
-@@ -805,6 +836,29 @@ mDNSlocal int SetupSocket(struct sockadd
+@@ -805,6 +836,29 @@ mDNSlocal int SetupSocket(struct sockaddr *intfAddr, mDNSIPPort port, int interf
              if (err < 0) { err = errno; perror("setsockopt - IPV6_MULTICAST_HOPS"); }
          }
  
          // And start listening for packets
          if (err == 0)
          {
-@@ -836,7 +890,12 @@ mDNSlocal int SetupSocket(struct sockadd
+@@ -836,7 +890,12 @@ mDNSlocal int SetupSocket(struct sockaddr *intfAddr, mDNSIPPort port, int interf
      }
  
      // Clean up
      assert((err == 0) == (*sktPtr != -1));
      return err;
  }
-@@ -1026,7 +1085,7 @@ mDNSlocal mStatus OpenIfNotifySocket(int
+@@ -1026,7 +1085,7 @@ mDNSlocal mStatus OpenIfNotifySocket(int *pFD)
      /* Subscribe the socket to Link & IP addr notifications. */
      mDNSPlatformMemZero(&snl, sizeof snl);
      snl.nl_family = AF_NETLINK;
      ret = bind(sock, (struct sockaddr *) &snl, sizeof snl);
      if (0 == ret)
          *pFD = sock;
-@@ -1104,11 +1163,18 @@ mDNSlocal mDNSu32       ProcessRoutingNo
+@@ -1104,11 +1163,18 @@ mDNSlocal mDNSu32       ProcessRoutingNotification(int sd)
          PrintNetLinkMsg(pNLMsg);
  #endif
  
  
          // Advance pNLMsg to the next message in the buffer
          if ((pNLMsg->nlmsg_flags & NLM_F_MULTI) != 0 && pNLMsg->nlmsg_type != NLMSG_DONE)
-@@ -1279,8 +1345,12 @@ mDNSexport mStatus mDNSPlatformInit(mDNS
+@@ -1279,8 +1345,12 @@ mDNSexport mStatus mDNSPlatformInit(mDNS *const m)
      if (err == mStatus_NoError) err = SetupSocket(&sa, zeroIPPort, 0, &m->p->unicastSocket6);
  #endif
  
  
      // Tell mDNS core about DNS Servers
      mDNS_Lock(m);
-@@ -1313,9 +1383,17 @@ mDNSexport void mDNSPlatformClose(mDNS *
+@@ -1313,9 +1383,17 @@ mDNSexport void mDNSPlatformClose(mDNS *const m)
  {
      assert(m != NULL);
      ClearInterfaceList(m);
  #endif
  }
  
-@@ -1571,14 +1649,14 @@ mDNSexport mStatus    mDNSPlatformClearS
+@@ -1571,14 +1649,14 @@ mDNSexport mStatus    mDNSPlatformClearSPSMACAddr(void)
  mDNSexport mDNSu16 mDNSPlatformGetUDPPort(UDPSocket *sock)
  {
      (void) sock; // unused
      return mDNSfalse;
  }
  
+diff --git a/mDNSPosix/mDNSUNP.c b/mDNSPosix/mDNSUNP.c
+index b392fc7..fe800af 100755
 --- a/mDNSPosix/mDNSUNP.c
 +++ b/mDNSPosix/mDNSUNP.c
-@@ -61,154 +61,86 @@
- #endif
+@@ -63,6 +63,7 @@
  #if defined(AF_INET6) && HAVE_IPV6 && HAVE_LINUX
--#include <netdb.h>
--#include <arpa/inet.h>
-+#include <sys/types.h>
-+#include <ifaddrs.h>
--/* Converts a prefix length to IPv6 network mask */
--void plen_to_mask(int plen, char *addr) {
--    int i;
--    int colons=7; /* Number of colons in IPv6 address */
--    int bits_in_block=16; /* Bits per IPv6 block */
--    for(i=0; i<=colons; i++) {
--        int block, ones=0xffff, ones_in_block;
--        if (plen>bits_in_block) ones_in_block=bits_in_block;
--        else ones_in_block=plen;
--        block = ones & (ones << (bits_in_block-ones_in_block));
--        i==0 ? sprintf(addr, "%x", block) : sprintf(addr, "%s:%x", addr, block);
--        plen -= ones_in_block;
--    }
--}
--/* Gets IPv6 interface information from the /proc filesystem in linux*/
--struct ifi_info *get_ifi_info_linuxv6(int family, int doaliases)
-+/* Correct way to deal with this is just to use getifaddrs (glibc
-+ * 2.3.3+ and various BSDs, but BSDs are 'slightly different' just to
-+ * make life interesting). We assume Linux getifaddrs is available,
-+ * and if not, please upgrade. */
-+struct ifi_info *get_ifi_info_linuxv6(int doaliases)
- {
--    struct ifi_info *ifi, *ifihead, **ifipnext, *ifipold, **ifiptr;
--    FILE *fp;
--    char addr[8][5];
--    int flags, myflags, index, plen, scope;
+ #include <netdb.h>
+ #include <arpa/inet.h>
++#include <linux/if_addr.h>
+ /* Converts a prefix length to IPv6 network mask */
+ void plen_to_mask(int plen, char *addr) {
+@@ -86,7 +87,7 @@ struct ifi_info *get_ifi_info_linuxv6(int family, int doaliases)
+     FILE *fp;
+     char addr[8][5];
+     int flags, myflags, index, plen, scope;
 -    char ifname[9], lastname[IFNAMSIZ];
--    char addr6[32+7+1]; /* don't forget the seven ':' */
--    struct addrinfo hints, *res0;
--    struct sockaddr_in6 *sin6;
--    struct in6_addr *addrptr;
--    int err;
--    int sockfd = -1;
--    struct ifreq ifr;
++    char ifname[IFNAMSIZ], lastname[IFNAMSIZ];
+     char addr6[32+7+1]; /* don't forget the seven ':' */
+     struct addrinfo hints, *res0;
+     struct sockaddr_in6 *sin6;
+@@ -94,7 +95,8 @@ struct ifi_info *get_ifi_info_linuxv6(int family, int doaliases)
+     int err;
+     int sockfd = -1;
+     struct ifreq ifr;
 -
--    res0=NULL;
--    ifihead = NULL;
--    ifipnext = &ifihead;
--    lastname[0] = 0;
--
--    if ((fp = fopen(PROC_IFINET6_PATH, "r")) != NULL) {
--        sockfd = socket(AF_INET6, SOCK_DGRAM, 0);
--        if (sockfd < 0) {
--            goto gotError;
--        }
--        while (fscanf(fp,
++    char mask[64] = "%4s%4s%4s%4s%4s%4s%4s%4s %02x %02x %02x %02x %";
++    sprintf(mask+strlen(mask), "%ds\n", IFNAMSIZ);
+     res0=NULL;
+     ifihead = NULL;
+     ifipnext = &ifihead;
+@@ -106,11 +108,12 @@ struct ifi_info *get_ifi_info_linuxv6(int family, int doaliases)
+             goto gotError;
+         }
+         while (fscanf(fp,
 -                      "%4s%4s%4s%4s%4s%4s%4s%4s %02x %02x %02x %02x %8s\n",
--                      addr[0],addr[1],addr[2],addr[3],
--                      addr[4],addr[5],addr[6],addr[7],
--                      &index, &plen, &scope, &flags, ifname) != EOF) {
--
--            myflags = 0;
--            if (strncmp(lastname, ifname, IFNAMSIZ) == 0) {
--                if (doaliases == 0)
--                    continue;   /* already processed this interface */
--                myflags = IFI_ALIAS;
--            }
--            memcpy(lastname, ifname, IFNAMSIZ);
--            ifi = (struct ifi_info*)calloc(1, sizeof(struct ifi_info));
--            if (ifi == NULL) {
--                goto gotError;
--            }
--
--            ifipold   = *ifipnext;       /* need this later */
--            ifiptr    = ifipnext;
--            *ifipnext = ifi;            /* prev points to this new one */
--            ifipnext = &ifi->ifi_next;  /* pointer to next one goes here */
--
--            sprintf(addr6, "%s:%s:%s:%s:%s:%s:%s:%s",
--                    addr[0],addr[1],addr[2],addr[3],
--                    addr[4],addr[5],addr[6],addr[7]);
--
--            /* Add address of the interface */
--            memset(&hints, 0, sizeof(hints));
--            hints.ai_family = AF_INET6;
--            hints.ai_flags = AI_NUMERICHOST;
--            err = getaddrinfo(addr6, NULL, &hints, &res0);
--            if (err) {
--                goto gotError;
--            }
--            ifi->ifi_addr = calloc(1, sizeof(struct sockaddr_in6));
--            if (ifi->ifi_addr == NULL) {
--                goto gotError;
--            }
--            memcpy(ifi->ifi_addr, res0->ai_addr, sizeof(struct sockaddr_in6));
--
--            /* Add netmask of the interface */
--            char ipv6addr[INET6_ADDRSTRLEN];
--            plen_to_mask(plen, ipv6addr);
--            ifi->ifi_netmask = calloc(1, sizeof(struct sockaddr_in6));
--            if (ifi->ifi_addr == NULL) {
--                goto gotError;
--            }
--            sin6=calloc(1, sizeof(struct sockaddr_in6));
--            addrptr=calloc(1, sizeof(struct in6_addr));
--            inet_pton(family, ipv6addr, addrptr);
--            sin6->sin6_family=family;
--            sin6->sin6_addr=*addrptr;
--            sin6->sin6_scope_id=scope;
--            memcpy(ifi->ifi_netmask, sin6, sizeof(struct sockaddr_in6));
--            free(sin6);
--
--
--            /* Add interface name */
--            memcpy(ifi->ifi_name, ifname, IFI_NAME);
--
--            /* Add interface index */
--            ifi->ifi_index = index;
--
--            /* Add interface flags*/
--            memcpy(ifr.ifr_name, ifname, IFNAMSIZ);
--            if (ioctl(sockfd, SIOCGIFFLAGS, &ifr) < 0) {
--                if (errno == EADDRNOTAVAIL) {
--                    /*
--                     * If the main interface is configured with no IP address but
--                     * an alias interface exists with an IP address, you get
--                     * EADDRNOTAVAIL for the main interface
--                     */
--                    free(ifi->ifi_addr);
--                    free(ifi);
--                    ifipnext  = ifiptr;
--                    *ifipnext = ifipold;
--                    continue;
--                } else {
--                    goto gotError;
--                }
--            }
--            ifi->ifi_flags = ifr.ifr_flags;
--            freeaddrinfo(res0);
--            res0=NULL;
--        }
--    }
--    goto done;
-+  struct ifaddrs *ifap, *ifa;
-+  struct ifi_info *ifi = NULL, *head = NULL;
--gotError:
--    if (ifihead != NULL) {
--        free_ifi_info(ifihead);
--        ifihead = NULL;
--    }
--    if (res0 != NULL) {
--        freeaddrinfo(res0);
--        res0=NULL;
-+  /* doaliases seems always true in the calls in current code */
-+  assert(doaliases);
-+
-+  if (getifaddrs(&ifap) < 0)
-+    {
-+      return NULL;
++                      mask,
+                       addr[0],addr[1],addr[2],addr[3],
+                       addr[4],addr[5],addr[6],addr[7],
+                       &index, &plen, &scope, &flags, ifname) != EOF) {
++            if (flags & IFA_F_DEPRECATED) continue;
+             myflags = 0;
+             if (strncmp(lastname, ifname, IFNAMSIZ) == 0) {
+                 if (doaliases == 0)
+@@ -205,7 +208,8 @@ gotError:
      }
--done:
--    if (sockfd != -1) {
+ done:
+     if (sockfd != -1) {
 -        assert(close(sockfd) == 0);
-+  for (ifa = ifap ; ifa ; ifa = ifa->ifa_next)
-+    {
-+      /* Care only about IPv6 addresses on non-point-to-point links. */
-+      if (!ifa->ifa_addr
-+          || ifa->ifa_addr->sa_family != AF_INET6)
-+        continue;
-+      ifi = calloc(1, sizeof(*ifi));
-+      if (!ifi)
-+        break;
-+      strncpy(ifi->ifi_name, ifa->ifa_name, IFI_NAME);
-+      /* We ignore ifi_{haddr,hlen}, everyone else does too */
-+      ifi->ifi_flags = ifa->ifa_flags;
-+      /* We ignore ifi_myflags; IFI_ALIAS isn't used anywhere */
-+      ifi->ifi_index = if_nametoindex(ifa->ifa_name);
-+      if (!(ifi->ifi_addr = malloc(sizeof(struct sockaddr_in6))))
-+        break;
-+      memcpy(ifi->ifi_addr, ifa->ifa_addr, sizeof(struct sockaddr_in6));
-+
-+      if (ifa->ifa_netmask)
-+        {
-+          if (!(ifi->ifi_netmask = malloc(sizeof(struct sockaddr_in6))))
-+            break;
-+          memcpy(ifi->ifi_netmask, ifa->ifa_netmask,
-+                 sizeof(struct sockaddr_in6));
-+        }
-+
-+      if (!(ifi->ifi_addr = malloc(sizeof(struct sockaddr_in6))))
-+        break;
-+      memcpy(ifi->ifi_addr, ifa->ifa_addr, sizeof(struct sockaddr_in6));
-+
-+
-+      if (ifa->ifa_flags & IFF_POINTOPOINT && ifa->ifa_dstaddr)
-+        {
-+          if (!(ifi->ifi_dstaddr = malloc(sizeof(struct sockaddr_in6))))
-+            break;
-+          memcpy(ifi->ifi_dstaddr, ifa->ifa_dstaddr,
-+                 sizeof(struct sockaddr_in6));
-+        }
-+      else if (ifa->ifa_broadaddr)
-+        {
-+          if (!(ifi->ifi_brdaddr = malloc(sizeof(struct sockaddr_in6))))
-+            break;
-+          memcpy(ifi->ifi_brdaddr, ifa->ifa_broadaddr,
-+                 sizeof(struct sockaddr_in6));
-+        }
-+      ifi->ifi_next = head;
-+      head = ifi;
-+      ifi = NULL;
-+    };
-+  if (ifi)
-+    {
-+      /* An error occurred. Let's bail out. */
-+      ifi->ifi_next = head;
-+      free_ifi_info(head);
-+      return NULL;
++      int rv = close(sockfd);
++      assert(rv == 0);
      }
--    return(ifihead);    /* pointer to first structure in linked list */
-+  freeifaddrs(ifap);
-+  return head;
+     return(ifihead);    /* pointer to first structure in linked list */
  }
-+
- #endif // defined(AF_INET6) && HAVE_IPV6 && HAVE_LINUX
- struct ifi_info *get_ifi_info(int family, int doaliases)
-@@ -229,7 +161,7 @@ struct ifi_info *get_ifi_info(int family
- #endif
- #if defined(AF_INET6) && HAVE_IPV6 && HAVE_LINUX
--    if (family == AF_INET6) return get_ifi_info_linuxv6(family, doaliases);
-+    if (family == AF_INET6) return get_ifi_info_linuxv6(doaliases);
- #endif
-     sockfd = -1;
---- a/mDNSPosix/mDNSUNP.h
-+++ b/mDNSPosix/mDNSUNP.h
-@@ -97,8 +97,7 @@ struct ifi_info {
- };
- #if defined(AF_INET6) && HAVE_IPV6 && HAVE_LINUX
--#define PROC_IFINET6_PATH "/proc/net/if_inet6"
--extern struct ifi_info  *get_ifi_info_linuxv6(int family, int doaliases);
-+extern struct ifi_info  *get_ifi_info_linuxv6(int doaliases);
- #endif
- #if defined(AF_INET6) && HAVE_IPV6
+diff --git a/mDNSShared/dnsextd_parser.y b/mDNSShared/dnsextd_parser.y
+index 18c5990..d4b63ce 100644
 --- a/mDNSShared/dnsextd_parser.y
 +++ b/mDNSShared/dnsextd_parser.y
 @@ -15,6 +15,8 @@
index f7b0a918c5a359c95f9bcab830c655c33a0170d2..5b015795c3af0f37634d16bc3aba5b7b60379ca4 100644 (file)
@@ -9,14 +9,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=mosquitto
-PKG_VERSION:=1.4
+PKG_VERSION:=1.4.1
 PKG_RELEASE:=2
 PKG_LICENSE:=BSD-3-Clause
 PKG_LICENSE_FILES:=LICENSE.txt
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://mosquitto.org/files/source/
-PKG_MD5SUM:=cd879f5964311501ba8e2275add71484
+PKG_MD5SUM:=46008028563eb750c6aa93281ab2e181
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
 
 include $(INCLUDE_DIR)/package.mk
diff --git a/net/mosquitto/patches/100-libwebsockets-fixes.patch b/net/mosquitto/patches/100-libwebsockets-fixes.patch
deleted file mode 100644 (file)
index 4d107b1..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/src/websockets.c b/src/websockets.c
-index 95f8a81..cf2b5e7 100644
---- a/src/websockets.c
-+++ b/src/websockets.c
-@@ -72,7 +72,7 @@ struct libws_http_data {
-       FILE *fptr;
- };
--#ifndef HTTP_STATUS_NOT_FOUND
-+#ifndef LWS_FEATURE_SERVE_HTTP_FILE_HAS_OTHER_HEADERS_ARG
-       /* This is libwebsockets 1.2.x or earlier, we have to degrade our capabilities.
-        * Once lws 1.3 is widely available this should be removed. */
- #     define LWS_IS_OLD
diff --git a/net/mosquitto/patches/101-qos2-inflight.patch b/net/mosquitto/patches/101-qos2-inflight.patch
new file mode 100644 (file)
index 0000000..61706d3
--- /dev/null
@@ -0,0 +1,12 @@
+diff --git a/lib/mosquitto.c b/lib/mosquitto.c
+index bd9dbd3..7314248 100644
+--- a/lib/mosquitto.c
++++ b/lib/mosquitto.c
+@@ -594,7 +594,6 @@ int mosquitto_publish(struct mosquitto *mosq, int *mid, const char *topic, int p
+               pthread_mutex_lock(&mosq->out_message_mutex);
+               _mosquitto_message_queue(mosq, message, mosq_md_out);
+               if(mosq->max_inflight_messages == 0 || mosq->inflight_messages < mosq->max_inflight_messages){
+-                      mosq->inflight_messages++;
+                       if(qos == 1){
+                               message->state = mosq_ms_wait_for_puback;
+                       }else if(qos == 2){
index b38e9b452a04cfc8fe2e68a341ce191bf0f69a1a..050fdc74d07d33c53e3e05328d1ee8fe3d2ca2b1 100644 (file)
@@ -8,13 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ocserv
-PKG_VERSION:=0.9.2
-PKG_RELEASE:=2
+PKG_VERSION:=0.10.2
+PKG_RELEASE:=1
 
 PKG_BUILD_DIR :=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_SOURCE_URL :=ftp://ftp.infradead.org/pub/ocserv/
-PKG_MD5SUM:=9697c37cc81b30be2b178258ee595d97
+PKG_SOURCE_URL:=ftp://ftp.infradead.org/pub/ocserv/
+PKG_MD5SUM:=32ce2c2a00a97ab7c27e571aae207b2d
 
 PKG_LICENSE:=GPLv2
 PKG_LICENSE_FILES:=COPYING
index 1694fd782a76941dfcf13367e177d0a4ee0c7ffa..b5bbec31ed276047af0871d833af2aa1903b5f5a 100644 (file)
@@ -35,7 +35,7 @@ max-clients = |MAX_CLIENTS|
 
 # Limit the number of client connections to one every X milliseconds 
 # (X is the provided value). Set to zero for no limit.
-#rate-limit-ms = 100
+rate-limit-ms = 100
 
 # Limit the number of identical clients (i.e., users connecting 
 # multiple times). Unset or set to zero for unlimited.
@@ -142,6 +142,27 @@ auth-timeout = 40
 # a failed authentication attempt.
 min-reauth-time = 360
 
+# Banning clients in ocserv works with a point system. IP addresses
+# that get a score over that configured number are banned for
+# min-reauth-time seconds. By default a wrong password attempt is 10 points,
+# a KKDCP POST is 1 point, and a connection is 1 point. Note that
+# due to difference processes being involved the count of points
+# will not be real-time precise.
+#
+# Score banning cannot be reliably used when receiving proxied connections
+# locally from an HTTP server (i.e., when listen-clear-file is used).
+#
+# Set to zero to disable.
+max-ban-score = 50
+
+# The time (in seconds) that all score kept for a client is reset.
+ban-reset-time = 300
+
+# In case you'd like to change the default points.
+#ban-points-wrong-password = 10
+#ban-points-connection = 1
+#ban-points-kkdcp = 1
+
 # Cookie timeout (in seconds)
 # which he can reconnect. That cookie will be invalided if not
 # used within this timeout value. On a user disconnection, that
index aee342d685fd39d22f3df84d459e97c8b3667634..fe0718b3b88f9de94ce42788d3b90272fc0c1a90 100644 (file)
@@ -34,7 +34,7 @@ setup_config() {
        ipv6_addr=`echo $ip6addr|cut -d '/' -f 1`
        ipv6_prefix=`echo $ip6addr|cut -d '/' -f 2`
 
-       test $auth = "plain" && authsuffix="\[/var/etc/ocpasswd\]"
+       test $auth = "plain" && authsuffix="\[passwd=/var/etc/ocpasswd\]"
 
        dyndns="false"
        hostname=`uci show ddns|grep domain|head -1|cut -d '=' -f 2 2>/dev/null`
diff --git a/net/ocserv/patches/001-sec-mod-do-not-impose-timeouts-on-reads-from-main.patch b/net/ocserv/patches/001-sec-mod-do-not-impose-timeouts-on-reads-from-main.patch
new file mode 100644 (file)
index 0000000..0d3d221
--- /dev/null
@@ -0,0 +1,104 @@
+From 0967f05f8d7665a67f3cb0fbed46c48dc7ec74cb Mon Sep 17 00:00:00 2001
+From: Nikos Mavrogiannopoulos <nmav@redhat.com>
+Date: Tue, 31 Mar 2015 10:13:08 +0200
+Subject: [PATCH] sec-mod: do not impose timeouts on reads from main
+
+---
+ src/sec-mod.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++-------
+ 1 file changed, 53 insertions(+), 7 deletions(-)
+
+diff --git a/src/sec-mod.c b/src/sec-mod.c
+index b824e87..5a0763d 100644
+--- a/src/sec-mod.c
++++ b/src/sec-mod.c
+@@ -404,7 +404,56 @@ static void check_other_work(sec_mod_st *sec)
+ }
+ static
+-int serve_request(sec_mod_st *sec, int cfd, unsigned is_main, uint8_t *buffer, unsigned buffer_size)
++int serve_request_main(sec_mod_st *sec, int cfd, uint8_t *buffer, unsigned buffer_size)
++{
++      int ret, e;
++      unsigned cmd, length;
++      uint16_t l16;
++      void *pool = buffer;
++
++      /* read request */
++      ret = force_read(cfd, buffer, 3);
++      if (ret == 0)
++              goto leave;
++      else if (ret < 3) {
++              e = errno;
++              seclog(sec, LOG_INFO, "error receiving msg head: %s",
++                     strerror(e));
++              ret = ERR_BAD_COMMAND;
++              goto leave;
++      }
++
++      cmd = buffer[0];
++      memcpy(&l16, &buffer[1], 2);
++      length = l16;
++
++      if (length > buffer_size - 4) {
++              seclog(sec, LOG_INFO, "too big message (%d)", length);
++              ret = ERR_BAD_COMMAND;
++              goto leave;
++      }
++
++      /* read the body */
++      ret = force_read(cfd, buffer, length);
++      if (ret < 0) {
++              e = errno;
++              seclog(sec, LOG_INFO, "error receiving msg body: %s",
++                     strerror(e));
++              ret = ERR_BAD_COMMAND;
++              goto leave;
++      }
++
++      ret = process_packet_from_main(pool, cfd, sec, cmd, buffer, ret);
++      if (ret < 0) {
++              seclog(sec, LOG_INFO, "error processing data for '%s' command (%d)", cmd_request_to_str(cmd), ret);
++      }
++      
++ leave:
++      return ret;
++}
++
++static
++int serve_request(sec_mod_st *sec, int cfd, uint8_t *buffer, unsigned buffer_size)
+ {
+       int ret, e;
+       unsigned cmd, length;
+@@ -443,10 +492,7 @@ int serve_request(sec_mod_st *sec, int cfd, unsigned is_main, uint8_t *buffer, u
+               goto leave;
+       }
+-      if (is_main)
+-              ret = process_packet_from_main(pool, cfd, sec, cmd, buffer, ret);
+-      else
+-              ret = process_packet(pool, cfd, sec, cmd, buffer, ret);
++      ret = process_packet(pool, cfd, sec, cmd, buffer, ret);
+       if (ret < 0) {
+               seclog(sec, LOG_INFO, "error processing data for '%s' command (%d)", cmd_request_to_str(cmd), ret);
+       }
+@@ -677,7 +723,7 @@ void sec_mod_server(void *main_pool, struct perm_cfg_st *perm_config, const char
+                       if (buffer == NULL) {
+                               seclog(sec, LOG_ERR, "error in memory allocation");
+                       } else {
+-                              ret = serve_request(sec, cmd_fd, 1, buffer, buffer_size);
++                              ret = serve_request_main(sec, cmd_fd, buffer, buffer_size);
+                               if (ret < 0 && ret == ERR_BAD_COMMAND) {
+                                       seclog(sec, LOG_ERR, "error processing command from main");
+                                       exit(1);
+@@ -710,7 +756,7 @@ void sec_mod_server(void *main_pool, struct perm_cfg_st *perm_config, const char
+                               if (buffer == NULL) {
+                                       seclog(sec, LOG_ERR, "error in memory allocation");
+                               } else {
+-                                      serve_request(sec, cfd, 0, buffer, buffer_size);
++                                      serve_request(sec, cfd, buffer, buffer_size);
+                                       talloc_free(buffer);
+                               }
+                       }
+-- 
+2.1.4
+
diff --git a/net/ocserv/patches/002-reject-bad-commands-from-main.patch b/net/ocserv/patches/002-reject-bad-commands-from-main.patch
new file mode 100644 (file)
index 0000000..b3e72d3
--- /dev/null
@@ -0,0 +1,34 @@
+From 99dd4a6e03b669a5b5fe234fa665b75bbd95c593 Mon Sep 17 00:00:00 2001
+From: Nikos Mavrogiannopoulos <nmav@redhat.com>
+Date: Tue, 7 Apr 2015 17:13:29 +0200
+Subject: [PATCH] reject bad commands from main
+
+---
+ src/sec-mod.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/sec-mod.c b/src/sec-mod.c
+index 5a0763d..7783264 100644
+--- a/src/sec-mod.c
++++ b/src/sec-mod.c
+@@ -325,7 +325,7 @@ int process_packet_from_main(void *pool, int cfd, sec_mod_st * sec, cmd_request_
+                                            data.data);
+               if (msg == NULL) {
+                       seclog(sec, LOG_INFO, "error unpacking auth ban ip reply\n");
+-                      return -1;
++                      return ERR_BAD_COMMAND;
+               }
+               handle_sec_auth_ban_ip_reply(cfd, sec, msg);
+@@ -342,7 +342,7 @@ int process_packet_from_main(void *pool, int cfd, sec_mod_st * sec, cmd_request_
+                                                     data.data);
+                       if (msg == NULL) {
+                               seclog(sec, LOG_INFO, "error unpacking session close\n");
+-                              return -1;
++                              return ERR_BAD_COMMAND;
+                       }
+                       ret = handle_sec_auth_session_cmd(cfd, sec, msg, cmd);
+-- 
+2.1.4
+