From 05ebad438069e213b320cb5ae4923b497cb8e12d Mon Sep 17 00:00:00 2001 From: Oleg Hahm Date: Fri, 7 Mar 2014 05:21:51 +0000 Subject: [PATCH] use forwarding table entry when routing So far the entry was looked up, but ignored in the case where the packet has to be forwarded. --- sys/net/network_layer/sixlowpan/ip.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/net/network_layer/sixlowpan/ip.c b/sys/net/network_layer/sixlowpan/ip.c index bf7f31ddbce9..a4350cc7bac9 100644 --- a/sys/net/network_layer/sixlowpan/ip.c +++ b/sys/net/network_layer/sixlowpan/ip.c @@ -77,9 +77,9 @@ int ipv6_send_packet(ipv6_hdr_t *packet) if (!ipv6_addr_is_multicast(&packet->destaddr) && ndp_addr_is_on_link(&packet->destaddr)) { + /* not multicast, on-link */ nce = ndp_get_ll_address(&packet->destaddr); - if (nce == NULL || sixlowpan_lowpan_sendto(nce->if_id, &nce->lladdr, nce->lladdr_len, (uint8_t *)packet, @@ -112,14 +112,14 @@ int ipv6_send_packet(ipv6_hdr_t *packet) return -1; } - nce = ndp_get_ll_address(&packet->destaddr); + nce = ndp_get_ll_address(dest); if (nce == NULL || sixlowpan_lowpan_sendto(nce->if_id, &nce->lladdr, nce->lladdr_len, (uint8_t *)packet, length) < 0) { /* XXX: this is wrong, but until ND does not work correctly, * this is the only way (aka the old way)*/ - uint16_t raddr = NTOHS(packet->destaddr.uint16[7]); + uint16_t raddr = dest->uint16[7]; sixlowpan_lowpan_sendto(0, &raddr, 2, (uint8_t *)packet, length); /* return -1; */ }