[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <209bcb66-2d57-eecf-d1a0-cc86af034e95@gmail.com>
Date: Mon, 24 Jun 2019 15:55:49 -0600
From: David Ahern <dsahern@...il.com>
To: Stefano Brivio <sbrivio@...hat.com>,
Stephen Hemminger <stephen@...workplumber.org>
Cc: David Miller <davem@...emloft.net>, Jianlin Shi <jishi@...hat.com>,
Wei Wang <weiwan@...gle.com>, Martin KaFai Lau <kafai@...com>,
Eric Dumazet <edumazet@...gle.com>,
Matti Vaittinen <matti.vaittinen@...rohmeurope.com>,
netdev@...r.kernel.org
Subject: Re: [PATCH iproute2] iproute: Pass RTM_F_CLONED on dump to fetch
cached routes to be flushed
On 6/14/19 7:33 PM, Stefano Brivio wrote:
> diff --git a/ip/iproute.c b/ip/iproute.c
> index 2b3dcc5dbd53..192442b42062 100644
> --- a/ip/iproute.c
> +++ b/ip/iproute.c
> @@ -1602,6 +1602,16 @@ static int save_route_prep(void)
> return 0;
> }
>
> +static int iproute_flush_flags(struct nlmsghdr *nlh, int reqlen)
rename that to iproute_flush_filter to be consistent with
iproute_dump_filter.
Actually, why can't the flush code use iproute_dump_filter?
> +{
> + struct rtmsg *rtm = NLMSG_DATA(nlh);
> +
> + if (filter.cloned)
> + rtm->rtm_flags |= RTM_F_CLONED;
> +
> + return 0;
> +}
> +
> static int iproute_flush(int family, rtnl_filter_t filter_fn)
> {
> time_t start = time(0);
> @@ -1624,7 +1634,7 @@ static int iproute_flush(int family, rtnl_filter_t filter_fn)
> filter.flushe = sizeof(flushb);
>
> for (;;) {
> - if (rtnl_routedump_req(&rth, family, NULL) < 0) {
> + if (rtnl_routedump_req(&rth, family, iproute_flush_flags) < 0) {
> perror("Cannot send dump request");
> return -2;
> }
>
Powered by blists - more mailing lists