Skip to content

Commit

Permalink
Fixed bug: regexes stoped to work
Browse files Browse the repository at this point in the history
after reloading the config.
  • Loading branch information
biathlon3 committed Jul 18, 2024
1 parent 28f9eee commit ab68ff0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions fw/vhost.c
Original file line number Diff line number Diff line change
Expand Up @@ -2392,6 +2392,9 @@ tfw_vhost_cfgstart(void)
{
TfwVhost *vh_dflt;

number_of_regex = 0;
number_of_db_regex = 0;

BUG_ON(tfw_vhosts_reconfig);
tfw_vhosts_reconfig = kmalloc(sizeof(TfwVhostList), GFP_KERNEL);
if (!tfw_vhosts_reconfig) {
Expand Down
4 changes: 1 addition & 3 deletions scripts/regex_start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@ tmp_path="/tmp/tempesta"
for filename in ${tmp_path}/*.txt; do
name=$(basename "$filename" .txt)
db_path="/sys/kernel/config/rex/${name}"
echo $dbpath

rm -rf ${tmp_path}/out/ && mkdir ${tmp_path}/out
echo "${script_path}/hscollider -e ${filename} -V2 -ao ${tmp_path}/out/ -n1"
#${script_path}/hscollider -e ${filename} -ao ${tmp_path}/out/ -n1
#${script_path}/hscollider -e ${filename} -ao ${tmp_path}/out/ -n1 #this version for single block strings
${script_path}/hscollider -e ${filename} -V5 -ao ${tmp_path}/out/ -n1

mkdir $db_path
Expand Down
2 changes: 2 additions & 0 deletions scripts/tempesta.sh
Original file line number Diff line number Diff line change
Expand Up @@ -317,10 +317,12 @@ reload()
{
update_js_challenge_templates
echo "Running live reconfiguration of Tempesta..."
$script_path/regex_stop.sh
err=$(start_tempesta_and_check)
if [[ $err != "0" ]]; then
error "cannot reconfigure Tempesta FW (sysctl message: ${err##*: }), please check dmesg"
else
$script_path/regex_start.sh
echo "done"
remove_tmp_conf
fi
Expand Down

0 comments on commit ab68ff0

Please sign in to comment.