From patchwork Thu Sep 16 22:00:09 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Langer X-Patchwork-Id: 406 Return-Path: Received: from mail.gmx.net (mailout-de.gmx.net [213.165.64.23]) by open-mesh.org (Postfix) with SMTP id 9535A15444C for ; Fri, 17 Sep 2010 00:00:45 +0200 (CEST) Received: (qmail invoked by alias); 16 Sep 2010 22:00:44 -0000 Received: from 91-65-48-151-dynip.superkabel.de (EHLO localhost) [91.65.48.151] by mail.gmx.net (mp065) with SMTP; 17 Sep 2010 00:00:44 +0200 X-Authenticated: #9260637 X-Provags-ID: V01U2FsdGVkX19dUl1a20ldek63VZT20NfaOe0nZosn8urwtxxu3p qvlyk98oTniAzC From: Andreas Langer To: b.a.t.m.a.n@lists.open-mesh.org Date: Fri, 17 Sep 2010 00:00:09 +0200 Message-Id: <1284674410-15477-5-git-send-email-an.langer@gmx.de> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <20100916235908.51ab3bfc@rechenknecht> References: <20100916235908.51ab3bfc@rechenknecht> X-Y-GMX-Trusted: 0 Subject: [B.A.T.M.A.N.] [PATCH 5/6] batman-adv: fragment forwarded packets X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.11 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: Thu, 16 Sep 2010 22:00:45 -0000 If a packet is too big to be forwarded over an interface it will be fragmented on-the-fly (if fragmentation is enabled). Signed-off-by: Andreas Langer --- batman-adv/routing.c | 6 ++++++ batman-adv/unicast.h | 2 ++ 2 files changed, 8 insertions(+), 0 deletions(-) diff --git a/batman-adv/routing.c b/batman-adv/routing.c index 5d17597..c763121 100644 --- a/batman-adv/routing.c +++ b/batman-adv/routing.c @@ -1179,6 +1179,12 @@ static int route_unicast_packet(struct sk_buff *skb, unicast_packet = (struct unicast_packet *)skb->data; + if (unicast_packet->packet_type == BAT_UNICAST && + atomic_read(&bat_priv->frag_enabled) && + skb->len > batman_if->net_dev->mtu) + return frag_send_skb(skb, bat_priv, batman_if, + dstaddr); + /* decrement ttl */ unicast_packet->ttl--; diff --git a/batman-adv/unicast.h b/batman-adv/unicast.h index 5908b01..e32b786 100644 --- a/batman-adv/unicast.h +++ b/batman-adv/unicast.h @@ -29,5 +29,7 @@ int frag_reassemble_skb(struct sk_buff *skb, struct bat_priv *bat_priv, struct sk_buff **new_skb); void frag_list_free(struct list_head *head); int unicast_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv); +int frag_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv, + struct batman_if *batman_if, uint8_t dstaddr[]); #endif /* _NET_BATMAN_ADV_UNICAST_H_ */