]> TLD Linux GIT Repositories - rc-scripts.git/blobdiff - lib/functions.network
- fix regex for newer iproute2, fixes no connectivity bug
[rc-scripts.git] / lib / functions.network
index a68ed7621fa11b0f9cedd0e13c21d3666c4b4061..862d42b14d6f93f7843695d86dac5b67d99eb4b2 100644 (file)
@@ -232,11 +232,11 @@ setup_ip_param ()
        esac
 
        # Multicast ready devices
-       if is_yes "$MULTICAST"; then
-               MULTICAST="on"
+       if [ -n "$MULTICAST" ]; then
+               MULTICAST="$MULTICAST"
        else
                case "$DEVICETYPE" in
-                 eth|br)
+                 eth|br|vlan)
                        MULTICAST="on"
                        ;;
                  *)
@@ -299,6 +299,7 @@ setup_ip_gw_ro ()
                if [ -z "${IPV6_GLOBALROUTEDEV}" -o "${IPV6_GLOBALROUTEDEV}" = "${DEVICE}" ]; then
                        # set up default route
                        if [ "${IPV6_GLOBALROUTEGW}" ]; then
+                               ip -6 route add ${IPV6_GLOBALROUTEGW} dev ${DEVICE} ${IP6SRCADDR} onlink
                                ip -6 route add 2000::/3 via ${IPV6_GLOBALROUTEGW} dev ${DEVICE} ${IP6SRCADDR} onlink
                        elif [ "${IPV6_GLOBALROUTEDEV}" = "${DEVICE}" ]; then
                                ip -6 route add 2000::/3 dev ${DEVICE} ${IP6SRCADDR}
@@ -483,7 +484,7 @@ setup_ip_rules ()
                                /sbin/ip rule add $args $prio
                        done
                elif is_no "$1"; then
-                       LC_ALL=C /sbin/ip rule show | grep -vE -e "from all lookup (main|default|local|253|254|255) \$" -e " map-to " | while read prio from src args; do
+                       LC_ALL=C /sbin/ip rule show | grep -vE -e "from all lookup (main|default|local|253|254|255)[[:space:]]*\$" -e " map-to " | while read prio from src args; do
                                [ "$src" = "all" ] && /sbin/ip rule delete $args || /sbin/ip rule delete $from $src $args
                        done
                fi
@@ -502,7 +503,7 @@ setup_ip_rules ()
                                /sbin/ip -6 rule add $args $prio
                        done
                elif is_no "$1"; then
-                       LC_ALL=C /sbin/ip -6 rule show | grep -vE -e "from all lookup (main|default|local|253|254|255) \$" -e " map-to " | while read prio from src args; do
+                       LC_ALL=C /sbin/ip -6 rule show | grep -vE -e "from all lookup (main|default|local|253|254|255)[[:space:]]*\$" -e " map-to " | while read prio from src args; do
                                [ "$src" = "all" ] && /sbin/ip -6 rule delete $args || /sbin/ip -6 rule delete $from $src $args
                        done
                fi