[9/9] batman-adv: Don't increase mtu of interface automatically

Message ID 1281820085-13507-9-git-send-email-sven.eckelmann@gmx.de (mailing list archive)
State Rejected, archived
Headers

Commit Message

Sven Eckelmann Aug. 14, 2010, 9:08 p.m. UTC
  The user usually sets a mtu by hand and don't want to have software to
change it automatically. This is only needed when we must reduce the mtu
due to a low mtu of an active slave device, but we should not increase
it when any other action is made on the system related to the used
interfaces.

Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
---
 batman-adv/hard-interface.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
  

Comments

Marek Lindner Aug. 14, 2010, 9:32 p.m. UTC | #1
On Saturday 14 August 2010 23:08:05 Sven Eckelmann wrote:
> The user usually sets a mtu by hand and don't want to have software to
> change it automatically. This is only needed when we must reduce the mtu
> due to a low mtu of an active slave device, but we should not increase
> it when any other action is made on the system related to the used
> interfaces.

I fear that this might lead to a strange user experience. If the mtu on batX 
wasn't set explicitely but the mtu of an interface used by batman is increased 
while batman uses it the user has to know that he/she now needs to manually 
modify the batX mtu before it becomes effective.

What about a flag which remembers whether the mtu on batX was modified by the 
user. If so, batman-adv does not increase the mtu otherwise we keep the 
current behaviour ?

Regards,
Marek
  
Sven Eckelmann Aug. 15, 2010, 8:23 a.m. UTC | #2
Marek Lindner wrote:
> On Saturday 14 August 2010 23:08:05 Sven Eckelmann wrote:
> > The user usually sets a mtu by hand and don't want to have software to
> > change it automatically. This is only needed when we must reduce the mtu
> > due to a low mtu of an active slave device, but we should not increase
> > it when any other action is made on the system related to the used
> > interfaces.
> 
> I fear that this might lead to a strange user experience. If the mtu on
> batX wasn't set explicitely but the mtu of an interface used by batman is
> increased while batman uses it the user has to know that he/she now needs
> to manually modify the batX mtu before it becomes effective.
> 
> What about a flag which remembers whether the mtu on batX was modified by
> the user. If so, batman-adv does not increase the mtu otherwise we keep
> the current behaviour ?

Ok, then drop that patch. The user seems to be familiar with that behavior 
because bridge handles it the same way.

Best regards,
	Sven
  

Patch

diff --git a/batman-adv/hard-interface.c b/batman-adv/hard-interface.c
index ee02050..eb26026 100644
--- a/batman-adv/hard-interface.c
+++ b/batman-adv/hard-interface.c
@@ -201,7 +201,7 @@  void update_min_mtu(struct net_device *soft_iface)
 	int min_mtu;
 
 	min_mtu = hardif_min_mtu(soft_iface);
-	if (soft_iface->mtu != min_mtu)
+	if (soft_iface->mtu > min_mtu)
 		soft_iface->mtu = min_mtu;
 }
 
@@ -241,8 +241,6 @@  static void hardif_deactivate_interface(struct batman_if *batman_if)
 
 	bat_info(batman_if->soft_iface, "Interface deactivated: %s\n",
 		 batman_if->net_dev->name);
-
-	update_min_mtu(batman_if->soft_iface);
 }
 
 int hardif_enable_interface(struct batman_if *batman_if, char *iface_name)