[PATCH v2 23/41] net: Refactor part of netboot_common() into a function