Skip to content

Commit

Permalink
Merge tag 'batadv-net-pullrequest-20220916' of git://git.open-mesh.or…
Browse files Browse the repository at this point in the history
…g/linux-merge

Simon Wunderlich says:

====================
Here is a batman-adv bugfix:

 - Fix hang up with small MTU hard-interface, by Shigeru Yoshida

* tag 'batadv-net-pullrequest-20220916' of git://git.open-mesh.org/linux-merge:
  batman-adv: Fix hang up with small MTU hard-interface
====================

Link: https://lore.kernel.org/r/20220916160931.1412407-1-sw@simonwunderlich.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Jakub Kicinski committed Sep 20, 2022
2 parents 0a242eb + b1cb8a7 commit 0ee513c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions net/batman-adv/hard-interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <linux/atomic.h>
#include <linux/byteorder/generic.h>
#include <linux/container_of.h>
#include <linux/errno.h>
#include <linux/gfp.h>
#include <linux/if.h>
#include <linux/if_arp.h>
Expand Down Expand Up @@ -700,6 +701,9 @@ int batadv_hardif_enable_interface(struct batadv_hard_iface *hard_iface,
int max_header_len = batadv_max_header_len();
int ret;

if (hard_iface->net_dev->mtu < ETH_MIN_MTU + max_header_len)
return -EINVAL;

if (hard_iface->if_status != BATADV_IF_NOT_IN_USE)
goto out;

Expand Down

0 comments on commit 0ee513c

Please sign in to comment.