From patchwork Wed May 8 05:36:20 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Marek Lindner X-Patchwork-Id: 2993 Return-Path: Received: from nm32-vm1.bullet.mail.sg3.yahoo.com (nm32-vm1.bullet.mail.sg3.yahoo.com [106.10.151.208]) by open-mesh.org (Postfix) with ESMTPS id 6DC2560029A for ; Wed, 8 May 2013 07:36:49 +0200 (CEST) Received: from [106.10.166.63] by nm32.bullet.mail.sg3.yahoo.com with NNFMP; 08 May 2013 05:36:45 -0000 Received: from [106.10.167.164] by tm20.bullet.mail.sg3.yahoo.com with NNFMP; 08 May 2013 05:36:45 -0000 Received: from [127.0.0.1] by smtp137.mail.sg3.yahoo.com with NNFMP; 08 May 2013 05:36:45 -0000 X-Yahoo-Newman-Id: 32714.56075.bm@smtp137.mail.sg3.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: FcITtfoVM1kypNlagzfhTnTu8iQI_j8Br03k_uTNyY.zmpH JB2F.X4agQEO6nCheJwYkrXdu6t07YqcZ7zcCtBhILCqdS_lIR4YuhHovA0k nTXHmJnwmpSTDDLdrHlxPNWcYCj6zJVGByfvSmkxesblx1EuWnY2pBiDV7sQ XUCVu1Y60CiK9c07ty0kE8zFcomzm9xkzgFcPLBAR.B9mKgV1fNFLKB6IgOl I2KVyMdToQmJVg837NVeoZFY.trWIgDNqfY1VhsS7V9HOrFMwLE2qPJ.DHvt mPCYjkwEvO1BMhWIOLrxxpT4TJZrTTkBkH3EE1fVMXdxUdPGRVaCBMKYl6c5 jE1yBwWR3DiEeQZWpFsXSXv8_yeZdtuOfp5NFVuc1tQTJxcuoOvVCWDO7Min Rm8mnF_1BcJOWQK6GadC6f9i2pyVp6aGsJzUtmsPHRGhSDAI- X-Yahoo-SMTP: tW.h3tiswBBMXO2coYcbPigGD5Lt6zY_.Zc- X-Rocket-Received: from localhost (lindner_marek@42.98.130.246 with plain) by smtp137.mail.sg3.yahoo.com with SMTP; 07 May 2013 22:36:44 -0700 PDT From: Marek Lindner To: b.a.t.m.a.n@lists.open-mesh.org Date: Wed, 8 May 2013 13:36:20 +0800 Message-Id: <1367991380-30270-1-git-send-email-lindner_marek@yahoo.de> X-Mailer: git-send-email 1.7.10.4 Cc: Marek Lindner Subject: [B.A.T.M.A.N.] [PATCH next] batman-adv: consider network coding overhead when calculating required mtu X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2013 05:36:50 -0000 The module prints a warning when the MTU on the hard interface is too small to transfer payload traffic without fragmentation. The required MTU is calculated based on the encapsulation header size. If network coding is compild into the module its header size is taken into account as well. Signed-off-by: Marek Lindner Acked-by: Martin Hundebøll --- types.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/types.h b/types.h index b2c94e1..8089bd6 100644 --- a/types.h +++ b/types.h @@ -27,9 +27,16 @@ /** * Maximum overhead for the encapsulation for a payload packet */ +#ifdef CONFIG_BATMAN_ADV_NC +#define BATADV_HEADER_LEN \ + (ETH_HLEN + max3(sizeof(struct batadv_unicast_packet), \ + sizeof(struct batadv_bcast_packet), \ + sizeof(struct batadv_coded_packet))) +#else #define BATADV_HEADER_LEN \ (ETH_HLEN + max(sizeof(struct batadv_unicast_packet), \ sizeof(struct batadv_bcast_packet))) +#endif /* CONFIG_BATMAN_ADV_NC */ #ifdef CONFIG_BATMAN_ADV_DAT