Skip to content

Commit 0ac90b0

Browse files
CP-40753 Added change to the firewall-port script to modify the RH-Firewall-1-INPUT chain
Signed-off-by: jameshensmancitrix <james.hensman@citrix.com>
1 parent 5fe7bc4 commit 0ac90b0

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

ocaml/xapi/xapi_host.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2927,7 +2927,7 @@ let apply_updates ~__context ~self ~hash =
29272927
warnings
29282928

29292929
let set_https_only ~__context ~self ~value =
2930-
Db.Host.set_https_only ~__context ~self ~value ;
29312930
let state = match value with true -> "close" | false -> "open" in
29322931
ignore
2933-
@@ Helpers.call_script !Xapi_globs.firewall_port_config_script [state; "80"]
2932+
@@ Helpers.call_script !Xapi_globs.firewall_port_config_script [state; "80"] ;
2933+
Db.Host.set_https_only ~__context ~self ~value

scripts/plugins/firewall-port

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,17 @@ set -e
1616
OP="$1"
1717
PORT="$2"
1818
PROTOCOL="${3:-tcp}"
19-
CHAIN="xapi-INPUT"
2019
RULE="-p $PROTOCOL -m conntrack --ctstate NEW -m $PROTOCOL --dport $PORT -j ACCEPT"
2120

21+
case "$PORT" in
22+
80)
23+
CHAIN="RH-Firewall-1-INPUT"
24+
;;
25+
*)
26+
CHAIN="xapi-INPUT"
27+
;;
28+
esac
29+
2230
case "${OP}" in
2331
open)
2432
if ! iptables -C $CHAIN $RULE 2>/dev/null

0 commit comments

Comments
 (0)