~mdw
/
firewall
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
functions.m4: Make clearchain tolerant of existing chains.
[firewall]
/
functions.m4
diff --git
a/functions.m4
b/functions.m4
index
c0cd0b3
..
fd24364
100644
(file)
--- a/
functions.m4
+++ b/
functions.m4
@@
-50,6
+50,14
@@
defport () {
eval port_$name=$number
}
eval port_$name=$number
}
+## defproto NAME NUMBER
+##
+## Define $proto_NAME to be NUMBER.
+defproto () {
+ name=$1 number=$2
+ eval proto_$name=$number
+}
+
m4_divert(38)m4_dnl
###--------------------------------------------------------------------------
### Utility chains (used by function definitions).
m4_divert(38)m4_dnl
###--------------------------------------------------------------------------
### Utility chains (used by function definitions).
@@
-77,7
+85,7
@@
clearchain () {
*:*) table=${chain%:*} chain=${chain#*:} ;;
*) table=filter ;;
esac
*:*) table=${chain%:*} chain=${chain#*:} ;;
*) table=filter ;;
esac
- run ip46tables -t $table -N $chain
+ run ip46tables -t $table -N $chain
2>/dev/null || :
done
}
done
}
@@
-96,7
+104,9
@@
errorchain () {
run ip46tables -t $table -A $chain -j LOG \
-m limit --limit 3/minute --limit-burst 10 \
--log-prefix "fw: $chain " --log-level notice
run ip46tables -t $table -A $chain -j LOG \
-m limit --limit 3/minute --limit-burst 10 \
--log-prefix "fw: $chain " --log-level notice
- run ip46tables -t $table -A $chain -j "$@"
+ run ip46tables -t $table -A $chain -j "$@" \
+ -m limit --limit 20/second --limit-burst 100
+ run ip46tables -t $table -A $chain -j DROP
}
m4_divert(24)m4_dnl
}
m4_divert(24)m4_dnl