A division by zero error occurs when the data path sees a resilient nexthop group with zero buckets. The resilient nexthop group torture tests in fib nexthop.sh exposed this issue. The tests replace a resilient nexthop group in a loop while traffic is forwarded through it, resulting in the kernel allocating a stub resilient table with zero buckets. This table should never be visible to the data path, but the old nexthop group might still be used by the data path when the stub table is assigned to it. The fix involves only assigning the stub table to the old nexthop group after making sure the group is no longer used by the data path.