network: fix endian issue in converting port to network id