Properly handle zero length in chunk_alloc[a]/chunk_clone[a]
[strongswan.git] / src / _updown_espmark / _updown_espmark
index b9ae6ed..42cd360 100644 (file)
 #              is  the  UDP/TCP  port  to  which  the IPsec SA  is
 #              restricted on the peer side.
 #
+#       PLUTO_XAUTH_ID
+#              is an optional user ID employed by the XAUTH protocol
+#
+#       PLUTO_MARK_IN
+#              is an optional XFRM mark set on the inbound IPsec SA
+#
+#       PLUTO_MARK_OUT
+#              is an optional XFRM mark set on the outbound IPsec SA
+#
+#       PLUTO_ESP_ENC
+#              contains the remote UDP port in the case of ESP_IN_UDP
+#              encapsulation
+#
 
 # logging of VPN connections
 #
@@ -199,15 +212,12 @@ doroute() {
 
        if [ -z "$PLUTO_MY_SOURCEIP" ]
        then
-           if [ -f /etc/sysconfig/defaultsource ]
-           then
-               . /etc/sysconfig/defaultsource
-           fi
-
-           if [ -f /etc/conf.d/defaultsource ]
-           then
-               . /etc/conf.d/defaultsource
-           fi
+            for dir in /etc/sysconfig /etc/conf.d; do
+                if [ -f "$dir/defaultsource" ]
+                then
+                    . "$dir/defaultsource"
+                fi
+            done
 
            if [ -n "$DEFAULTSOURCE" ]
            then