map: ignore insignificant PSID bits
authorSteven Barth <cyrus@openwrt.org>
Mon, 7 Sep 2015 16:21:15 +0000 (16:21 +0000)
committerSteven Barth <cyrus@openwrt.org>
Mon, 7 Sep 2015 16:21:15 +0000 (16:21 +0000)
Signed-off-by: Steven Barth <steven@midlink.org>
SVN-Revision: 46804

package/network/ipv6/map/Makefile
package/network/ipv6/map/src/mapcalc.c

index a45e9bc1fd910f7491bb0e011dcfdd015d057a33..1d423150b99fa6be4c9d6aef8704a34a0400230c 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=map
 PKG_VERSION:=4
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 PKG_LICENSE:=GPL-2.0
 
 include $(INCLUDE_DIR)/package.mk
index b9fab4d9238684845bd6ed373af0923afff60168..7aa28e57d52eff59bb8c6d9a4ae77286a6be72d7 100644 (file)
@@ -314,7 +314,9 @@ int main(int argc, char *argv[])
                        psid = be16_to_cpu(psid16);
                }
 
-               psid16 = cpu_to_be16(psid >> (16 - psidlen));
+               psid = psid >> (16 - psidlen);
+               psid16 = cpu_to_be16(psid);
+               psid = psid << (16 - psidlen);
 
                if (prefix4len < 0 || prefix6len < 0 || ealen < 0 || ealen < psidlen) {
                        fprintf(stderr, "Skipping invalid or incomplete rule: %s\n", argv[i]);