[PATCH 03/10] net: netconsole: use unsigned port numbers
James Hilliard <[email protected]>
| Newsgroups | org.u-boot-project.lists.u-boot |
|---|---|
| Message-ID | <20260825-submit-lwip-runtime-netconsole-v1-v1-3-0892966aa758@gmail.com> |
UDP ports use the full unsigned 16-bit range. Storing netconsole ports in signed shorts makes values above 32767 negative and prevents them from matching the unsigned destination port on receive. Store both ports as u16. Signed-off-by: James Hilliard <[email protected]> --- drivers/net/netconsole.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/netconsole.h b/drivers/net/netconsole.h index b2c3ecee6dd..11c2d1e0f48 100644 --- a/drivers/net/netconsole.h +++ b/drivers/net/netconsole.h @@ -8,8 +8,8 @@ struct nc_settings { struct in_addr ip; - short out_port; - short in_port; + u16 out_port; + u16 in_port; }; extern struct nc_settings nc_settings; -- 2.53.0