aboutsummaryrefslogtreecommitdiffstats
path: root/package
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2015-01-12 10:56:54 +0000
committerSteven Barth <steven@midlink.org>2015-01-12 10:56:54 +0000
commit9f1844bffb8b14de38d615d8b713d433a8824d60 (patch)
treef8f5b4d59fdffc1f8a4375b0228ff6cf9752ae58 /package
parent308eeb28e69b57e9a9e5845077834a44d582637b (diff)
downloadupstream-9f1844bffb8b14de38d615d8b713d433a8824d60.tar.gz
upstream-9f1844bffb8b14de38d615d8b713d433a8824d60.tar.bz2
upstream-9f1844bffb8b14de38d615d8b713d433a8824d60.zip
map: ignore psid and psidlen if psidlen is 0
Signed-off-by: Steven Barth <steven@midlink.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@43946 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package')
-rw-r--r--package/network/ipv6/map/Makefile4
-rw-r--r--package/network/ipv6/map/src/mapcalc.c6
2 files changed, 6 insertions, 4 deletions
diff --git a/package/network/ipv6/map/Makefile b/package/network/ipv6/map/Makefile
index 382fe0a8ba..2848fe9ea2 100644
--- a/package/network/ipv6/map/Makefile
+++ b/package/network/ipv6/map/Makefile
@@ -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,7 +8,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=map
-PKG_VERSION:=2
+PKG_VERSION:=3
PKG_RELEASE:=1
PKG_LICENSE:=GPL-2.0
diff --git a/package/network/ipv6/map/src/mapcalc.c b/package/network/ipv6/map/src/mapcalc.c
index afce6d24d7..b4b3d736f0 100644
--- a/package/network/ipv6/map/src/mapcalc.c
+++ b/package/network/ipv6/map/src/mapcalc.c
@@ -2,7 +2,7 @@
* 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
@@ -271,8 +271,10 @@ int main(int argc, char *argv[])
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);