Based on what the initscripts do with ipcalc, which was tripping a few people up when they forgot to do PREFIX/NETMASK.