map: delete map-t device when tearing down map interface
authorHans Dedecker <dedeckeh@gmail.com>
Thu, 12 Jan 2017 08:53:32 +0000 (09:53 +0100)
committerHans Dedecker <dedeckeh@gmail.com>
Thu, 12 Jan 2017 10:41:11 +0000 (11:41 +0100)
Delete the map-t device when tearing down the map-t interface; as such
there's no conflict when the map-t interface comes up again when trying
to add the map-t device as the map-t device was still present
(Can not add: device 'map-wan6_4' already exists!).

Only call ifdown in teardown for map-e and lw6o4 map interfaces types
in order to suppress the trace "wan6_4 (6652): Interface wan6_4_ not found"

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
package/network/ipv6/map/Makefile
package/network/ipv6/map/files/map.sh

index 8cc1afeda1536a2edfb258a847ee60442d51dd57..9e51c40531ee2c96c0eaf4b6de4ab4dcc26b1c5b 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=map
 PKG_VERSION:=4
-PKG_RELEASE:=5
+PKG_RELEASE:=6
 PKG_LICENSE:=GPL-2.0
 
 include $(INCLUDE_DIR)/package.mk
index 98a493dd5714f3f3d8ce0c9e5d291afac588ba9d..fe872828c3b95344689663c339effe4b07ad0564 100755 (executable)
@@ -192,7 +192,17 @@ proto_map_setup() {
 
 proto_map_teardown() {
        local cfg="$1"
-       ifdown "${cfg}_"
+       local link="map-$cfg"
+
+       json_get_var type type
+
+       [ -z "$type" ] && type="map-e"
+
+       case "$type" in
+               "map-e"|"lw4o6") ifdown "${cfg}_" ;;
+               "map-t") [ -f "/proc/net/nat46/control" ] && echo del $link > /proc/net/nat46/control ;;
+       esac
+
        rm -f /tmp/map-$cfg.rules
 }