batman-adv: only store changed gw_bandwidth values
authorMarek Lindner <lindner_marek@yahoo.de>
Fri, 11 May 2012 08:10:50 +0000 (16:10 +0800)
committerAntonio Quartulli <ordex@autistici.org>
Mon, 18 Jun 2012 16:01:07 +0000 (18:01 +0200)
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
net/batman-adv/gateway_common.c

index ca57ac7d73b279609a3dd9f711a430d45cd1cc7e..6e3b052b935d09b33a0e291f2d1c81252dc7827f 100644 (file)
@@ -162,6 +162,9 @@ ssize_t gw_bandwidth_set(struct net_device *net_dev, char *buff, size_t count)
         **/
        gw_bandwidth_to_kbit((uint8_t)gw_bandwidth_tmp, &down, &up);
 
+       if (atomic_read(&bat_priv->gw_bandwidth) == gw_bandwidth_tmp)
+               return count;
+
        gw_deselect(bat_priv);
        bat_info(net_dev,
                 "Changing gateway bandwidth from: '%i' to: '%ld' (propagating: %d%s/%d%s)\n",