net: fix divide by zero