[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230918113448.c6qypl3xsppv4usz@DEN-LT-70577>
Date: Mon, 18 Sep 2023 11:34:48 +0000
From: Daniel Machon <daniel.machon@...rochip.com>
To: Jiri Pirko <jiri@...nulli.us>
CC: <netdev@...r.kernel.org>, <stephen@...workplumber.org>,
<dsahern@...il.com>
Subject: Re: [patch iproute2-next 2/4] devlink: introduce support for netns
id for nested handle
> +static int nesns_name_by_id_func(char *nsname, void *arg)
Hi Jiri,
nesns -> netns?
> +{
> + struct netns_name_by_id_ctx *ctx = arg;
> + int32_t ret;
> +
> + ret = netns_id_by_name(nsname);
> + if (ret < 0 || ret != ctx->id)
> + return 0;
> + ctx->name = strdup(nsname);
> + return 1;
> +}
> +
> +static char *netns_name_by_id(int32_t id)
> +{
> + struct netns_name_by_id_ctx ctx = {
> + .id = id,
> + };
> +
> + netns_foreach(nesns_name_by_id_func, &ctx);
.. and here
> + return ctx.name;
> +}
> +
/Daniel
Powered by blists - more mailing lists