]> git.baikalelectronics.ru Git - kernel.git/commit
ipv6: report NLM_F_CREATE and NLM_F_EXCL flags in RTM_NEWROUTE events
authorGuillaume Nault <g.nault@alphalink.fr>
Wed, 7 Sep 2016 15:21:40 +0000 (17:21 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 9 Sep 2016 23:50:23 +0000 (16:50 -0700)
commit5364fa3163da1d8fce6e8e2ee95e6b1ce8323037
treeff62c797d7d70abbcf4d32bdb57bd1f9beda37b0
parent8a24481ee279370ba65f312ef5e12f7a59095b81
ipv6: report NLM_F_CREATE and NLM_F_EXCL flags in RTM_NEWROUTE events

Since commit f5746325ad77 ("ipv6: include NLM_F_REPLACE in route
replace notifications"), RTM_NEWROUTE notifications have their
NLM_F_REPLACE flag set if the new route replaced a preexisting one.
However, other flags aren't set.

This patch reports the missing NLM_F_CREATE and NLM_F_EXCL flag bits.

NLM_F_APPEND is not reported, because in ipv6 a NLM_F_CREATE request
is interpreted as an append request (contrary to ipv4, "prepend" is not
supported, so if NLM_F_EXCL is not set then NLM_F_APPEND is implicit).

As a result, the possible flag combination can now be reported
(iproute2's terminology into parentheses):

  * NLM_F_CREATE | NLM_F_EXCL: route didn't exist, exclusive creation
    ("add").
  * NLM_F_CREATE: route did already exist, new route added after
    preexisting ones ("append").
  * NLM_F_REPLACE: route did already exist, new route replaced the
    first preexisting one ("change").

Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/ip6_fib.c