summaryrefslogtreecommitdiff
path: root/usr
diff options
context:
space:
mode:
authorRobert Mustacchi <rm@joyent.com>2012-01-10 20:33:03 -0500
committerRobert Mustacchi <rm@joyent.com>2012-01-10 20:33:03 -0500
commit82dec0a6f9e2e62fb6a4e2fc08d397b21b6a21dc (patch)
tree20c0eda8e65600cc1e8c7cb0ae31ddcd4ad85b11 /usr
parent84058112076dd7aa47feea28f15e375fee68125a (diff)
downloadillumos-joyent-82dec0a6f9e2e62fb6a4e2fc08d397b21b6a21dc.tar.gz
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>
Diffstat (limited to 'usr')
-rw-r--r--usr/src/uts/common/inet/ip/ip_ftable.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/usr/src/uts/common/inet/ip/ip_ftable.c b/usr/src/uts/common/inet/ip/ip_ftable.c
index 7cb83a2a76..980436b578 100644
--- a/usr/src/uts/common/inet/ip/ip_ftable.c
+++ b/usr/src/uts/common/inet/ip/ip_ftable.c
@@ -815,6 +815,11 @@ ire_round_robin(irb_t *irb_ptr, ire_ftable_args_t *margs, uint_t hash,
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);