From: Yu Watanabe Date: Tue, 2 Nov 2021 19:14:08 +0000 (+0900) Subject: network: tc/cake: do not pass 0 if OverheadBytes= is not specified X-Git-Tag: v250-rc1~330^2~10 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3a86a31e0c1d650ac6c5ca37d3b799f5b6692a4b;p=thirdparty%2Fsystemd.git network: tc/cake: do not pass 0 if OverheadBytes= is not specified --- diff --git a/src/network/tc/cake.c b/src/network/tc/cake.c index 0f77036fd80..813a679bf71 100644 --- a/src/network/tc/cake.c +++ b/src/network/tc/cake.c @@ -49,9 +49,11 @@ static int cake_fill_message(Link *link, QDisc *qdisc, sd_netlink_message *req) return log_link_error_errno(link, r, "Could not append TCA_CAKE_AUTORATE attribute: %m"); } - r = sd_netlink_message_append_s32(req, TCA_CAKE_OVERHEAD, c->overhead); - if (r < 0) - return log_link_error_errno(link, r, "Could not append TCA_CAKE_OVERHEAD attribute: %m"); + if (c->overhead_set) { + r = sd_netlink_message_append_s32(req, TCA_CAKE_OVERHEAD, c->overhead); + if (r < 0) + return log_link_error_errno(link, r, "Could not append TCA_CAKE_OVERHEAD attribute: %m"); + } r = sd_netlink_message_close_container(req); if (r < 0) @@ -150,7 +152,7 @@ int config_parse_cake_overhead( c = CAKE(qdisc); if (isempty(rvalue)) { - c->overhead = 0; + c->overhead_set = false; TAKE_PTR(qdisc); return 0; } @@ -170,6 +172,7 @@ int config_parse_cake_overhead( } c->overhead = v; + c->overhead_set = true; TAKE_PTR(qdisc); return 0; } diff --git a/src/network/tc/cake.h b/src/network/tc/cake.h index ba9dcb9a080..08fa3c266b5 100644 --- a/src/network/tc/cake.h +++ b/src/network/tc/cake.h @@ -13,6 +13,7 @@ typedef struct CommonApplicationsKeptEnhanced { uint64_t bandwidth; /* Overhead compensation parameters */ + bool overhead_set; int overhead; } CommonApplicationsKeptEnhanced;