Author: cyrus
Date: 2015-01-13 20:02:32 +0100 (Tue, 13 Jan 2015)
New Revision: 43962

Modified:
   branches/barrier_breaker/package/network/ipv6/map/Makefile
   branches/barrier_breaker/package/network/ipv6/map/files/map.sh
   branches/barrier_breaker/package/network/ipv6/map/src/mapcalc.c
Log:
map: backport fixes from trunk

Signed-off-by: Steven Barth <[email protected]>

Modified: branches/barrier_breaker/package/network/ipv6/map/Makefile
===================================================================
--- branches/barrier_breaker/package/network/ipv6/map/Makefile  2015-01-13 
19:00:39 UTC (rev 43961)
+++ branches/barrier_breaker/package/network/ipv6/map/Makefile  2015-01-13 
19:02:32 UTC (rev 43962)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2014 OpenWrt.org
+# Copyright (C) 2014-2015 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -8,8 +8,9 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=map
-PKG_VERSION:=2
-PKG_RELEASE:=1
+PKG_VERSION:=3
+PKG_RELEASE:=2
+PKG_LICENSE:=GPL-2.0
 
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/cmake.mk

Modified: branches/barrier_breaker/package/network/ipv6/map/files/map.sh
===================================================================
--- branches/barrier_breaker/package/network/ipv6/map/files/map.sh      
2015-01-13 19:00:39 UTC (rev 43961)
+++ branches/barrier_breaker/package/network/ipv6/map/files/map.sh      
2015-01-13 19:02:32 UTC (rev 43962)
@@ -52,6 +52,7 @@
                fi
        fi
 
+       echo "rule=$rule" > /tmp/map-$cfg.rules
        RULE_DATA=$(mapcalc ${tunlink:-\*} $rule)
        if [ "$?" != 0 ]; then
                proto_notify_error "$cfg" "INVALID_MAP_RULE"
@@ -59,6 +60,7 @@
                return
        fi
 
+       echo "$RULE_DATA" >> /tmp/map-$cfg.rules
        eval $RULE_DATA
        
        if [ -z "$RULE_BMR" ]; then
@@ -188,6 +190,7 @@
 proto_map_teardown() {
        local cfg="$1"
        ifdown "${cfg}_local"
+       rm -f /tmp/map-$cfg.rules
 }
 
 proto_map_init_config() {

Modified: branches/barrier_breaker/package/network/ipv6/map/src/mapcalc.c
===================================================================
--- branches/barrier_breaker/package/network/ipv6/map/src/mapcalc.c     
2015-01-13 19:00:39 UTC (rev 43961)
+++ branches/barrier_breaker/package/network/ipv6/map/src/mapcalc.c     
2015-01-13 19:02:32 UTC (rev 43962)
@@ -2,7 +2,7 @@
  * mapcalc - MAP parameter calculation
  *
  * Author: Steven Barth <[email protected]>
- * Copyright (c) 2014 cisco Systems, Inc.
+ * Copyright (c) 2014-2015 cisco Systems, Inc.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2
@@ -271,8 +271,10 @@
                if (ealen < 0 && pdlen >= 0)
                        ealen = pdlen - prefix6len;
 
-               if (psidlen < 0)
+               if (psidlen <= 0) {
                        psidlen = ealen - (32 - prefix4len);
+                       psid = -1;
+               }
 
                if (psid < 0 && psidlen <= 16 && psidlen >= 0 && pdlen >= 0 && 
ealen >= psidlen) {
                        bmemcpys64(&psid16, &pd, prefix6len + ealen - psidlen, 
psidlen);
_______________________________________________
openwrt-commits mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-commits

Reply via email to