diff options
author | Thomas Haller <thaller@redhat.com> | 2020-04-21 08:37:33 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2020-06-15 08:00:54 +0200 |
commit | 0ba9aff4bc1895e05a33867b4d9f052995391f71 (patch) | |
tree | e2f7dbc0b9b46f2e525741d779b3a2c43f9e1c46 | |
parent | 8b7f0c460667f7a846a7930c07f2eb3608858e15 (diff) | |
download | NetworkManager-0ba9aff4bc1895e05a33867b4d9f052995391f71.tar.gz |
Revert "IPv6 SLAAC: Clamp received PIO and RIO Lifetime Values"
This reverts commit 0cbd9193cd0d6d5c18641c20c7e3bd08642208ce.
This reverts commit a5290915d5e04a8f2277756d93a9857694f16029.
(cherry picked from commit ad5fdd9d62df3188f2b5e4af0804e073a207be2c)
-rw-r--r-- | src/ndisc/nm-lndp-ndisc.c | 27 |
1 files changed, 5 insertions, 22 deletions
diff --git a/src/ndisc/nm-lndp-ndisc.c b/src/ndisc/nm-lndp-ndisc.c index cff3db827b..b10adc91f3 100644 --- a/src/ndisc/nm-lndp-ndisc.c +++ b/src/ndisc/nm-lndp-ndisc.c @@ -101,8 +101,6 @@ receive_ra (struct ndp *ndp, struct ndp_msg *msg, gpointer user_data) int offset; int hop_limit; guint32 val; - guint32 clamp_pltime; - guint32 clamp_vltime; /* Router discovery is subject to the following RFC documents: * @@ -167,22 +165,7 @@ receive_ra (struct ndp *ndp, struct ndp_msg *msg, gpointer user_data) changed |= NM_NDISC_CONFIG_GATEWAYS; } - /* Addresses & Routes - * - * The Preferred Lifetime and Valid Lifetime of PIOs are capped to Router Lifetime - * and NM_NDISC_VLTIME_MULT * Preferred Lifetime, respectively. - * - * The Lifetime of RIOs is capped to the Router Lifetime (there is no point in - * maintaining a route if it employs a dead router). - * - * See draft-gont-6man-slaac-renum - */ - #define NM_NDISC_VLTIME_MULT ((guint32) 48) - clamp_pltime = ndp_msgra_router_lifetime (msgra); - - /* clamp_pltime has at most 16 bit set, and multiplication cannot overflow. */ - clamp_vltime = clamp_pltime * NM_NDISC_VLTIME_MULT; - + /* Addresses & Routes */ ndp_msg_opt_for_each_offset (offset, msg, NDP_MSG_OPT_PREFIX) { guint8 r_plen; struct in6_addr r_network; @@ -203,7 +186,7 @@ receive_ra (struct ndp *ndp, struct ndp_msg *msg, gpointer user_data) .network = r_network, .plen = r_plen, .timestamp = now, - .lifetime = NM_MIN (ndp_msg_opt_prefix_valid_time (msg, offset), clamp_vltime), + .lifetime = ndp_msg_opt_prefix_valid_time (msg, offset), }; if (nm_ndisc_add_route (ndisc, &route)) @@ -216,8 +199,8 @@ receive_ra (struct ndp *ndp, struct ndp_msg *msg, gpointer user_data) NMNDiscAddress address = { .address = r_network, .timestamp = now, - .lifetime = NM_MIN (ndp_msg_opt_prefix_valid_time (msg, offset), clamp_vltime), - .preferred = NM_MIN (ndp_msg_opt_prefix_preferred_time (msg, offset), clamp_pltime), + .lifetime = ndp_msg_opt_prefix_valid_time (msg, offset), + .preferred = ndp_msg_opt_prefix_preferred_time (msg, offset), }; if (address.preferred <= address.lifetime) { @@ -231,7 +214,7 @@ receive_ra (struct ndp *ndp, struct ndp_msg *msg, gpointer user_data) .gateway = gateway_addr, .plen = ndp_msg_opt_route_prefix_len (msg, offset), .timestamp = now, - .lifetime = NM_MIN (ndp_msg_opt_route_lifetime (msg, offset), clamp_pltime), + .lifetime = ndp_msg_opt_route_lifetime (msg, offset), .preference = _route_preference_coerce (ndp_msg_opt_route_preference (msg, offset)), }; |