• Jacques de Laval's avatar
    net: Add new protocol attribute to IP addresses · 47f0bd50
    Jacques de Laval authored
    This patch adds a new protocol attribute to IPv4 and IPv6 addresses.
    Inspiration was taken from the protocol attribute of routes. User space
    applications like iproute2 can set/get the protocol with the Netlink API.
    
    The attribute is stored as an 8-bit unsigned integer.
    
    The protocol attribute is set by kernel for these categories:
    
    - IPv4 and IPv6 loopback addresses
    - IPv6 addresses generated from router announcements
    - IPv6 link local addresses
    
    User space may pass custom protocols, not defined by the kernel.
    
    Grouping addresses on their origin is useful in scenarios where you want
    to distinguish between addresses based on who added them, e.g. kernel
    vs. user space.
    
    Tagging addresses with a string label is an existing feature that could be
    used as a solution. Unfortunately the max length of a label is
    15 characters, and for compatibility reasons the label must be prefixed
    with the name of the device followed by a colon. Since device names also
    have a max l...
    47f0bd50
addrconf.c 178 KB