summaryrefslogtreecommitdiffstats
path: root/src/network/tc/fifo.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/tc/fifo.c')
-rw-r--r--src/network/tc/fifo.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/network/tc/fifo.c b/src/network/tc/fifo.c
index 3dd7f0b5f4..4f6e8fa613 100644
--- a/src/network/tc/fifo.c
+++ b/src/network/tc/fifo.c
@@ -11,7 +11,6 @@
#include "string-util.h"
static int fifo_fill_message(Link *link, QDisc *qdisc, sd_netlink_message *req) {
- struct tc_fifo_qopt opt = {};
FirstInFirstOut *fifo;
int r;
@@ -21,23 +20,22 @@ static int fifo_fill_message(Link *link, QDisc *qdisc, sd_netlink_message *req)
switch(qdisc->kind) {
case QDISC_KIND_PFIFO:
- fifo = PFIFO(qdisc);
+ assert_se(fifo = PFIFO(qdisc));
break;
case QDISC_KIND_BFIFO:
- fifo = BFIFO(qdisc);
+ assert_se(fifo = BFIFO(qdisc));
break;
case QDISC_KIND_PFIFO_HEAD_DROP:
- fifo = PFIFO_HEAD_DROP(qdisc);
+ assert_se(fifo = PFIFO_HEAD_DROP(qdisc));
break;
default:
assert_not_reached();
}
- opt.limit = fifo->limit;
-
- r = sd_netlink_message_append_data(req, TCA_OPTIONS, &opt, sizeof(struct tc_fifo_qopt));
+ const struct tc_fifo_qopt opt = { .limit = fifo->limit };
+ r = sd_netlink_message_append_data(req, TCA_OPTIONS, &opt, sizeof(opt));
if (r < 0)
- return log_link_error_errno(link, r, "Could not append TCA_OPTIONS attribute: %m");
+ return r;
return 0;
}