]> git.proxmox.com Git - mirror_ubuntu-bionic-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)
commit73483c1289d148282be3aac3ad30b4aa1f8fac87
treeff62c797d7d70abbcf4d32bdb57bd1f9beda37b0
parentb93e1fa7106582e3a81cc818b719e0341585ff1b
ipv6: report NLM_F_CREATE and NLM_F_EXCL flags in RTM_NEWROUTE events

Since commit 37a1d3611c12 ("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