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
}