From 4085e26cdbf2cbedd6d9253fc7331fc170bad09d Mon Sep 17 00:00:00 2001 From: Vinicius Costa Gomes Date: Wed, 7 Dec 2016 11:25:35 -0800 Subject: [PATCH] samples/zoap-client: Fix using wrong addresses The addresses used by the client were still made reference to the types used by the old network stack. Change-Id: Iaba919cb072e3295c9b371cc8fe493284c5b523b Signed-off-by: Vinicius Costa Gomes --- samples/net/zoap_client/src/zoap-client.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/samples/net/zoap_client/src/zoap-client.c b/samples/net/zoap_client/src/zoap-client.c index bece5021096..4bacb8c8c2c 100644 --- a/samples/net/zoap_client/src/zoap-client.c +++ b/samples/net/zoap_client/src/zoap-client.c @@ -33,9 +33,10 @@ #define ALL_NODES_LOCAL_COAP_MCAST \ { { { 0xff, 0x02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xfd } } } -static const struct net_addr mcast_addr = { - .in6_addr = ALL_NODES_LOCAL_COAP_MCAST, - .family = AF_INET6 }; +static const struct sockaddr_in6 mcast_addr = { + .sin6_addr = ALL_NODES_LOCAL_COAP_MCAST, + .sin6_family = AF_INET6, + .sin6_port = htons(MY_COAP_PORT)}; static struct net_context *context; @@ -140,8 +141,8 @@ static void retransmit_request(struct nano_work *work) void main(void) { - static struct net_addr any_addr = { .in6_addr = IN6ADDR_ANY_INIT, - .family = AF_INET6 }; + static struct sockaddr_in6 any_addr = { .sin6_addr = IN6ADDR_ANY_INIT, + .sin6_family = AF_INET6 }; struct zoap_packet request; struct zoap_pending *pending; struct zoap_reply *reply;