summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-11-13 12:30:57 +0100
committerLennart Poettering <lennart@poettering.net>2015-11-13 13:02:49 +0100
commit66a6bd68976a20449bfcae0c55853d497a3f9b27 (patch)
tree0b45d12b19239d4cbc146a113f64f45806de69f9
parenteb3da9012f462da2451edeb8d67c5b67c833a0b1 (diff)
networkd: fix a couple of format string types
We really should use %i for ints, and %u for unsigneds, and be careful what we pick depending on the type we want to print.
-rw-r--r--src/network/networkd-link.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index 07910c2c3b..a1401cc33f 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -1901,11 +1901,11 @@ static int link_set_ipv6_privacy_extensions(Link *link) {
return 0;
s = link_ipv6_privacy_extensions(link);
- if (s == _IPV6_PRIVACY_EXTENSIONS_INVALID)
+ if (s < 0)
return 0;
p = strjoina("/proc/sys/net/ipv6/conf/", link->ifname, "/use_tempaddr");
- xsprintf(buf, "%u", link->network->ipv6_privacy_extensions);
+ xsprintf(buf, "%u", (unsigned) link->network->ipv6_privacy_extensions);
r = write_string_file(p, buf, WRITE_STRING_FILE_VERIFY_ON_FAILURE);
if (r < 0)
@@ -1927,7 +1927,7 @@ static int link_set_ipv6_accept_ra(Link *link) {
p = strjoina("/proc/sys/net/ipv6/conf/", link->ifname, "/accept_ra");
- /* we handle router advertisments ourselves, tell the kernel to GTFO */
+ /* We handle router advertisments ourselves, tell the kernel to GTFO */
r = write_string_file(p, "0", WRITE_STRING_FILE_VERIFY_ON_FAILURE);
if (r < 0)
log_link_warning_errno(link, r, "Cannot disable kernel IPv6 accept_ra for interface: %m");
@@ -1936,7 +1936,7 @@ static int link_set_ipv6_accept_ra(Link *link) {
}
static int link_set_ipv6_dad_transmits(Link *link) {
- char buf[DECIMAL_STR_MAX(unsigned) + 1];
+ char buf[DECIMAL_STR_MAX(int) + 1];
const char *p = NULL;
int r;
@@ -1951,8 +1951,7 @@ static int link_set_ipv6_dad_transmits(Link *link) {
return 0;
p = strjoina("/proc/sys/net/ipv6/conf/", link->ifname, "/dad_transmits");
-
- xsprintf(buf, "%u", link->network->ipv6_dad_transmits);
+ xsprintf(buf, "%i", link->network->ipv6_dad_transmits);
r = write_string_file(p, buf, WRITE_STRING_FILE_VERIFY_ON_FAILURE);
if (r < 0)
@@ -1962,7 +1961,7 @@ static int link_set_ipv6_dad_transmits(Link *link) {
}
static int link_set_ipv6_hop_limit(Link *link) {
- char buf[DECIMAL_STR_MAX(unsigned) + 1];
+ char buf[DECIMAL_STR_MAX(int) + 1];
const char *p = NULL;
int r;
@@ -1977,8 +1976,7 @@ static int link_set_ipv6_hop_limit(Link *link) {
return 0;
p = strjoina("/proc/sys/net/ipv6/conf/", link->ifname, "/hop_limit");
-
- xsprintf(buf, "%u", link->network->ipv6_hop_limit);
+ xsprintf(buf, "%i", link->network->ipv6_hop_limit);
r = write_string_file(p, buf, WRITE_STRING_FILE_VERIFY_ON_FAILURE);
if (r < 0)