From bb8e9c51ab457b0bc010b47ceeab8c0e4f0d6a67 Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Thu, 12 Jan 2017 09:53:32 +0100 Subject: map: delete map-t device when tearing down map interface 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 --- package/network/ipv6/map/files/map.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'package/network/ipv6/map/files/map.sh') diff --git a/package/network/ipv6/map/files/map.sh b/package/network/ipv6/map/files/map.sh index 98a493d..fe87282 100755 --- a/package/network/ipv6/map/files/map.sh +++ b/package/network/ipv6/map/files/map.sh @@ -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 } -- cgit v1.1