summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Hesse <mail@eworm.de>2014-09-15 11:35:53 +0200
committerDan Williams <dcbw@redhat.com>2014-09-15 12:10:24 -0500
commitc668297257aef17f921518f6a7efac2ede2af76a (patch)
tree91b68ec5c24d28340cbbc7cbcac36807ee0412af
parentc0ecd2f62815606824bc934599dc46b069fe9962 (diff)
downloadNetworkManager-c668297257aef17f921518f6a7efac2ede2af76a.tar.gz
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.
-rw-r--r--src/devices/nm-device.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index 1afb5d118c..8eb86d9294 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -3649,7 +3649,9 @@ rdisc_config_changed (NMRDisc *rdisc, NMRDiscConfigMap changed, NMDevice *self)
}
}
- 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);