Skip to content

Commit fe12a24

Browse files
rdr: Load tables on both stacks by default
1 parent d3c192e commit fe12a24

File tree

1 file changed

+4
-2
lines changed
  • usr/local/share/bastille

1 file changed

+4
-2
lines changed

usr/local/share/bastille/rdr.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ OPTION_IF=0
248248
OPTION_SRC=0
249249
OPTION_DST=0
250250
OPTION_INET_TYPE=0
251+
OPT_SRC_TABLE=0
251252
while [ "$#" -gt 0 ]; do
252253
case "${1}" in
253254
-h|--help|help)
@@ -277,6 +278,7 @@ while [ "$#" -gt 0 ]; do
277278
RDR_SRC="${2}"
278279
else
279280
check_rdr_table_validity "${2}"
281+
OPT_SRC_TABLE=1
280282
RDR_SRC="$(echo "${2}" | sed -e 's/^/</' -e 's/$/>/')"
281283
fi
282284
OPTION_SRC=1
@@ -357,8 +359,8 @@ while [ "$#" -gt 0 ]; do
357359
tcp|udp)
358360
if [ "$#" -lt 3 ]; then
359361
usage
360-
elif [ "${OPTION_SRC}" -eq 1 ] || [ "${OPTION_DST}" -eq 1 ] && [ "${OPTION_INET_TYPE}" -ne 1 ];then
361-
error_exit "[ERROR]: [-t|--type] must be set when using [-s|--source] or [-d|--destination]"
362+
elif [ "${OPTION_SRC}" -eq 1 ] || [ "${OPTION_DST}" -eq 1 ] && [ "${OPTION_INET_TYPE}" -ne 1 ] && [ "${OPT_SRC_TABLE}" -eq 0 ];then
363+
error_exit "[ERROR]: [-t|--type] must be set when NOT using a table as [-s|--source] or [-d|--destination]."
362364
elif [ "$#" -eq 3 ]; then
363365
check_jail_validity
364366
validate_rdr_rule $RDR_IF $RDR_SRC $RDR_DST $1 $2 $3

0 commit comments

Comments
 (0)