From 6a79acb03abc3406b3889738f8003e5f385af1eb Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 15 Sep 2014 11:35:53 +0200 Subject: [PATCH] core: only set IPv6 hop_limit for values greater than zero A "Cur Hop Limit" field value of 0 in a router advertisement means "unspecified by this router" and should not be set in the kernel. (cherry picked from commit c668297257aef17f921518f6a7efac2ede2af76a) --- src/devices/nm-device.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 291f03f..3d8baf8 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -3616,7 +3616,9 @@ rdisc_config_changed (NMRDisc *rdisc, NMRDiscConfigMap changed, NMDevice *device } } - if (changed & NM_RDISC_CONFIG_HOP_LIMIT) { + /* hop_limit == 0 is a special value "unspecified", so do not touch + * in this case */ + if (changed & NM_RDISC_CONFIG_HOP_LIMIT && rdisc->hop_limit > 0) { char val[16]; g_snprintf (val, sizeof (val), "%d", rdisc->hop_limit); -- 1.9.3