strongswan: add interface option for children
authorPhilip Prindeville <philipp@redfish-solutions.com>
Sat, 26 Jun 2021 19:18:12 +0000 (13:18 -0600)
committerPhilip Prindeville <philipp@redfish-solutions.com>
Sun, 27 Jun 2021 22:31:31 +0000 (16:31 -0600)
This option sets the interface of the policy.

Also from Vincent Wiemann <vincent.wiemann@ironai.com>.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
net/strongswan/files/swanctl.init

index 2144c5c20c703baaaa979353c98dbd85cc7f032e..cebd3ea84d4f3062175b045d429f87b291919c61 100644 (file)
@@ -219,6 +219,7 @@ config_child() {
        local mode="$2"
 
        local hw_offload
+       local interface
        local local_subnet
        local local_nat
        local updown
@@ -240,6 +241,7 @@ config_child() {
        config_get closeaction "$1" closeaction "none"
        config_get if_id "$1" if_id ""
        config_get rekeytime "$1" rekeytime ""
+       config_get interface "$1" interface ""
        config_get hw_offload "$1" hw_offload ""
 
        config_list_foreach "$1" local_subnet append_var local_subnet ","
@@ -318,6 +320,7 @@ config_child() {
        [ -n "$remote_subnet" ] && swanctl_xappend4 "remote_ts = $remote_subnet"
 
        [ -n "$hw_offload" ] && swanctl_append4 "hw_offload = $hw_offload"
+       [ -n "$interface" ] && swanctl_append4 "interface = $interface"
        [ -n "$if_id" ] && { swanctl_xappend4 "if_id_in = $if_id" ; swanctl_xappend4 "if_id_out = $if_id" ; }
        [ -n "$startaction" -a "$startaction" != "none" ] && swanctl_xappend4 "start_action = $startaction"
        [ -n "$closeaction" -a "$closeaction" != "none" ] && swanctl_xappend4 "close_action = $closeaction"