From 143b6560dae255fa68d35e2cd08b88ff69070e4e Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Thu, 24 Apr 2014 05:36:18 +0200 Subject: [PATCH 1/2] net/ip: apply workaround to fix IP forwarding When sending a packet a workaround is applied when ndp_get_ll_address() returns NULL as is's not implemented properly yet. The same should happen when a packet is forwarded as it's dropped otherwise. --- sys/net/network_layer/sixlowpan/ip.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/net/network_layer/sixlowpan/ip.c b/sys/net/network_layer/sixlowpan/ip.c index db76a4fb05..0daf4fed8e 100644 --- a/sys/net/network_layer/sixlowpan/ip.c +++ b/sys/net/network_layer/sixlowpan/ip.c @@ -438,6 +438,11 @@ void ipv6_process(void) nce->lladdr_len, (uint8_t *)ipv6_get_buf_send(), packet_length); + } else { + /* XXX: this is wrong, but until ND does not work correctly, + * this is the only way (aka the old way)*/ + uint16_t raddr = dest->uint16[7]; + sixlowpan_lowpan_sendto(0, &raddr, 2, (uint8_t *)ipv6_get_buf_send(), packet_length); } } From 8ec8b3f10052f4fe37dd21da9da4eb8b81d86c83 Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Mon, 12 May 2014 17:28:05 +0200 Subject: [PATCH 2/2] net/ip: fix wrong double negative in the comments --- 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 0daf4fed8e..5ef2b6761c 100644 --- a/sys/net/network_layer/sixlowpan/ip.c +++ b/sys/net/network_layer/sixlowpan/ip.c @@ -84,7 +84,7 @@ int ipv6_send_packet(ipv6_hdr_t *packet) nce->lladdr_len, (uint8_t *)packet, length) < 0) { - /* XXX: this is wrong, but until ND does not work correctly, + /* XXX: this is wrong, but until ND does work correctly, * this is the only way (aka the old way)*/ uint16_t raddr = NTOHS(packet->destaddr.uint16[7]); sixlowpan_lowpan_sendto(0, &raddr, 2, (uint8_t *)packet, length); @@ -117,7 +117,7 @@ int ipv6_send_packet(ipv6_hdr_t *packet) 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, + /* XXX: this is wrong, but until ND does work correctly, * this is the only way (aka the old way)*/ uint16_t raddr = dest->uint16[7]; sixlowpan_lowpan_sendto(0, &raddr, 2, (uint8_t *)packet, length); @@ -439,7 +439,7 @@ void ipv6_process(void) (uint8_t *)ipv6_get_buf_send(), packet_length); } else { - /* XXX: this is wrong, but until ND does not work correctly, + /* XXX: this is wrong, but until ND does work correctly, * this is the only way (aka the old way)*/ uint16_t raddr = dest->uint16[7]; sixlowpan_lowpan_sendto(0, &raddr, 2, (uint8_t *)ipv6_get_buf_send(), packet_length);