Skip to content

Commit

Permalink
net: ipv6: Fix Neighbor Advertisement processing w/o TLLA option
Browse files Browse the repository at this point in the history
According to RFC 4861, ch. 7.2.5:

 "If the Override flag is set, or the supplied link-layer address
  is the same as that in the cache, or no Target Link-Layer Address
  option was supplied, the received advertisement MUST update the
  Neighbor Cache entry as follows

  ...

  If the Solicited flag is set, the state of the entry MUST be
  set to REACHABLE"

This indicates that Target Link-Layer Address option does not need to be
present in the received solicited Neighbor Advertisement to confirm
reachability. Therefore remove `tllao_offset` variable check from the
if condition responsible for updating cache entry. No further changes in
the logic are required because if TLLA option is missing,
`lladdr_changed` will be set to false, so no LL address will be updated.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
(cherry picked from commit 02c153c)
  • Loading branch information
rlubos authored and github-actions[bot] committed Feb 14, 2025
1 parent e7358d6 commit 02bb15d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion subsys/net/ip/ipv6_nbr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1730,7 +1730,7 @@ static inline bool handle_na_neighbor(struct net_pkt *pkt,

if (na_hdr->flags & NET_ICMPV6_NA_FLAG_OVERRIDE ||
(!(na_hdr->flags & NET_ICMPV6_NA_FLAG_OVERRIDE) &&
tllao_offset && !lladdr_changed)) {
!lladdr_changed)) {

Check notice on line 1734 in subsys/net/ip/ipv6_nbr.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

subsys/net/ip/ipv6_nbr.c:1734 - (!(na_hdr->flags & NET_ICMPV6_NA_FLAG_OVERRIDE) && - !lladdr_changed)) { + (!(na_hdr->flags & NET_ICMPV6_NA_FLAG_OVERRIDE) && !lladdr_changed)) {

Check notice on line 1734 in subsys/net/ip/ipv6_nbr.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

subsys/net/ip/ipv6_nbr.c:1734 - (!(na_hdr->flags & NET_ICMPV6_NA_FLAG_OVERRIDE) && - !lladdr_changed)) { + (!(na_hdr->flags & NET_ICMPV6_NA_FLAG_OVERRIDE) && !lladdr_changed)) {

Check notice on line 1734 in subsys/net/ip/ipv6_nbr.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

subsys/net/ip/ipv6_nbr.c:1734 - (!(na_hdr->flags & NET_ICMPV6_NA_FLAG_OVERRIDE) && - !lladdr_changed)) { + (!(na_hdr->flags & NET_ICMPV6_NA_FLAG_OVERRIDE) && !lladdr_changed)) {
if (lladdr_changed) {
dbg_update_neighbor_lladdr_raw(
Expand Down

0 comments on commit 02bb15d

Please sign in to comment.