From patchwork Tue Dec 7 22:32:26 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Linus_L=C3=BCssing?= X-Patchwork-Id: 620 Return-Path: Received: from fmmailgate03.web.de (fmmailgate03.web.de [217.72.192.234]) by open-mesh.org (Postfix) with ESMTP id 68D34154650 for ; Tue, 7 Dec 2010 23:34:03 +0100 (CET) Received: from smtp01.web.de ( [172.20.0.243]) by fmmailgate03.web.de (Postfix) with ESMTP id 8CF6E17C68715; Tue, 7 Dec 2010 23:32:45 +0100 (CET) Received: from [46.126.246.98] (helo=localhost) by smtp01.web.de with asmtp (TLSv1:AES128-SHA:128) (WEB.DE 4.110 #24) id 1PQ65V-0004VV-00; Tue, 07 Dec 2010 23:32:45 +0100 From: =?UTF-8?q?Linus=20L=C3=BCssing?= To: b.a.t.m.a.n@lists.open-mesh.org Date: Tue, 7 Dec 2010 23:32:26 +0100 Message-Id: <1291761150-29818-16-git-send-email-linus.luessing@saxnet.de> X-Mailer: git-send-email 1.7.1 In-Reply-To: <20101207221351.GA19474@Sellars> References: <20101207221351.GA19474@Sellars> MIME-Version: 1.0 Sender: linus.luessing@web.de X-Sender: linus.luessing@web.de X-Provags-ID: V01U2FsdGVkX1898wkTIxZkLwoNR4OlH9ALtyNqPGSSApvtS0Sr stMgVQU2A3PF31Oj7FbYtAoUYi3lAacUt6RrvvtKt4cZdFrYZE vgeU+Th9K/J0pO+a31Xg== Cc: =?UTF-8?q?Linus=20L=C3=BCssing?= Subject: [B.A.T.M.A.N.] [PATCH 16/20] batman-adv: Forward multicast data in proact_tracking mode 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: Tue, 07 Dec 2010 22:34:03 -0000 This patch enables the forwarding of multicast data and uses the same methods for deciding to forward via broad- or unicast(s) as the local packet encapsulation already did. Signed-off-by: Linus Lüssing --- multicast.c | 2 +- multicast.h | 1 + routing.c | 4 ++++ 3 files changed, 6 insertions(+), 1 deletions(-) diff --git a/multicast.c b/multicast.c index 72249ef..042d392 100644 --- a/multicast.c +++ b/multicast.c @@ -1059,7 +1059,7 @@ int mcast_forw_table_seq_print_text(struct seq_file *seq, void *offset) return 0; } -static void route_mcast_packet(struct sk_buff *skb, struct bat_priv *bat_priv) +void route_mcast_packet(struct sk_buff *skb, struct bat_priv *bat_priv) { struct sk_buff *skb1; struct mcast_packet *mcast_packet; diff --git a/multicast.h b/multicast.h index 06dd398..6dcf537 100644 --- a/multicast.h +++ b/multicast.h @@ -32,6 +32,7 @@ void route_mcast_tracker_packet( int tracker_packet_len, struct bat_priv *bat_priv); void purge_mcast_forw_table(struct bat_priv *bat_priv); int mcast_forw_table_seq_print_text(struct seq_file *seq, void *offset); +void route_mcast_packet(struct sk_buff *skb, struct bat_priv *bat_priv); int mcast_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv); int mcast_init(struct bat_priv *bat_priv); void mcast_free(struct bat_priv *bat_priv); diff --git a/routing.c b/routing.c index b1aad26..f9582be 100644 --- a/routing.c +++ b/routing.c @@ -1390,6 +1390,7 @@ int recv_bcast_packet(struct sk_buff *skb, struct batman_if *recv_if) int recv_mcast_packet(struct sk_buff *skb, struct batman_if *recv_if) { + struct bat_priv *bat_priv = netdev_priv(recv_if->soft_iface); struct ethhdr *ethhdr; MC_LIST *mc_entry; unsigned long flags; @@ -1401,6 +1402,9 @@ int recv_mcast_packet(struct sk_buff *skb, struct batman_if *recv_if) check_broadcast_packet(skb, hdr_size) < 0) return NET_RX_DROP; + /* forward multicast packet if necessary */ + route_mcast_packet(skb, bat_priv); + ethhdr = (struct ethhdr *)(skb->data + sizeof(struct mcast_packet)); /* multicast for me? */