• Sven Eckelmann's avatar
    batman-adv: Split batadv_iv_ogm_orig_del_if function · 64ae7445
    Sven Eckelmann authored
    batadv_iv_ogm_orig_del_if handles two different buffers bcast_own and
    bcast_own_sum which should be resized. The error handling two for
    allocating these buffers causes the complexity of this function. This can
    be avoided completely when the function is split into a main function
    handling the locking, freeing and call of the subfunctions.
    
    The subfunction can then independently handle the resize of the buffers.
    This also allows to easily reuse the old buffer (which always is larger) in
    case a smaller buffer could not be allocated without increasing the code
    complexity.
    Signed-off-by: default avatarSven Eckelmann <sven@narfation.org>
    Signed-off-by: default avatarMarek Lindner <mareklindner@neomailbox.ch>
    Signed-off-by: default avatarAntonio Quartulli <a@unstable.cc>
    64ae7445
bat_iv_ogm.c 62.4 KB