mirror of https://github.com/hak5/openwrt.git
map: ignore psid and psidlen if psidlen is 0
Signed-off-by: Steven Barth <steven@midlink.org> SVN-Revision: 43946lede-17.01
parent
b0a2d7ad0d
commit
d73c382a73
|
@ -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.
|
# This is free software, licensed under the GNU General Public License v2.
|
||||||
# See /LICENSE for more information.
|
# See /LICENSE for more information.
|
||||||
|
@ -8,7 +8,7 @@
|
||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=map
|
PKG_NAME:=map
|
||||||
PKG_VERSION:=2
|
PKG_VERSION:=3
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=1
|
||||||
PKG_LICENSE:=GPL-2.0
|
PKG_LICENSE:=GPL-2.0
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* mapcalc - MAP parameter calculation
|
* mapcalc - MAP parameter calculation
|
||||||
*
|
*
|
||||||
* Author: Steven Barth <cyrus@openwrt.org>
|
* 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
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License version 2
|
* 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)
|
if (ealen < 0 && pdlen >= 0)
|
||||||
ealen = pdlen - prefix6len;
|
ealen = pdlen - prefix6len;
|
||||||
|
|
||||||
if (psidlen < 0)
|
if (psidlen <= 0) {
|
||||||
psidlen = ealen - (32 - prefix4len);
|
psidlen = ealen - (32 - prefix4len);
|
||||||
|
psid = -1;
|
||||||
|
}
|
||||||
|
|
||||||
if (psid < 0 && psidlen <= 16 && psidlen >= 0 && pdlen >= 0 && ealen >= psidlen) {
|
if (psid < 0 && psidlen <= 16 && psidlen >= 0 && pdlen >= 0 && ealen >= psidlen) {
|
||||||
bmemcpys64(&psid16, &pd, prefix6len + ealen - psidlen, psidlen);
|
bmemcpys64(&psid16, &pd, prefix6len + ealen - psidlen, psidlen);
|
||||||
|
|
Loading…
Reference in New Issue