Skip to content
Permalink
Browse files

net: context: Use const for the IP address

We are not modifying the IP address and this is needed in next
commit.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
  • Loading branch information...
jukkar committed Jul 23, 2019
1 parent c1d03b2 commit a0865adf25cd68b66e894c6a2f75a2c0e2cb99ab
Showing with 4 additions and 2 deletions.
  1. +4 −2 subsys/net/ip/net_context.c
@@ -1268,7 +1268,8 @@ static int context_sendto(struct net_context *context,

if (IS_ENABLED(CONFIG_NET_IPV6) &&
net_context_get_family(context) == AF_INET6) {
struct sockaddr_in6 *addr6 = (struct sockaddr_in6 *)dst_addr;
const struct sockaddr_in6 *addr6 =
(const struct sockaddr_in6 *)dst_addr;

if (addrlen < sizeof(struct sockaddr_in6)) {
return -EINVAL;
@@ -1279,7 +1280,8 @@ static int context_sendto(struct net_context *context,
}
} else if (IS_ENABLED(CONFIG_NET_IPV4) &&
net_context_get_family(context) == AF_INET) {
struct sockaddr_in *addr4 = (struct sockaddr_in *)dst_addr;
const struct sockaddr_in *addr4 =
(const struct sockaddr_in *)dst_addr;

if (addrlen < sizeof(struct sockaddr_in)) {
return -EINVAL;

0 comments on commit a0865ad

Please sign in to comment.
You can’t perform that action at this time.