• Guillaume Nault's avatar
    ipv6: report NLM_F_CREATE and NLM_F_EXCL flags in RTM_NEWROUTE events · 73483c12
    Guillaume Nault authored
    Since commit 37a1d361 ("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: default avatarGuillaume Nault <g.nault@alphalink.fr>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    73483c12
ip6_fib.c 45.3 KB