int error;
tcmsg = tc_make_request(netdev, RTM_DELQDISC, 0, &request);
+ if (!tcmsg) {
+ return ENODEV;
+ }
tcmsg->tcm_handle = tc_make_handle(0xffff, 0);
tcmsg->tcm_parent = TC_H_INGRESS;
nl_msg_put_string(&request, TCA_KIND, "ingress");
}
}
-static void
+static bool
start_queue_dump(const struct netdev *netdev, struct nl_dump *dump)
{
struct ofpbuf request;
struct tcmsg *tcmsg;
tcmsg = tc_make_request(netdev, RTM_GETTCLASS, 0, &request);
+ if (!tcmsg) {
+ return false;
+ }
tcmsg->tcm_parent = 0;
nl_dump_start(dump, rtnl_sock, &request);
ofpbuf_uninit(&request);
+ return true;
}
static int
}
last_error = 0;
- start_queue_dump(netdev, &dump);
+ if (!start_queue_dump(netdev, &dump)) {
+ return ENODEV;
+ }
while (nl_dump_next(&dump, &msg)) {
error = netdev_dev->tc->ops->class_dump_stats(netdev, &msg, cb, aux);
if (error) {
tcmsg = tc_make_request(netdev, RTM_NEWQDISC,
NLM_F_EXCL | NLM_F_CREATE, &request);
+ if (!tcmsg) {
+ return ENODEV;
+ }
tcmsg->tcm_handle = tc_make_handle(1, 0);
tcmsg->tcm_parent = TC_H_ROOT;
opt.prio = class->priority;
tcmsg = tc_make_request(netdev, RTM_NEWTCLASS, NLM_F_CREATE, &request);
+ if (!tcmsg) {
+ return ENODEV;
+ }
tcmsg->tcm_handle = handle;
tcmsg->tcm_parent = parent;
htb = htb_install__(netdev, hc.max_rate);
/* Get queues. */
- start_queue_dump(netdev, &dump);
+ if (!start_queue_dump(netdev, &dump)) {
+ return ENODEV;
+ }
while (nl_dump_next(&dump, &msg)) {
unsigned int queue_id;
int error;
tcmsg = tc_make_request(netdev, RTM_GETTCLASS, NLM_F_ECHO, &request);
+ if (!tcmsg) {
+ return ENODEV;
+ }
tcmsg->tcm_handle = handle;
tcmsg->tcm_parent = parent;
int error;
tcmsg = tc_make_request(netdev, RTM_DELTCLASS, 0, &request);
+ if (!tcmsg) {
+ return ENODEV;
+ }
tcmsg->tcm_handle = handle;
tcmsg->tcm_parent = 0;
int error;
tcmsg = tc_make_request(netdev, RTM_DELQDISC, 0, &request);
+ if (!tcmsg) {
+ return ENODEV;
+ }
tcmsg->tcm_handle = tc_make_handle(1, 0);
tcmsg->tcm_parent = TC_H_ROOT;
* We could check for Linux 2.6.35+ and use a more straightforward method
* there. */
tcmsg = tc_make_request(netdev, RTM_GETQDISC, NLM_F_ECHO, &request);
+ if (!tcmsg) {
+ return ENODEV;
+ }
tcmsg->tcm_handle = tc_make_handle(1, 0);
tcmsg->tcm_parent = 0;