From: David Miller <davem@davemloft.net>
To: mateusz.bajorski@nokia.com
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH v4] fib_rules: Added NLM_F_EXCL support to fib_nl_newrule
Date: Thu, 30 Jun 2016 08:24:31 -0400 (EDT) [thread overview]
Message-ID: <20160630.082431.1308534563356523412.davem@davemloft.net> (raw)
In-Reply-To: <57737722.6000101@nokia.com>
From: Mateusz Bajorski <mateusz.bajorski@nokia.com>
Date: Wed, 29 Jun 2016 09:22:10 +0200
> When adding rule with NLM_F_EXCL flag then check if the same rule exist.
> If yes then exit with -EEXIST.
>
> This is already implemented in iproute2:
> if (cmd == RTM_NEWRULE) {
> req.n.nlmsg_flags |= NLM_F_CREATE|NLM_F_EXCL;
> req.r.rtm_type = RTN_UNICAST;
> }
>
> Tested ipv4 and ipv6 with net-next linux on qemu x86
>
> expected behavior after patch:
> localhost ~ # ip rule
> 0: from all lookup local
> 32766: from all lookup main
> 32767: from all lookup default
> localhost ~ # ip rule add from 10.46.177.97 lookup 104 pref 1005
> localhost ~ # ip rule add from 10.46.177.97 lookup 104 pref 1005
> RTNETLINK answers: File exists
> localhost ~ # ip rule
> 0: from all lookup local
> 1005: from 10.46.177.97 lookup 104
> 32766: from all lookup main
> 32767: from all lookup default
>
> There was already topic regarding this but I don't see any changes
> merged and problem still occurs.
> https://lkml.kernel.org/r/1135778809.5944.7.camel+%28%29+localhost+%21+localdomain
>
> Signed-off-by: Mateusz Bajorski <mateusz.bajorski@nokia.com>
Applied to net-next, thanks.
prev parent reply other threads:[~2016-06-30 12:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-29 7:22 [PATCH v4] fib_rules: Added NLM_F_EXCL support to fib_nl_newrule Mateusz Bajorski
2016-06-29 19:38 ` David Ahern
2016-06-30 12:24 ` David Miller [this message]
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=20160630.082431.1308534563356523412.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=mateusz.bajorski@nokia.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).