Skip to content

Commit

Permalink
[Fix] ipt/xt_recent detection for RAB w/ compressed kernel modules
Browse files Browse the repository at this point in the history
[Fix] el7.4 for some reason does not set CONFIG_MODULE_COMPRESSED_XZ=y in config-$(uname -r); addressed with more trivial check
  • Loading branch information
rfxn committed Sep 18, 2017
1 parent 67f6eb9 commit 3b962df
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions files/internals/functions.apf
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ ml() {
MEXT="ko"
fi

if [ "$FATAL" == "1" ] && [ ! -f "/lib/modules/$(uname -r)/kernel/net/ipv4/netfilter/$1.$MEXT" ]; then
if [ "$FATAL" == "1" ] && [ ! -f "/lib/modules/$(uname -r)/kernel/net/ipv4/netfilter/$1.$MEXT" ] && [ ! -f "/lib/modules/$(uname -r)/kernel/net/ipv4/netfilter/$1.${MEXT}.xz" ]; then
if [ ! "$SET_VERBOSE" == "1" ]; then
echo "Unable to load iptables module ($1), aborting."
fi
Expand Down Expand Up @@ -74,7 +74,7 @@ modinit() {
check_rab() {
ml xt_recent
ml ipt_recent
if [ ! -f "/lib/modules/$(uname -r)/kernel/net/ipv4/netfilter/ipt_recent.$MEXT" ] && [ ! -f "/lib/modules/$(uname -r)/kernel/net/ipv4/netfilter/xt_recent.$MEXT" ] && [ ! -f "/lib/modules/$(uname -r)/kernel/net/netfilter/xt_recent.$MEXT" ] && [ "$RAB" == "1" ]; then
if [ ! -f "/lib/modules/$(uname -r)/kernel/net/ipv4/netfilter/ipt_recent.$MEXT" ] && [ ! -f "/lib/modules/$(uname -r)/kernel/net/ipv4/netfilter/ipt_recent.${MEXT}.xz" ] && [ ! -f "/lib/modules/$(uname -r)/kernel/net/ipv4/netfilter/xt_recent.$MEXT" ] && [ ! -f "/lib/modules/$(uname -r)/kernel/net/netfilter/xt_recent.$MEXT" ] && [ ! -f "/lib/modules/$(uname -r)/kernel/net/netfilter/xt_recent.${MEXT}.xz" ] && [ "$RAB" == "1" ]; then
RAB="0"
eout "{rab} force set RAB disabled, kernel module xt/ipt_recent not found."
fi
Expand Down

0 comments on commit 3b962df

Please sign in to comment.