mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-25 16:30:07 +01:00
ndisc: ignore addresses with preferred lifetime larger than lifetime
Previously, we would coerce the value so that preferred is the same
as lifetime. However, RFC4862 5.5.3.c) says:
c) If the preferred lifetime is greater than the valid lifetime,
silently ignore the Prefix Information option. A node MAY wish to
log a system management error in this case.
See-also: https://tools.ietf.org/search/rfc4862#section-5.5.3
This commit is contained in:
parent
02958bba80
commit
43c3c259c8
2 changed files with 5 additions and 4 deletions
|
|
@ -221,10 +221,10 @@ receive_ra (struct ndp *ndp, struct ndp_msg *msg, gpointer user_data)
|
|||
.preferred = ndp_msg_opt_prefix_preferred_time (msg, offset),
|
||||
};
|
||||
|
||||
if (address.preferred > address.lifetime)
|
||||
address.preferred = address.lifetime;
|
||||
if (nm_ndisc_complete_and_add_address (ndisc, &address))
|
||||
changed |= NM_NDISC_CONFIG_ADDRESSES;
|
||||
if (address.preferred <= address.lifetime) {
|
||||
if (nm_ndisc_complete_and_add_address (ndisc, &address))
|
||||
changed |= NM_NDISC_CONFIG_ADDRESSES;
|
||||
}
|
||||
}
|
||||
}
|
||||
ndp_msg_opt_for_each_offset(offset, msg, NDP_MSG_OPT_ROUTE) {
|
||||
|
|
|
|||
|
|
@ -416,6 +416,7 @@ nm_ndisc_add_address (NMNDisc *ndisc, const NMNDiscAddress *new)
|
|||
nm_assert (new->timestamp > 0 && new->timestamp < G_MAXINT32);
|
||||
nm_assert (!IN6_IS_ADDR_UNSPECIFIED (&new->address));
|
||||
nm_assert (!IN6_IS_ADDR_LINKLOCAL (&new->address));
|
||||
nm_assert (new->preferred <= new->lifetime);
|
||||
|
||||
for (i = 0; i < rdata->addresses->len; i++) {
|
||||
NMNDiscAddress *item = &g_array_index (rdata->addresses, NMNDiscAddress, i);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue