Merge pull request #875 from OlegHahm/ip_forwarding

net: IPv6: use forwarding table entry when routing
This commit is contained in:
Martine Lenders 2014-03-24 15:39:24 +01:00
commit 03b49e849b

View File

@ -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; */
}