]> git.ipfire.org Git - people/ms/network.git/commitdiff
Merge branch 'master' of ssh://git.ipfire.org/pub/git/network
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 20 Oct 2015 15:39:26 +0000 (17:39 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 20 Oct 2015 15:39:26 +0000 (17:39 +0200)
src/functions/functions.device
src/functions/functions.radvd
src/network-radvd-config

index a851b669d50e864f358549e3620ce8bd108ce59c..a79b81d58e6216e0121d3b9aebbcde546facf44f 100644 (file)
@@ -313,6 +313,13 @@ device_is_serial() {
        serial_exists $@
 }
 
+# Returns true if a device is a tun device
+device_is_tun() {
+       local device="${1}"
+
+       [ -e "${SYS_CLASS_NET}/${device}/tun_flags" ]
+}
+
 # Check if the device is a physical network interface
 device_is_ethernet() {
        local device=${1}
@@ -338,6 +345,9 @@ device_is_ethernet() {
        device_is_dummy ${device} && \
                return ${EXIT_ERROR}
 
+       device_is_tun ${device} && \
+               return ${EXIT_ERROR}
+
        return ${EXIT_OK}
 }
 
@@ -377,6 +387,9 @@ device_get_type() {
        elif device_is_dummy ${device}; then
                echo "dummy"
 
+       elif device_is_tun ${device}; then
+               echo "tun"
+
        elif device_is_ethernet ${device}; then
                echo "ethernet"
 
index a2daec35737ccb60c0c756a6f016043a5ec86b71..4e41160e0343413e6cdd791578a4c54463275ac3 100644 (file)
@@ -35,9 +35,17 @@ radvd_update() {
        service_start radvd
 }
 
-radvd_write_config() {
+radvd_clear_config() {
+       log DEBUG "Clearing radv daemon configuration file"
+
        config_header "radv daemon configuration file" > ${RADVD_CONFIGFILE}
 
+       return ${EXIT_OK}
+}
+
+radvd_write_config() {
+       radvd_clear_config
+
        # Write the configuration for all zones.
        local zone
        for zone in $(zones_get_local); do
index fbf7e7908e55173c42ec3a71e09c4c4c8bdf42f4..e9809e164135bcb801703888d65721546f548937 100644 (file)
@@ -28,7 +28,7 @@ case "${1}" in
                ;;
        stop)
                # Clear all contents in the configuration file.
-               radvd_clear
+               radvd_clear_config
                ;;
 esac