Skip to content

Commit

Permalink
net: context: Use const for the IP address
Browse files Browse the repository at this point in the history
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 24, 2019
1 parent c1d03b2 commit a0865ad
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions subsys/net/ip/net_context.c
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit a0865ad

Please sign in to comment.