zebra: ignore unspec RetransTimer in RA validation

Section 6.2.7 of RFC 4861 states that a router SHOULD log
inconsistencies in RA information detected on a given link:
```
    - Cur Hop Limit values (except for the unspecified value of zero
      other inconsistencies SHOULD be logged to system network
      management).

    - Values of the M or O flags.

    - Reachable Time values (except for the unspecified value of zero).

    - Retrans Timer values (except for the unspecified value of zero).

    - Values in the MTU options.

    - Preferred and Valid Lifetimes for the same prefix.  If
      AdvPreferredLifetime and/or AdvValidLifetime decrement in real
      time as specified in Section 6.2.1 then the comparison of the
      lifetimes cannot compare the content of the fields in the Router
      Advertisement, but must instead compare the time at which the
      prefix will become deprecated and invalidated, respectively.  Due
      to link propagation delays and potentially poorly synchronized
      clocks between the routers such comparison SHOULD allow some time
      skew.
```

We were not logging inconsistencies if "the unspecified value of zero"
was used for Reachable Time but were logging them for Retrans Timer.
This updates the validation check to also skip the logging of Retrans
Timer inconsistencies if either local/rx value is 0.

Signed-off-by: Trey Aspelund <taspelund@nvidia.com>
This commit is contained in:
Trey Aspelund 2022-09-30 20:47:54 +00:00
parent 99e66e520b
commit 820a9cadb2

View File

@ -713,7 +713,8 @@ static void rtadv_process_advert(uint8_t *msg, unsigned int len,
monotime(&zif->rtadv.lastadvreachabletime);
}
if ((ntohl(radvert->nd_ra_retransmit) !=
if ((radvert->nd_ra_retransmit && zif->rtadv.AdvRetransTimer) &&
(ntohl(radvert->nd_ra_retransmit) !=
(unsigned int)zif->rtadv.AdvRetransTimer) &&
(monotime_since(&zif->rtadv.lastadvretranstimer, NULL) >
SIXHOUR2USEC ||