ll_init_map(&rth);
idx = ll_name_to_index(d);
- if (idx == 0) {
- fprintf(stderr, "Cannot find device \"%s\"\n", d);
- return 1;
- }
+ if (!idx)
+ return -nodev(d);
req.t.tcm_ifindex = idx;
}
static int filter_ifindex;
-int print_qdisc(const struct sockaddr_nl *who,
- struct nlmsghdr *n, void *arg)
+int print_qdisc(struct nlmsghdr *n, void *arg)
{
FILE *fp = (FILE *)arg;
struct tcmsg *t = NLMSG_DATA(n);
if (d[0]) {
t.tcm_ifindex = ll_name_to_index(d);
- if (t.tcm_ifindex == 0) {
- fprintf(stderr, "Cannot find device \"%s\"\n", d);
- return 1;
- }
+ if (!t.tcm_ifindex)
+ return -nodev(d);
filter_ifindex = t.tcm_ifindex;
}
bool found;
};
-static int tc_qdisc_block_exists_cb(const struct sockaddr_nl *who,
- struct nlmsghdr *n, void *arg)
+static int tc_qdisc_block_exists_cb(struct nlmsghdr *n, void *arg)
{
struct tc_qdisc_block_exists_ctx *ctx = arg;
struct tcmsg *t = NLMSG_DATA(n);