• S
    batman-adv: Allow selection of routing algorithm over rtnetlink · a5ad457e
    Sven Eckelmann 提交于
    A batadv net_device is associated to a B.A.T.M.A.N. routing algorithm. This
    algorithm has to be selected before the interface is initialized and cannot
    be changed after that. The only way to select this algorithm was a module
    parameter which specifies the default algorithm used during the creation of
    the net_device.
    
    This module parameter is writeable over
    /sys/module/batman_adv/parameters/routing_algo and thus allows switching of
    the routing algorithm:
    
    1. change routing_algo parameter
    2. create new batadv net_device
    
    But this is not race free because another process can be scheduled between
    1 + 2 and in that time frame change the routing_algo parameter again.
    
    It is much cleaner to directly provide this information inside the
    rtnetlink's RTM_NEWLINK message. The two processes would be (in regards of
    the creation parameter of their batadv interfaces) be isolated. This also
    eases the integration of batadv devices inside tools like network-manager
    or systemd-networkd which are not expecting to operate on /sys before a new
    net_device is created.
    Signed-off-by: NSven Eckelmann <sven@narfation.org>
    Signed-off-by: NSimon Wunderlich <sw@simonwunderlich.de>
    a5ad457e
soft-interface.c 33.9 KB