b.a.t.m.a.n.lists.open-mesh.org archive mirror
 help / color / mirror / Atom feed
From: "Linus Lüssing" <linus.luessing@saxnet.de>
To: b.a.t.m.a.n@lists.open-mesh.org
Cc: "Linus Lüssing" <linus.luessing@saxnet.de>
Subject: [B.A.T.M.A.N.] [PATCH 07/18] batman-adv: Route multicast tracker packets
Date: Sun, 30 Jan 2011 05:39:15 +0100	[thread overview]
Message-ID: <1296362366-3852-8-git-send-email-linus.luessing@saxnet.de> (raw)
In-Reply-To: <1296362366-3852-1-git-send-email-linus.luessing@saxnet.de>

This commit adds the ability to also forward a received multicast
tracker packet (if necessary). It also makes use of the same splitting
methods introduced with one of the previous commits, in case of multiple
next hop destinations.

Signed-off-by: Linus Lüssing <linus.luessing@saxnet.de>
---
 hard-interface.c |    5 +++++
 routing.c        |   20 ++++++++++++++++++++
 routing.h        |    1 +
 3 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/batman-adv/hard-interface.c b/batman-adv/hard-interface.c
index 1455e7f..8fa8ff7 100644
--- a/batman-adv/hard-interface.c
+++ b/batman-adv/hard-interface.c
@@ -631,6 +631,11 @@ static int batman_skb_recv(struct sk_buff *skb, struct net_device *dev,
 		ret = recv_bcast_packet(skb, batman_if);
 		break;
 
+		/* multicast tracker packet */
+	case BAT_MCAST_TRACKER:
+		ret = recv_mcast_tracker_packet(skb, batman_if);
+		break;
+
 		/* vis packet */
 	case BAT_VIS:
 		ret = recv_vis_packet(skb, batman_if);
diff --git a/batman-adv/routing.c b/batman-adv/routing.c
index 81719d9..60dcf39 100644
--- a/batman-adv/routing.c
+++ b/batman-adv/routing.c
@@ -35,6 +35,7 @@
 #include "gateway_common.h"
 #include "gateway_client.h"
 #include "unicast.h"
+#include "multicast.h"
 
 void slide_own_bcast_window(struct batman_if *batman_if)
 {
@@ -1496,6 +1497,25 @@ out:
 	return ret;
 }
 
+int recv_mcast_tracker_packet(struct sk_buff *skb, struct batman_if *recv_if)
+{
+	struct bat_priv *bat_priv = netdev_priv(recv_if->soft_iface);
+	int hdr_size = sizeof(struct mcast_tracker_packet);
+
+	/* keep skb linear */
+	if (skb_linearize(skb) < 0)
+		return NET_RX_DROP;
+
+	if (check_unicast_packet(skb, hdr_size) < 0)
+		return NET_RX_DROP;
+
+	route_mcast_tracker_packet(skb, bat_priv);
+
+	dev_kfree_skb(skb);
+
+	return NET_RX_SUCCESS;
+}
+
 int recv_vis_packet(struct sk_buff *skb, struct batman_if *recv_if)
 {
 	struct vis_packet *vis_packet;
diff --git a/batman-adv/routing.h b/batman-adv/routing.h
index d138644..83f2752 100644
--- a/batman-adv/routing.h
+++ b/batman-adv/routing.h
@@ -38,6 +38,7 @@ int recv_icmp_packet(struct sk_buff *skb, struct batman_if *recv_if);
 int recv_unicast_packet(struct sk_buff *skb, struct batman_if *recv_if);
 int recv_ucast_frag_packet(struct sk_buff *skb, struct batman_if *recv_if);
 int recv_bcast_packet(struct sk_buff *skb, struct batman_if *recv_if);
+int recv_mcast_tracker_packet(struct sk_buff *skb, struct batman_if *recv_if);
 int recv_vis_packet(struct sk_buff *skb, struct batman_if *recv_if);
 int recv_bat_packet(struct sk_buff *skb, struct batman_if *recv_if);
 struct neigh_node *find_router(struct bat_priv *bat_priv,
-- 
1.7.2.3


  parent reply	other threads:[~2011-01-30  4:39 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-30  4:39 [B.A.T.M.A.N.] B.A.T.M.A.N.-Advanced Multicast Optimizations, v3 Linus Lüssing
2011-01-30  4:39 ` [B.A.T.M.A.N.] [PATCH 01/18] batman-adv: Adding configurable variables for multicast optimizations Linus Lüssing
2011-01-30  4:39 ` [B.A.T.M.A.N.] [PATCH 02/18] batman-adv: Attach local MCAs to OGMs Linus Lüssing
2011-01-30  4:39 ` [B.A.T.M.A.N.] [PATCH 03/18] batman-adv: Add periodic multicast tracker timer Linus Lüssing
2011-01-30  4:39 ` [B.A.T.M.A.N.] [PATCH 04/18] batman-adv: Buffer other originator's received MCA entries Linus Lüssing
2011-01-30  4:39 ` [B.A.T.M.A.N.] [PATCH 05/18] batman-adv: Prepare and send own multicast tracker packets Linus Lüssing
2011-01-30  4:39 ` [B.A.T.M.A.N.] [PATCH 06/18] batman-adv: Add length check for (received) " Linus Lüssing
2011-01-30  4:39 ` Linus Lüssing [this message]
2011-01-30  4:39 ` [B.A.T.M.A.N.] [PATCH 08/18] batman-adv: Add/refresh entries to/in mcast forwarding table Linus Lüssing
2011-01-30  4:39 ` [B.A.T.M.A.N.] [PATCH 09/18] batman-adv: Output mcast forw table in debugfs Linus Lüssing
2011-01-30  4:39 ` [B.A.T.M.A.N.] [PATCH 10/18] batman-adv: Purge timeouted entries in mcast forw table Linus Lüssing
2011-01-30  4:39 ` [B.A.T.M.A.N.] [PATCH 11/18] batman-adv: Send own BAT_MCAST packets in proact_tracking multicast mode Linus Lüssing
2011-01-30  4:39 ` [B.A.T.M.A.N.] [PATCH 12/18] batman-adv: Export broadcast packet ethernet header checks Linus Lüssing
2011-01-30  4:39 ` [B.A.T.M.A.N.] [PATCH 13/18] batman-adv: Receive multicast data packets BAT_MCAST Linus Lüssing
2011-01-30  4:39 ` [B.A.T.M.A.N.] [PATCH 14/18] batman-adv: Forward multicast data in proact_tracking mode Linus Lüssing
2011-01-30  4:39 ` [B.A.T.M.A.N.] [PATCH 15/18] batman-adv: Add duplicate checks for multicast data Linus Lüssing
2011-01-30  4:39 ` [B.A.T.M.A.N.] [PATCH 16/18] batman-adv: Still flood multicast packets we are not a receiver of Linus Lüssing
2011-01-30  4:39 ` [B.A.T.M.A.N.] [PATCH 17/18] batman-adv: Make number of (re)broadcasts configurable via sysfs Linus Lüssing
2011-01-30  4:39 ` [B.A.T.M.A.N.] [PATCH 18/18] batman-adv: Use rcu-locking for multicast forwarding table Linus Lüssing

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=1296362366-3852-8-git-send-email-linus.luessing@saxnet.de \
    --to=linus.luessing@saxnet.de \
    --cc=b.a.t.m.a.n@lists.open-mesh.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).