Skip to content

Commit 40a1c72

Browse files
committed
net: latmon: Fix net API use
In d45cd67 the mayority of the Zephyr networking code was changed to use the Zephyr native net_/zsock_ prefixed types, but some symbols were forgotten. Let's change them. Without these fixes/changes the code still builds in most cases as we are by now setting CONFIG_NET_NAMESPACE_COMPAT_MODE. But when this is not set, things will fail to build. Signed-off-by: Alberto Escolar Piedras <[email protected]>
1 parent 923ece1 commit 40a1c72

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

subsys/net/lib/latmon/latmon.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ static int broadcast_ip_address(struct net_in_addr *ip_addr)
342342
return -1;
343343
}
344344

345-
broadcast.sin_addr.s_addr = net_htonl(INADDR_BROADCAST);
345+
broadcast.sin_addr.s_addr = net_htonl(NET_INADDR_BROADCAST);
346346
broadcast.sin_port = net_htons(LATMON_NET_PORT);
347347
broadcast.sin_family = NET_AF_INET;
348348

@@ -381,7 +381,7 @@ int net_latmon_get_socket(struct net_sockaddr *connection_addr)
381381
return -1;
382382
}
383383

384-
zsock_setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
384+
zsock_setsockopt(s, ZSOCK_SOL_SOCKET, ZSOCK_SO_REUSEADDR, &on, sizeof(on));
385385
if (zsock_bind(s, (struct net_sockaddr *)&addr, sizeof(addr)) < 0) {
386386
LOG_ERR("failed to bind latmon socket : %d", errno);
387387
zsock_close(s);

0 commit comments

Comments
 (0)