b.a.t.m.a.n.lists.open-mesh.org archive mirror
 help / color / mirror / Atom feed
From: Antonio Quartulli <ordex@autistici.org>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, b.a.t.m.a.n@lists.open-mesh.org
Subject: [B.A.T.M.A.N.] [PATCH 15/18] batman-adv: Prefix types defines with BATADV_
Date: Thu, 28 Jun 2012 11:34:24 +0200	[thread overview]
Message-ID: <1340876067-28333-16-git-send-email-ordex@autistici.org> (raw)
In-Reply-To: <1340876067-28333-1-git-send-email-ordex@autistici.org>

From: Sven Eckelmann <sven@narfation.org>

Reported-by: Martin Hundebøll <martin@hundeboll.net>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
---
 net/batman-adv/hard-interface.c |   11 ++++++-----
 net/batman-adv/soft-interface.c |    2 +-
 net/batman-adv/types.h          |    9 ++++-----
 3 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c
index 3401084..9b1cb23 100644
--- a/net/batman-adv/hard-interface.c
+++ b/net/batman-adv/hard-interface.c
@@ -196,7 +196,8 @@ int batadv_hardif_min_mtu(struct net_device *soft_iface)
 		if (hard_iface->soft_iface != soft_iface)
 			continue;
 
-		min_mtu = min_t(int, hard_iface->net_dev->mtu - BAT_HEADER_LEN,
+		min_mtu = min_t(int,
+				hard_iface->net_dev->mtu - BATADV_HEADER_LEN,
 				min_mtu);
 	}
 	rcu_read_unlock();
@@ -320,18 +321,18 @@ int batadv_hardif_enable_interface(struct hard_iface *hard_iface,
 		    hard_iface->net_dev->name);
 
 	if (atomic_read(&bat_priv->fragmentation) && hard_iface->net_dev->mtu <
-		ETH_DATA_LEN + BAT_HEADER_LEN)
+		ETH_DATA_LEN + BATADV_HEADER_LEN)
 		batadv_info(hard_iface->soft_iface,
 			    "The MTU of interface %s is too small (%i) to handle the transport of batman-adv packets. Packets going over this interface will be fragmented on layer2 which could impact the performance. Setting the MTU to %zi would solve the problem.\n",
 			    hard_iface->net_dev->name, hard_iface->net_dev->mtu,
-			    ETH_DATA_LEN + BAT_HEADER_LEN);
+			    ETH_DATA_LEN + BATADV_HEADER_LEN);
 
 	if (!atomic_read(&bat_priv->fragmentation) && hard_iface->net_dev->mtu <
-		ETH_DATA_LEN + BAT_HEADER_LEN)
+		ETH_DATA_LEN + BATADV_HEADER_LEN)
 		batadv_info(hard_iface->soft_iface,
 			    "The MTU of interface %s is too small (%i) to handle the transport of batman-adv packets. If you experience problems getting traffic through try increasing the MTU to %zi.\n",
 			    hard_iface->net_dev->name, hard_iface->net_dev->mtu,
-			    ETH_DATA_LEN + BAT_HEADER_LEN);
+			    ETH_DATA_LEN + BATADV_HEADER_LEN);
 
 	if (batadv_hardif_is_iface_up(hard_iface))
 		batadv_hardif_activate_interface(hard_iface);
diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c
index e726419..bbbc9a9 100644
--- a/net/batman-adv/soft-interface.c
+++ b/net/batman-adv/soft-interface.c
@@ -351,7 +351,7 @@ static void batadv_interface_setup(struct net_device *dev)
 	 */
 	dev->mtu = ETH_DATA_LEN;
 	/* reserve more space in the skbuff for our header */
-	dev->hard_header_len = BAT_HEADER_LEN;
+	dev->hard_header_len = BATADV_HEADER_LEN;
 
 	/* generate random address */
 	eth_hw_addr_random(dev);
diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h
index 053c5d4..1d5d21e 100644
--- a/net/batman-adv/types.h
+++ b/net/batman-adv/types.h
@@ -22,12 +22,11 @@
 
 #include "packet.h"
 #include "bitarray.h"
+#include <linux/kernel.h>
 
-#define BAT_HEADER_LEN (ETH_HLEN + \
-	((sizeof(struct unicast_packet) > sizeof(struct bcast_packet) ? \
-	 sizeof(struct unicast_packet) : \
-	 sizeof(struct bcast_packet))))
-
+#define BATADV_HEADER_LEN \
+	(ETH_HLEN + max(sizeof(struct unicast_packet), \
+			sizeof(struct bcast_packet)))
 
 struct hard_iface {
 	struct list_head list;
-- 
1.7.9.4


  parent reply	other threads:[~2012-06-28  9:34 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-28  9:34 [B.A.T.M.A.N.] pull request: batman-adv 2012-06-28 Antonio Quartulli
2012-06-28  9:34 ` [B.A.T.M.A.N.] [PATCH 01/18] batman-adv: Prefix unicast local static functions with batadv_ Antonio Quartulli
2012-06-28  9:34 ` [B.A.T.M.A.N.] [PATCH 02/18] batman-adv: Prefix vis " Antonio Quartulli
2012-06-28  9:34 ` [B.A.T.M.A.N.] [PATCH 03/18] batman-adv: Prefix main " Antonio Quartulli
2012-06-28  9:34 ` [B.A.T.M.A.N.] [PATCH 04/18] batman-adv: Prefix remaining function like macros " Antonio Quartulli
2012-06-28  9:34 ` [B.A.T.M.A.N.] [PATCH 05/18] batman-adv: Directly print to seq_file in vis Antonio Quartulli
2012-06-28  9:34 ` [B.A.T.M.A.N.] [PATCH 06/18] batman-adv: clear ADD+DEL (and viceversa) events in the same orig-interval Antonio Quartulli
2012-06-28  9:34 ` [B.A.T.M.A.N.] [PATCH 07/18] batman-adv: beautify tt_global_add() argument list Antonio Quartulli
2012-06-28  9:34 ` [B.A.T.M.A.N.] [PATCH 08/18] batman-adv: Prefix local defines with BATADV_ Antonio Quartulli
2012-06-28  9:34 ` [B.A.T.M.A.N.] [PATCH 09/18] batman-adv: Prefix debugfs " Antonio Quartulli
2012-06-28  9:34 ` [B.A.T.M.A.N.] [PATCH 10/18] batman-adv: Prefix sysfs " Antonio Quartulli
2012-06-28  9:34 ` [B.A.T.M.A.N.] [PATCH 11/18] batman-adv: Prefix bridge_loop_avoidance " Antonio Quartulli
2012-06-28  9:34 ` [B.A.T.M.A.N.] [PATCH 12/18] batman-adv: Prefix gateway " Antonio Quartulli
2012-06-28  9:34 ` [B.A.T.M.A.N.] [PATCH 13/18] batman-adv: Prefix icmp_socket " Antonio Quartulli
2012-06-28  9:34 ` [B.A.T.M.A.N.] [PATCH 14/18] batman-adv: Prefix packet " Antonio Quartulli
2012-06-28  9:34 ` Antonio Quartulli [this message]
2012-06-28  9:34 ` [B.A.T.M.A.N.] [PATCH 16/18] batman-adv: Prefix unicast " Antonio Quartulli
2012-06-28  9:34 ` [B.A.T.M.A.N.] [PATCH 17/18] batman-adv: Prefix vis " Antonio Quartulli
2012-06-28  9:34 ` [B.A.T.M.A.N.] [PATCH 18/18] batman-adv: Prefix main " Antonio Quartulli
2012-06-28 11:11 ` [B.A.T.M.A.N.] pull request: batman-adv 2012-06-28 David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1340876067-28333-16-git-send-email-ordex@autistici.org \
    --to=ordex@autistici.org \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).