• Matti Vaittinen's avatar
    IPv6 routing, NLM_F_* flag support: REPLACE and EXCL flags support, warn about missing CREATE flag · 4a287eba
    Matti Vaittinen authored
    The support for NLM_F_* flags at IPv6 routing requests.
    
    If NLM_F_CREATE flag is not defined for RTM_NEWROUTE request,
    warning is printed, but no error is returned. Instead new route is
    added. Later NLM_F_CREATE may be required for
    new route creation.
    
    Exception is when NLM_F_REPLACE flag is given without NLM_F_CREATE, and
    no matching route is found. In this case it should be safe to assume
    that the request issuer is familiar with NLM_F_* flags, and does really
    not want route to be created.
    
    Specifying NLM_F_REPLACE flag will now make the kernel to search for
    matching route, and replace it with new one. If no route is found and
    NLM_F_CREATE is specified as well, then new route is created.
    
    Also, specifying NLM_F_EXCL will yield returning of error if matching
    route is found.
    
    Patch created against linux-3.2-rc1
    Signed-off-by: default avatarMatti Vaittinen <Mazziesaccount@gmail.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    4a287eba
ip6_fib.c 35.2 KB