summaryrefslogtreecommitdiff
path: root/samples
diff options
context:
space:
mode:
authorJukka Rissanen <jukka.rissanen@linux.intel.com>2016-02-04 13:11:37 +0200
committerAnas Nashif <anas.nashif@intel.com>2016-02-05 20:25:32 -0500
commitbef69b7b967ec27cea5b3b843cbe48c3d357a003 (patch)
tree9e71e13cb4a33e34faa8b8cc986963becc248607 /samples
parent5e16d7a3551f0c804311c519dd988626df3e94ff (diff)
net: apps: Add the non link local IPv6 address in routes
For this demo app, set the 2001:db8::/64 address in routing table. This way we will be able to pass data using these addresses. Something like this should not be done in real networking environment. Change-Id: I1764d5ae09ab95dd580c6b48d6f368bfe283a6a3 Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Diffstat (limited to 'samples')
-rw-r--r--samples/net/echo_client/src/echo-client.c6
-rw-r--r--samples/net/echo_server/src/echo-server.c6
2 files changed, 12 insertions, 0 deletions
diff --git a/samples/net/echo_client/src/echo-client.c b/samples/net/echo_client/src/echo-client.c
index a1b8bd928..d831ccc3f 100644
--- a/samples/net/echo_client/src/echo-client.c
+++ b/samples/net/echo_client/src/echo-client.c
@@ -128,6 +128,12 @@ static inline void init_server()
* but do it here so that test works from first packet.
*/
uip_ds6_nbr_add(addr, lladdr, 0, NBR_REACHABLE);
+#else
+ /* Hard code the route to peer just in case, not to
+ * be done in real life applications.
+ */
+ addr = (uip_ipaddr_t *)&in6addr_peer;
+ uip_ds6_defrt_add(addr, 0);
#endif
addr = (uip_ipaddr_t *)&in6addr_my;
diff --git a/samples/net/echo_server/src/echo-server.c b/samples/net/echo_server/src/echo-server.c
index 64a6717eb..d88771115 100644
--- a/samples/net/echo_server/src/echo-server.c
+++ b/samples/net/echo_server/src/echo-server.c
@@ -99,6 +99,12 @@ static inline void init_server()
* but do it here so that test works from first packet.
*/
uip_ds6_nbr_add(addr, lladdr, 0, NBR_REACHABLE);
+#else
+ /* Hard code the route to peer just in case, not to
+ * be done in real life applications.
+ */
+ addr = (uip_ipaddr_t *)&in6addr_peer;
+ uip_ds6_defrt_add(addr, 0);
#endif
addr = (uip_ipaddr_t *)&in6addr_my;