fix bugs for byte order for port_no