freebsd-dev/sys/netinet/libalias
Stefan Eßer 58080fbca0 libalias: fix divide by zero causing panic
The packet_limit can fall to 0, leading to a divide by zero abort in
the "packets % packet_limit".

An possible solution would be to apply a lower limit of 1 after the
calculation of packet_limit, but since any number modulo 1 gives 0,
the more efficient solution is to skip the modulo operation for
packet_limit <= 1.

Since this is a fix for a panic observed in stable/12, merging this
fix to stable/12 and stable/13 before expiry of the 3 day waiting
period might be justified, if it works for the reporter of the issue.

Reported by:	Karl Denninger <karl@denninger.net>
MFC after:	3 days
2021-07-10 13:08:18 +02:00
..
alias_db.c libalias: fix divide by zero causing panic 2021-07-10 13:08:18 +02:00
alias_db.h libalias: Fix splay comparsion bug 2021-07-03 00:31:53 +02:00
alias_dummy.c libalias: Style cleanup 2021-05-15 08:57:55 +02:00
alias_ftp.c libalias: Style cleanup 2021-05-15 08:57:55 +02:00
alias_irc.c libalias: Style cleanup 2021-05-15 08:57:55 +02:00
alias_local.h libalias: Switch to efficient data structure for incoming traffic 2021-06-19 22:12:28 +02:00
alias_mod.c libalias: Style cleanup 2021-05-15 08:57:55 +02:00
alias_mod.h malloc: try to use builtins for zeroing at the callsite 2018-06-02 22:20:09 +00:00
alias_nbt.c libalias: Style cleanup 2021-05-15 08:57:55 +02:00
alias_pptp.c libalias: Style cleanup 2021-05-15 08:57:55 +02:00
alias_proxy.c libalias: Style cleanup 2021-05-15 08:57:55 +02:00
alias_sctp.c libalias: Promote per instance global variable timeStamp 2021-06-19 18:25:44 +02:00
alias_sctp.h libalias: Style cleanup 2021-05-15 08:57:55 +02:00
alias_skinny.c libalias: Style cleanup 2021-05-15 08:57:55 +02:00
alias_smedia.c libalias: Style cleanup 2021-05-15 08:57:55 +02:00
alias_util.c libalias: Style cleanup 2021-05-15 08:57:55 +02:00
alias.c libalias: Remove unused function LibAliasCheckNewLink 2021-05-31 12:53:57 +02:00
alias.h libalias: Remove LibAliasCheckNewLink 2021-05-31 13:04:11 +02:00
HISTORY libalias: Rewrite HISTORY 2021-07-04 17:46:47 +02:00
libalias.3 libalias: Remove unused function LibAliasCheckNewLink 2021-05-31 12:53:57 +02:00