Skip to content

Commit

Permalink
use forwarding table entry when routing
Browse files Browse the repository at this point in the history
So far the entry was looked up, but ignored in the case where the packet
has to be forwarded.
  • Loading branch information
OlegHahm committed Mar 9, 2014
1 parent 0c9fd83 commit 05ebad4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sys/net/network_layer/sixlowpan/ip.c
Expand Up @@ -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,
Expand Down Expand Up @@ -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; */
}
Expand Down

0 comments on commit 05ebad4

Please sign in to comment.