All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next v2] ipv4: include NLM_F_APPEND flag in append route notifications
@ 2015-06-17 18:07 Roopa Prabhu
  2015-06-17 18:30 ` Scott Feldman
  0 siblings, 1 reply; 4+ messages in thread
From: Roopa Prabhu @ 2015-06-17 18:07 UTC (permalink / raw)
  To: davem; +Cc: netdev, alexander.duyck, sfeldma

From: Roopa Prabhu <roopa@cumulusnetworks.com>

This patch adds NLM_F_APPEND flag to struct nlmsg_hdr->nlmsg_flags
in newroute notifications if the route add was an append.
(This is similar to how NLM_F_REPLACE is already part of new
route replace notifications today)

This helps userspace determine if the route add operation was
an append.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
---
v2: flip if condition around append and change |= to =
(feedback from Alexander Duyck and Scott Feldman)

 net/ipv4/fib_trie.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
index 3c699c4..6c666a9 100644
--- a/net/ipv4/fib_trie.c
+++ b/net/ipv4/fib_trie.c
@@ -1082,6 +1082,7 @@ int fib_table_insert(struct fib_table *tb, struct fib_config *cfg)
 	struct trie *t = (struct trie *)tb->tb_data;
 	struct fib_alias *fa, *new_fa;
 	struct key_vector *l, *tp;
+	unsigned int nlflags = 0;
 	struct fib_info *fi;
 	u8 plen = cfg->fc_dst_len;
 	u8 slen = KEYLENGTH - plen;
@@ -1201,7 +1202,9 @@ int fib_table_insert(struct fib_table *tb, struct fib_config *cfg)
 		if (fa_match)
 			goto out;
 
-		if (!(cfg->fc_nlflags & NLM_F_APPEND))
+		if (cfg->fc_nlflags & NLM_F_APPEND)
+			nlflags = NLM_F_APPEND;
+		else
 			fa = fa_first;
 	}
 	err = -ENOENT;
@@ -1238,7 +1241,7 @@ int fib_table_insert(struct fib_table *tb, struct fib_config *cfg)
 
 	rt_cache_flush(cfg->fc_nlinfo.nl_net);
 	rtmsg_fib(RTM_NEWROUTE, htonl(key), new_fa, plen, new_fa->tb_id,
-		  &cfg->fc_nlinfo, 0);
+		  &cfg->fc_nlinfo, nlflags);
 succeeded:
 	return 0;
 
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next v2] ipv4: include NLM_F_APPEND flag in append route notifications
  2015-06-17 18:07 [PATCH net-next v2] ipv4: include NLM_F_APPEND flag in append route notifications Roopa Prabhu
@ 2015-06-17 18:30 ` Scott Feldman
  2015-06-17 20:37   ` roopa
  0 siblings, 1 reply; 4+ messages in thread
From: Scott Feldman @ 2015-06-17 18:30 UTC (permalink / raw)
  To: Roopa Prabhu; +Cc: David S. Miller, Netdev, Alexander Duyck

On Wed, Jun 17, 2015 at 11:07 AM, Roopa Prabhu
<roopa@cumulusnetworks.com> wrote:
> From: Roopa Prabhu <roopa@cumulusnetworks.com>
>
> This patch adds NLM_F_APPEND flag to struct nlmsg_hdr->nlmsg_flags
> in newroute notifications if the route add was an append.
> (This is similar to how NLM_F_REPLACE is already part of new
> route replace notifications today)
>
> This helps userspace determine if the route add operation was
> an append.
>
> Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
> ---
> v2: flip if condition around append and change |= to =
> (feedback from Alexander Duyck and Scott Feldman)

Is this a bug fix for net, or a new feature for net-next?  Regardless,

Acked-by: Scott Feldman <sfeldma@gmail.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next v2] ipv4: include NLM_F_APPEND flag in append route notifications
  2015-06-17 18:30 ` Scott Feldman
@ 2015-06-17 20:37   ` roopa
  2015-06-21 17:23     ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: roopa @ 2015-06-17 20:37 UTC (permalink / raw)
  To: Scott Feldman; +Cc: David S. Miller, Netdev, Alexander Duyck

On 6/17/15, 11:30 AM, Scott Feldman wrote:
> On Wed, Jun 17, 2015 at 11:07 AM, Roopa Prabhu
> <roopa@cumulusnetworks.com> wrote:
>> From: Roopa Prabhu <roopa@cumulusnetworks.com>
>>
>> This patch adds NLM_F_APPEND flag to struct nlmsg_hdr->nlmsg_flags
>> in newroute notifications if the route add was an append.
>> (This is similar to how NLM_F_REPLACE is already part of new
>> route replace notifications today)
>>
>> This helps userspace determine if the route add operation was
>> an append.
>>
>> Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
>> ---
>> v2: flip if condition around append and change |= to =
>> (feedback from Alexander Duyck and Scott Feldman)
> Is this a bug fix for net, or a new feature for net-next?  Regardless,
>
> Acked-by: Scott Feldman <sfeldma@gmail.com>
I could not decide between net and net-next.
....but the patch applies cleanly against net if Dave decides to pick it 
up for net.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next v2] ipv4: include NLM_F_APPEND flag in append route notifications
  2015-06-17 20:37   ` roopa
@ 2015-06-21 17:23     ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2015-06-21 17:23 UTC (permalink / raw)
  To: roopa; +Cc: sfeldma, netdev, alexander.duyck

From: roopa <roopa@cumulusnetworks.com>
Date: Wed, 17 Jun 2015 13:37:23 -0700

> On 6/17/15, 11:30 AM, Scott Feldman wrote:
>> On Wed, Jun 17, 2015 at 11:07 AM, Roopa Prabhu
>> <roopa@cumulusnetworks.com> wrote:
>>> From: Roopa Prabhu <roopa@cumulusnetworks.com>
>>>
>>> This patch adds NLM_F_APPEND flag to struct nlmsg_hdr->nlmsg_flags
>>> in newroute notifications if the route add was an append.
>>> (This is similar to how NLM_F_REPLACE is already part of new
>>> route replace notifications today)
>>>
>>> This helps userspace determine if the route add operation was
>>> an append.
>>>
>>> Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
>>> ---
>>> v2: flip if condition around append and change |= to =
>>> (feedback from Alexander Duyck and Scott Feldman)
>> Is this a bug fix for net, or a new feature for net-next?  Regardless,
>>
>> Acked-by: Scott Feldman <sfeldma@gmail.com>
> I could not decide between net and net-next.
> ....but the patch applies cleanly against net if Dave decides to pick
> it up for net.

It's been like this for so long that it's more like a new feature.

Therefore, applied to net-next, thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-06-21 17:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-17 18:07 [PATCH net-next v2] ipv4: include NLM_F_APPEND flag in append route notifications Roopa Prabhu
2015-06-17 18:30 ` Scott Feldman
2015-06-17 20:37   ` roopa
2015-06-21 17:23     ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.