From patchwork Sat Jan 22 01:21:39 2011 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: 724 Return-Path: Received: from fmmailgate02.web.de (fmmailgate02.web.de [217.72.192.227]) by open-mesh.org (Postfix) with ESMTP id A675A154682 for ; Sat, 22 Jan 2011 02:22:23 +0100 (CET) Received: from smtp04.web.de ( [172.20.0.225]) by fmmailgate02.web.de (Postfix) with ESMTP id 9CE58193A05D7; Sat, 22 Jan 2011 02:22:23 +0100 (CET) Received: from [46.126.246.98] (helo=localhost) by smtp04.web.de with asmtp (TLSv1:AES128-SHA:128) (WEB.DE 4.110 #24) id 1PgSBL-0001Nl-00; Sat, 22 Jan 2011 02:22:23 +0100 From: =?UTF-8?q?Linus=20L=C3=BCssing?= To: b.a.t.m.a.n@lists.open-mesh.org Date: Sat, 22 Jan 2011 02:21:39 +0100 Message-Id: <1295659302-7171-17-git-send-email-linus.luessing@saxnet.de> X-Mailer: git-send-email 1.7.2.3 In-Reply-To: <1295659302-7171-1-git-send-email-linus.luessing@saxnet.de> References: <1295659302-7171-1-git-send-email-linus.luessing@saxnet.de> MIME-Version: 1.0 Sender: linus.luessing@web.de X-Sender: linus.luessing@web.de X-Provags-ID: V01U2FsdGVkX19mZNLrEVVLnVu7FAongu27iICHWdGf/CD+AIkB sdiIPjfVK/dO/GbrjeXl+3FVxEZzfNLOhQxvLFHqtGc5G0XGTO e0vYEcYzapBky/pcdGAQ== Cc: =?UTF-8?q?Linus=20L=C3=BCssing?= Subject: [B.A.T.M.A.N.] [PATCH 16/19] 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: Sat, 22 Jan 2011 01:22:25 -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/batman-adv/multicast.c b/batman-adv/multicast.c index a8613ef..70184cf 100644 --- a/batman-adv/multicast.c +++ b/batman-adv/multicast.c @@ -1241,7 +1241,7 @@ static inline void nexthops_from_table(uint8_t *dest, uint8_t *orig, } } -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/batman-adv/multicast.h b/batman-adv/multicast.h index 06dd398..6dcf537 100644 --- a/batman-adv/multicast.h +++ b/batman-adv/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/batman-adv/routing.c b/batman-adv/routing.c index b5559c0..512d9ba 100644 --- a/batman-adv/routing.c +++ b/batman-adv/routing.c @@ -1512,6 +1512,7 @@ out: 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; int ret = 1; @@ -1522,6 +1523,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? */