Move key regeneration handling to net_setup.c.