Skip to content

Commit fc84b73

Browse files
rveerama1nashif
authored andcommitted
net: rpl: Update RPL header
Empty RPL HBH header will be inserted while finalizing IPv6 packet but updated after finding nexthop and sent the packet. In case of Bluetooth or multicast dst address it was missed. Resulted in empty RPL HBH header and packet dropped at peer node. It should be updated in all circumstances. Jira: ZEP-2088 Signed-off-by: Ravi kumar Veeramally <[email protected]>
1 parent 4c206f2 commit fc84b73

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

subsys/net/ip/ipv6.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -855,11 +855,23 @@ struct net_pkt *net_ipv6_prepare_for_send(struct net_pkt *pkt)
855855
* https://jira.zephyrproject.org/browse/ZEP-1656
856856
*/
857857
if (atomic_test_bit(net_pkt_iface(pkt)->flags, NET_IF_POINTOPOINT)) {
858+
/* Update RPL header */
859+
if (net_rpl_update_header(pkt, &NET_IPV6_HDR(pkt)->dst) < 0) {
860+
net_pkt_unref(pkt);
861+
return NULL;
862+
}
863+
858864
return pkt;
859865
}
860866

861867
if (net_pkt_ll_dst(pkt)->addr ||
862868
net_is_ipv6_addr_mcast(&NET_IPV6_HDR(pkt)->dst)) {
869+
/* Update RPL header */
870+
if (net_rpl_update_header(pkt, &NET_IPV6_HDR(pkt)->dst) < 0) {
871+
net_pkt_unref(pkt);
872+
return NULL;
873+
}
874+
863875
return update_ll_reserve(pkt, &NET_IPV6_HDR(pkt)->dst);
864876
}
865877

0 commit comments

Comments
 (0)