Mercurial > illumos > illumos-gate
changeset 13560:61e2c882ccf8
1923 kernel panic in ire_round_robin due to divide by zero
Reviewed by: Gordon Ross <gordon.w.ross@gmail.com>
Reviewed by: Richard Lowe <richlowe@richlowe.net>
Approved by: Richard Lowe <richlowe@richlowe.net>
author | Robert Mustacchi <rm@joyent.com> |
---|---|
date | Tue, 10 Jan 2012 20:33:03 -0500 |
parents | 8413443ef603 |
children | 7ec47d2d30bc |
files | usr/src/uts/common/inet/ip/ip_ftable.c |
diffstat | 1 files changed, 5 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/usr/src/uts/common/inet/ip/ip_ftable.c Tue Jan 10 20:32:59 2012 -0500 +++ b/usr/src/uts/common/inet/ip/ip_ftable.c Tue Jan 10 20:33:03 2012 -0500 @@ -815,6 +815,11 @@ rw_enter(&irb_ptr->irb_lock, RW_WRITER); maxwalk = irb_ptr->irb_ire_cnt; /* Excludes condemned */ + if (maxwalk == 0) { + rw_exit(&irb_ptr->irb_lock); + return (NULL); + } + hash %= maxwalk; irb_refhold_locked(irb_ptr); rw_exit(&irb_ptr->irb_lock);