Signed-off-by: Steven Barth <steven@midlink.org>
git-svn-id: svn://svn.openwrt.org/openwrt/branches/barrier_breaker@43962
3c298f89-4303-0410-b956-
a3cf2f4a3e73
-# 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.
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
include $(TOPDIR)/rules.mk
PKG_NAME:=map
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
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
+ echo "rule=$rule" > /tmp/map-$cfg.rules
RULE_DATA=$(mapcalc ${tunlink:-\*} $rule)
if [ "$?" != 0 ]; then
proto_notify_error "$cfg" "INVALID_MAP_RULE"
RULE_DATA=$(mapcalc ${tunlink:-\*} $rule)
if [ "$?" != 0 ]; then
proto_notify_error "$cfg" "INVALID_MAP_RULE"
+ echo "$RULE_DATA" >> /tmp/map-$cfg.rules
eval $RULE_DATA
if [ -z "$RULE_BMR" ]; then
eval $RULE_DATA
if [ -z "$RULE_BMR" ]; then
proto_map_teardown() {
local cfg="$1"
ifdown "${cfg}_local"
proto_map_teardown() {
local cfg="$1"
ifdown "${cfg}_local"
+ rm -f /tmp/map-$cfg.rules
}
proto_map_init_config() {
}
proto_map_init_config() {
* mapcalc - MAP parameter calculation
*
* Author: Steven Barth <cyrus@openwrt.org>
* mapcalc - MAP parameter calculation
*
* Author: Steven Barth <cyrus@openwrt.org>
- * 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
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2
if (ealen < 0 && pdlen >= 0)
ealen = pdlen - prefix6len;
if (ealen < 0 && pdlen >= 0)
ealen = pdlen - prefix6len;
psidlen = ealen - (32 - prefix4len);
psidlen = ealen - (32 - prefix4len);
if (psid < 0 && psidlen <= 16 && psidlen >= 0 && pdlen >= 0 && ealen >= psidlen) {
bmemcpys64(&psid16, &pd, prefix6len + ealen - psidlen, psidlen);
if (psid < 0 && psidlen <= 16 && psidlen >= 0 && pdlen >= 0 && ealen >= psidlen) {
bmemcpys64(&psid16, &pd, prefix6len + ealen - psidlen, psidlen);