]> git.proxmox.com Git - mirror_frr.git/commitdiff
zebra: ignore unspec RetransTimer in RA validation
authorTrey Aspelund <taspelund@nvidia.com>
Fri, 30 Sep 2022 20:47:54 +0000 (20:47 +0000)
committerTrey Aspelund <taspelund@nvidia.com>
Tue, 4 Oct 2022 15:20:44 +0000 (15:20 +0000)
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>
zebra/rtadv.c

index 8059a545e4f3ae6e72e2dde2023bd246d0624d9d..127888d6554796f2ee5674784a21c11a0f67ab22 100644 (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 ||