netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Kristian Evensen <kristian.evensen@gmail.com>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH net-next] fib_trie: Send RTM_DELROUTE when link goes down
Date: Thu, 17 Oct 2013 10:23:30 -0700	[thread overview]
Message-ID: <1382030610.22110.112.camel@joe-AO722> (raw)
In-Reply-To: <1382028894-14236-1-git-send-email-kristian.evensen@gmail.com>

On Thu, 2013-10-17 at 18:54 +0200, Kristian Evensen wrote:
> From: Kristian Evensen <kristian.evensen@gmail.com>
> 
> When a link is set as down using for example "ip link set dev X down", routes
> are deleted, but RTM_DELROUTE messages are not sent to RTNLGRP_IPV4_ROUTE. This
> patch makes trie_flush_list() send a RTM_DELROUTE for each route that is
> removed, and makes rtnelink route deletion behavior consistent across commands.
> The parameter lists for trie_flush_list() and trie_flush_leaf() are expanded to
> include required information otherwise unavailable in trie_flush_list().
[]
> diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
[]
> @@ -1698,15 +1698,23 @@ int fib_table_delete(struct fib_table *tb, struct fib_config *cfg)
>  	return 0;
>  }
>  
> -static int trie_flush_list(struct list_head *head)
> +static int trie_flush_list(struct list_head *head, u32 tb_id, t_key key,
> +			    int plen)
>  {
>  	struct fib_alias *fa, *fa_node;
>  	int found = 0;
> +	struct nl_info cfg;
> +
> +	memset(&cfg, 0, sizeof(cfg));

Perhaps this memset should be moved into the
list_for_each_entry_safe loop where cfg is used.
 
>  	list_for_each_entry_safe(fa, fa_node, head, fa_list) {
>  		struct fib_info *fi = fa->fa_info;
>  
>  		if (fi && (fi->fib_flags & RTNH_F_DEAD)) {

			memset(&cfg, 0, sizeof(cfg));

?

> +			cfg.nl_net = fi->fib_net;
> +			rtmsg_fib(RTM_DELROUTE, htonl(key), fa, plen, tb_id,
> +				  &cfg, 0);

  reply	other threads:[~2013-10-17 17:23 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-17 11:13 [PATCH net-next] fib_trie: Send RTM_DELROUTE when link goes down Kristian Evensen
2013-10-17 13:43 ` Sergei Shtylyov
2013-10-17 16:40   ` Kristian Evensen
2013-10-17 16:54     ` Kristian Evensen
2013-10-17 17:23       ` Joe Perches [this message]
2013-10-17 20:14         ` Kristian Evensen
2013-10-17 20:34           ` [PATCH net-next] fib: Use const struct nl_info * in rtmsg_fib Joe Perches
2013-10-18 18:42             ` David Miller
2013-10-17 19:52       ` [PATCH net-next] fib_trie: Send RTM_DELROUTE when link goes down Julian Anastasov
2013-10-17 20:11         ` Kristian Evensen
2013-10-17 20:19           ` David Miller
2013-10-17 20:19         ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1382030610.22110.112.camel@joe-AO722 \
    --to=joe@perches.com \
    --cc=kristian.evensen@gmail.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).