strongswan: add support for hw_offload
authorPhilip Prindeville <redacted>
Sat, 26 Jun 2021 19:01:20 +0000 (13:01 -0600)
committerPhilip Prindeville <redacted>
Sun, 27 Jun 2021 22:31:31 +0000 (16:31 -0600)
Also from Vincent Wiemann <redacted>.

Signed-off-by: Philip Prindeville <redacted>
net/strongswan/files/swanctl.init

index f498036d050d3a0f95ccb2d8f2c4ee4a8543a65c..2144c5c20c703baaaa979353c98dbd85cc7f032e 100644 (file)
@@ -218,6 +218,7 @@ config_child() {
        local config_name="$1"
        local mode="$2"
 
+       local hw_offload
        local local_subnet
        local local_nat
        local updown
@@ -239,6 +240,7 @@ config_child() {
        config_get closeaction "$1" closeaction "none"
        config_get if_id "$1" if_id ""
        config_get rekeytime "$1" rekeytime ""
+       config_get hw_offload "$1" hw_offload ""
 
        config_list_foreach "$1" local_subnet append_var local_subnet ","
        config_list_foreach "$1" remote_subnet append_var remote_subnet ","
@@ -299,12 +301,23 @@ config_child() {
                ;;
        esac
 
+       case "$hw_offload" in
+       yes|no|auto|"")
+               ;;
+       *)
+               fatal "hw_offload value $hw_offload invalid"
+               hw_offload=""
+               ;;
+       esac
+
        [ -n "$local_nat" ] && local_subnet="$local_nat"
 
        swanctl_xappend3 "$config_name {"
 
        [ -n "$local_subnet" ] && swanctl_xappend4 "local_ts = $local_subnet"
        [ -n "$remote_subnet" ] && swanctl_xappend4 "remote_ts = $remote_subnet"
+
+       [ -n "$hw_offload" ] && swanctl_append4 "hw_offload = $hw_offload"
        [ -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"
git clone https://git.99rst.org/PROJECT