Skip to content

Commit

Permalink
6lowpan: ndisc: set invalid unicast short addr to unspec
Browse files Browse the repository at this point in the history
When receiving neighbour information with short address option field we
should check the complete range of invalid short addresses and set it to
one invalid address setting which is the unspecified address. This
address is also used when by creating at first a new neighbour entry to
indicate no short address is set.

Signed-off-by: Alexander Aring <[email protected]>
Signed-off-by: Marcel Holtmann <[email protected]>
  • Loading branch information
Alexander Aring authored and holtmann committed Jul 8, 2016
1 parent aaa7088 commit 9e262f5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions net/6lowpan/ndisc.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,13 @@ static void lowpan_ndisc_802154_update(struct neighbour *n, u32 flags,
}

write_lock_bh(&n->lock);
if (lladdr_short)
if (lladdr_short) {
ieee802154_be16_to_le16(&neigh->short_addr, lladdr_short);
else
if (!lowpan_802154_is_valid_src_short_addr(neigh->short_addr))
neigh->short_addr = cpu_to_le16(IEEE802154_ADDR_SHORT_UNSPEC);
} else {
neigh->short_addr = cpu_to_le16(IEEE802154_ADDR_SHORT_UNSPEC);
}
write_unlock_bh(&n->lock);
}

Expand Down

0 comments on commit 9e262f5

Please sign in to comment.