batman-adv: fix gw_node_update() and gw_election()
authorAntonio Quartulli <ordex@autistici.org>
Mon, 25 Apr 2011 20:44:32 +0000 (22:44 +0200)
committerSven Eckelmann <sven@narfation.org>
Sun, 1 May 2011 20:49:03 +0000 (22:49 +0200)
commitedaa878d88f33f525f09c5c15cba38773ad21064
tree2abf828534472096dab635786c24a69c49b8965e
parent3bfe1a3939fdfd4eb143a3ecf9d508b570239c2a
batman-adv: fix gw_node_update() and gw_election()

This is a regression from 01a68ec97f060aa32a64afaf99b3701080f57c66

- gw_node_update() doesn't add a new gw_node in case of empty curr_gw.
This means that at the beginning no gw_node is added, leading to an
empty gateway list.

- gw_election() is terminating in case of curr_gw == NULL. It has to
terminate in case of curr_gw != NULL

Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
net/batman-adv/gateway_client.c