[B.A.T.M.A.N.] bat_events: page allocation failure (batman-adv maint)
by Linus Lüssing
Hey guys,
I've been installing a 9 node setup here in our cellar. They are
all running B.A.T.M.A.N. adv 0.2.1-beta r1545 (so the current
batman-adv maintance version in OpenWRT).
The result over night:
- 1x: bat_events: page allocation failure
- 3x: WARNING: at net/sched/sch_generic.c:226 0x801c3554()
(those 3 had TQ values of about 10-15 in batctl)
For the last error, I'm not sure if this is related to batman-adv
or to the madwifi driver. I was using OpenWRT trunk 18405 on all
routers.
I'm attaching some backtraces. Sorry again I can't get more out of
them than that with ksymoops. The first two ones are the
bat_events problem, the others the scheduling thingy.
Cheers, Linus
12 years, 11 months
[B.A.T.M.A.N.] reorganized kernel interface
by Marek Lindner
Hi folks,
during the last batman developer meeting in Bruxelles we decided that it is
time to reorganize the batman-adv kernel interface to address numerous issues
and feature requests we have been hearing about throughout the last year. The
required changes are extensive, therefore it will take a while to get it all
sorted out.
Specifically we are targeting the following items:
* People with larger layer2 meshes have expressed the idea of having multiple
meshes running on the same device in order to build a node which sits
inbetween 2 (or more) mesh networks and routes the traffic from one to the other
(thereby reducing the overhead). Due to code limitations batman-adv can only
create a single mesh on a machine. There are numerous global variables and
functions that need to be modfied in order to support multiple meshes.
* Despite the fact that we have a growing number of events which would allow
user space applications to implement some intelligence to improve the mesh
experience batman-adv has no way of communicating these events back to
applications. To address this issue we will be moving batman-adv from /proc to
sysfs which empowers batman-adv to trigger uevents that can be handled from
user space.
* Since batman-adv's existence its parameter always were configurable using
simple commands like echo or cat. Although this interface was easy it is not
possible to direct error messages back to the shell, In case you misspelled a
parameter you had to check the system logs to learn about it. The following
patch introduces a way of exporting "allowed values", so that user space
applications can parse it and alert the user immediately. See batctl as an
example.
Please review and comment the following patches. As soon as those were
digested I will send more.
Known issues:
* When sending a wrong input value to aggregate_ogm or bonding the kernel
processes the input 3 times.
Cheers,
Marek
12 years, 11 months
[B.A.T.M.A.N.] [PATCH] batman-adv: only modify hna-table on active module
by Linus Lüssing
If we haven't set the module to MODULE_ACTIVE state before (in general,
no interface has yet been added to batman-adv) then the hna table is not
initialised yet. If the kernel changes the mac address of the bat0
interface at this moment then an hna_local_add() called by interface_set_mac_addr()
then resulted in a null pointer derefernce. With this patch we are now
explicitly checking before if the state is MODULE_ACTIVE right now so
that we can assume having an initialised hna table.
Signed-off-by: Linus Lüssing <linus.luessing(a)web.de>
---
batman-adv-kernelland/soft-interface.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/batman-adv-kernelland/soft-interface.c b/batman-adv-kernelland/soft-interface.c
index f098a4f..582134f 100644
--- a/batman-adv-kernelland/soft-interface.c
+++ b/batman-adv-kernelland/soft-interface.c
@@ -154,9 +154,13 @@ int interface_set_mac_addr(struct net_device *dev, void *p)
if (!is_valid_ether_addr(addr->sa_data))
return -EADDRNOTAVAIL;
- hna_local_remove(dev->dev_addr, "mac address changed");
+ /* only modify hna-table if it has been initialised before */
+ if (atomic_read(&module_state) == MODULE_ACTIVE) {
+ hna_local_remove(dev->dev_addr, "mac address changed");
+ hna_local_add(addr->sa_data);
+ }
+
memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN);
- hna_local_add(dev->dev_addr);
return 0;
}
--
1.7.0
12 years, 11 months
[B.A.T.M.A.N.] Batman-adv r1575 on openwrt 8.09.2 no originators
by Rudolf Meijering
Hi,
I have Batman-adv r1575 on openwrt 8.09.2, but i can't find any originators.
here is what i did:
On a clean install of openwrt with batman:
Enable wifi
Set channel to 1
set mode to ahdemo
restart
Is there something I missed?
--
Rudolf Meijering
12 years, 11 months
[B.A.T.M.A.N.] [PATCH 1/8] Staging: batman-adv: depend on NET instead of PACKET in Kconfig
by Andrew Lunn
From: Sven Eckelmann <sven.eckelmann(a)gmx.de>
The code which uses the raw packet sockets was removed. The only related
dependencies are the skb and netdev handling code. This is provided by
NET in Kconfig.
Signed-off-by: Sven Eckelmann <sven.eckelmann(a)gmx.de>
Signed-off-by: Andrew Lunn <andrew(a)lunn.ch>
---
drivers/staging/batman-adv/Kconfig | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/staging/batman-adv/Kconfig b/drivers/staging/batman-adv/Kconfig
index 69e8fb0..1e7e0a8 100644
--- a/drivers/staging/batman-adv/Kconfig
+++ b/drivers/staging/batman-adv/Kconfig
@@ -4,7 +4,7 @@
config BATMAN_ADV
tristate "B.A.T.M.A.N. Advanced Meshing Protocol"
- depends on PROC_FS && PACKET
+ depends on PROC_FS && NET
default n
---help---
--
1.6.6.2
12 years, 11 months
[B.A.T.M.A.N.] [PATCH v3] batman-adv: Record route for ICMP messages
by Daniel Seither
The standard layer 3 ping utility can use the record route (RR) option
of IP to collect route data for sent ping messages (ping -R). This
patch introduces comparable functionality for batman-adv ICMP messages.
The patch adds a second batman ICMP packet format (icmp_packet_rr) such
that up to 17 MAC addresses can be recorded (sufficient for up to 8
hops per direction). When no RR is wanted, the old icmp_packet without
the RR overhead can be sent.
batctl is extended to recognize the -R option for the ping subcommand.
The output should be the same as for the standard iputils ping program.
For this, the destination host is printed two times.
Signed-off-by: Daniel Seither <post(a)tiwoc.de>
---
Index: batman-adv-kernelland/types.h
===================================================================
--- batman-adv-kernelland/types.h (revision 1573)
+++ batman-adv-kernelland/types.h (working copy)
@@ -106,7 +106,7 @@
struct device_packet {
struct list_head list;
- struct icmp_packet icmp_packet;
+ struct icmp_packet_rr icmp_packet;
};
struct hna_local_entry {
Index: batman-adv-kernelland/packet.h
===================================================================
--- batman-adv-kernelland/packet.h (revision 1573)
+++ batman-adv-kernelland/packet.h (working copy)
@@ -26,6 +26,7 @@
#define BAT_UNICAST 0x03
#define BAT_BCAST 0x04
#define BAT_VIS 0x05
+#define BAT_ICMP_RR 0x06
/* this file is included by batctl which needs these defines */
#define COMPAT_VERSION 9
@@ -71,6 +72,23 @@
uint8_t uid;
} __attribute__((packed));
+#define BAT_RR_LEN 16
+
+/* icmp_packet_rr must start with all fields from imcp_packet
+ as this is assumed by code that handles ICMP packets */
+struct icmp_packet_rr {
+ uint8_t packet_type;
+ uint8_t version; /* batman version field */
+ uint8_t msg_type; /* see ICMP message types above */
+ uint8_t ttl;
+ uint8_t dst[6];
+ uint8_t orig[6];
+ uint16_t seqno;
+ uint8_t uid;
+ uint8_t rr_cur;
+ uint8_t rr[BAT_RR_LEN][ETH_ALEN];
+} __attribute__((packed));
+
struct unicast_packet {
uint8_t packet_type;
uint8_t version; /* batman version field */
Index: batman-adv-kernelland/device.c
===================================================================
--- batman-adv-kernelland/device.c (revision 1573)
+++ batman-adv-kernelland/device.c (working copy)
@@ -165,6 +165,7 @@
struct device_packet *device_packet;
int error;
unsigned long flags;
+ size_t packet_len = sizeof(struct icmp_packet);
if ((file->f_flags & O_NONBLOCK) && (device_client->queue_len == 0))
return -EAGAIN;
@@ -190,15 +191,18 @@
spin_unlock_irqrestore(&device_client->lock, flags);
+ if (device_packet->icmp_packet.packet_type == BAT_ICMP_RR)
+ packet_len = sizeof(struct icmp_packet_rr);
+
error = __copy_to_user(buf, &device_packet->icmp_packet,
- sizeof(struct icmp_packet));
+ packet_len);
kfree(device_packet);
if (error)
return error;
- return sizeof(struct icmp_packet);
+ return packet_len;
}
ssize_t bat_device_write(struct file *file, const char __user *buff,
@@ -206,28 +210,42 @@
{
struct device_client *device_client =
(struct device_client *)file->private_data;
- struct icmp_packet icmp_packet;
+ struct icmp_packet_rr icmp_packet;
struct orig_node *orig_node;
struct batman_if *batman_if;
uint8_t dstaddr[ETH_ALEN];
unsigned long flags;
+ size_t packet_len = sizeof(struct icmp_packet);
+ int with_rr = 0;
if (len < sizeof(struct icmp_packet)) {
bat_dbg(DBG_BATMAN, "batman-adv:Error - can't send packet from char device: invalid packet size\n");
return -EINVAL;
}
- if (!access_ok(VERIFY_READ, buff, sizeof(struct icmp_packet)))
+ if (len >= sizeof(struct icmp_packet_rr)) {
+ with_rr = 1;
+ packet_len = sizeof(struct icmp_packet_rr);
+ }
+
+ if (!access_ok(VERIFY_READ, buff, packet_len))
return -EFAULT;
- if (__copy_from_user(&icmp_packet, buff, sizeof(icmp_packet)))
+ if (__copy_from_user(&icmp_packet, buff, packet_len))
return -EFAULT;
- if (icmp_packet.packet_type != BAT_ICMP) {
- bat_dbg(DBG_BATMAN, "batman-adv:Error - can't send packet from char device: got bogus packet type (expected: BAT_ICMP)\n");
+ if (icmp_packet.packet_type != BAT_ICMP
+ && icmp_packet.packet_type != BAT_ICMP_RR) {
+ bat_dbg(DBG_BATMAN, "batman-adv:Error - can't send packet from char device: got bogus packet type (expected: BAT_ICMP or BAT_ICMP_RR)\n");
return -EINVAL;
}
+ if (!with_rr && icmp_packet.packet_type == BAT_ICMP_RR) {
+ bat_dbg(DBG_BATMAN, "batman-adv:Error - can't send packet from "
+ "char device: invalid packet size for BAT_ICMP_RR\n");
+ return -EINVAL;
+ }
+
if (icmp_packet.msg_type != ECHO_REQUEST) {
bat_dbg(DBG_BATMAN, "batman-adv:Error - can't send packet from char device: got bogus message type (expected: ECHO_REQUEST)\n");
return -EINVAL;
@@ -269,8 +287,14 @@
batman_if->net_dev->dev_addr,
ETH_ALEN);
+ if (with_rr) {
+ memcpy(icmp_packet.rr,
+ batman_if->net_dev->dev_addr,
+ ETH_ALEN);
+ }
+
send_raw_packet((unsigned char *)&icmp_packet,
- sizeof(struct icmp_packet),
+ packet_len,
batman_if, dstaddr);
goto out;
@@ -298,11 +322,15 @@
}
void bat_device_add_packet(struct device_client *device_client,
- struct icmp_packet *icmp_packet)
+ struct icmp_packet_rr *icmp_packet)
{
struct device_packet *device_packet;
unsigned long flags;
+ size_t packet_len = sizeof(struct icmp_packet);
+ if (icmp_packet->packet_type == BAT_ICMP_RR)
+ packet_len = sizeof(struct icmp_packet_rr);
+
device_packet = kmalloc(sizeof(struct device_packet), GFP_KERNEL);
if (!device_packet)
@@ -310,7 +338,7 @@
INIT_LIST_HEAD(&device_packet->list);
memcpy(&device_packet->icmp_packet, icmp_packet,
- sizeof(struct icmp_packet));
+ packet_len);
spin_lock_irqsave(&device_client->lock, flags);
@@ -339,7 +367,7 @@
wake_up(&device_client->queue_wait);
}
-void bat_device_receive_packet(struct icmp_packet *icmp_packet)
+void bat_device_receive_packet(struct icmp_packet_rr *icmp_packet)
{
struct device_client *hash = device_client_hash[icmp_packet->uid];
Index: batman-adv-kernelland/device.h
===================================================================
--- batman-adv-kernelland/device.h (revision 1573)
+++ batman-adv-kernelland/device.h (working copy)
@@ -32,5 +32,5 @@
size_t len, loff_t *off);
unsigned int bat_device_poll(struct file *file, poll_table *wait);
void bat_device_add_packet(struct device_client *device_client,
- struct icmp_packet *icmp_packet);
-void bat_device_receive_packet(struct icmp_packet *icmp_packet);
+ struct icmp_packet_rr *icmp_packet);
+void bat_device_receive_packet(struct icmp_packet_rr *icmp_packet);
Index: batman-adv-kernelland/hard-interface.c
===================================================================
--- batman-adv-kernelland/hard-interface.c (revision 1573)
+++ batman-adv-kernelland/hard-interface.c (working copy)
@@ -479,6 +479,7 @@
/* batman icmp packet */
case BAT_ICMP:
+ case BAT_ICMP_RR:
ret = recv_icmp_packet(skb);
break;
Index: batman-adv-kernelland/routing.c
===================================================================
--- batman-adv-kernelland/routing.c (revision 1573)
+++ batman-adv-kernelland/routing.c (working copy)
@@ -709,15 +709,16 @@
static int recv_my_icmp_packet(struct sk_buff *skb)
{
struct orig_node *orig_node;
- struct icmp_packet *icmp_packet;
+ struct icmp_packet_rr *icmp_packet;
struct ethhdr *ethhdr;
struct sk_buff *skb_old;
struct batman_if *batman_if;
int ret;
unsigned long flags;
uint8_t dstaddr[ETH_ALEN];
+ int packet_len = sizeof(struct icmp_packet);
- icmp_packet = (struct icmp_packet *) skb->data;
+ icmp_packet = (struct icmp_packet_rr *) skb->data;
ethhdr = (struct ethhdr *) skb_mac_header(skb);
/* add data to device queue */
@@ -726,6 +727,9 @@
return NET_RX_DROP;
}
+ if (icmp_packet->packet_type == BAT_ICMP_RR)
+ packet_len = sizeof(struct icmp_packet_rr);
+
/* answer echo request (ping) */
/* get routing information */
spin_lock_irqsave(&orig_hash_lock, flags);
@@ -745,12 +749,12 @@
/* create a copy of the skb, if needed, to modify it. */
skb_old = NULL;
- if (!skb_clone_writable(skb, sizeof(struct icmp_packet))) {
+ if (!skb_clone_writable(skb, packet_len)) {
skb_old = skb;
skb = skb_copy(skb, GFP_ATOMIC);
if (!skb)
return NET_RX_DROP;
- icmp_packet = (struct icmp_packet *) skb->data;
+ icmp_packet = (struct icmp_packet_rr *) skb->data;
kfree_skb(skb_old);
}
@@ -778,6 +782,7 @@
int ret;
unsigned long flags;
uint8_t dstaddr[ETH_ALEN];
+ int len = sizeof(struct icmp_packet);
icmp_packet = (struct icmp_packet *)skb->data;
ethhdr = (struct ethhdr *)skb_mac_header(skb);
@@ -789,6 +794,9 @@
return NET_RX_DROP;
}
+ if (icmp_packet->packet_type == BAT_ICMP_RR)
+ len = sizeof(struct icmp_packet_rr);
+
/* get routing information */
spin_lock_irqsave(&orig_hash_lock, flags);
orig_node = ((struct orig_node *)
@@ -806,7 +814,7 @@
spin_unlock_irqrestore(&orig_hash_lock, flags);
/* create a copy of the skb, if needed, to modify it. */
- if (!skb_clone_writable(skb, sizeof(struct icmp_packet))) {
+ if (!skb_clone_writable(skb, len)) {
skb_old = skb;
skb = skb_copy(skb, GFP_ATOMIC);
if (!skb)
@@ -832,7 +840,7 @@
int recv_icmp_packet(struct sk_buff *skb)
{
- struct icmp_packet *icmp_packet;
+ struct icmp_packet_rr *icmp_packet;
struct ethhdr *ethhdr;
struct orig_node *orig_node;
struct sk_buff *skb_old;
@@ -860,8 +868,23 @@
if (!is_my_mac(ethhdr->h_dest))
return NET_RX_DROP;
- icmp_packet = (struct icmp_packet *) skb->data;
+ icmp_packet = (struct icmp_packet_rr *) skb->data;
+ if (icmp_packet->packet_type == BAT_ICMP_RR) {
+ hdr_size = sizeof(struct icmp_packet_rr);
+
+ /* drop packet if it has not necessary minimum size */
+ if (skb_headlen(skb) < hdr_size)
+ return NET_RX_DROP;
+
+ /* add record route information if not full */
+ if (icmp_packet->rr_cur < BAT_RR_LEN) {
+ memcpy(&(icmp_packet->rr[icmp_packet->rr_cur]),
+ ethhdr->h_dest, ETH_ALEN);
+ icmp_packet->rr_cur++;
+ }
+ }
+
/* packet for me */
if (is_my_mac(icmp_packet->dst))
return recv_my_icmp_packet(skb);
@@ -888,12 +911,12 @@
spin_unlock_irqrestore(&orig_hash_lock, flags);
/* create a copy of the skb, if needed, to modify it. */
- if (!skb_clone_writable(skb, sizeof(struct icmp_packet))) {
+ if (!skb_clone_writable(skb, hdr_size)) {
skb_old = skb;
skb = skb_copy(skb, GFP_ATOMIC);
if (!skb)
return NET_RX_DROP;
- icmp_packet = (struct icmp_packet *) skb->data;
+ icmp_packet = (struct icmp_packet_rr *) skb->data;
kfree_skb(skb_old);
}
Index: batctl/ping.c
===================================================================
--- batctl/ping.c (revision 1573)
+++ batctl/ping.c (working copy)
@@ -48,6 +48,7 @@
printf(" \t -h print this help\n");
printf(" \t -i interval in seconds\n");
printf(" \t -t timeout in seconds\n");
+ printf(" \t -R record route\n");
}
void sig_handler(int sig)
@@ -64,20 +65,22 @@
int ping(int argc, char **argv)
{
- struct icmp_packet icmp_packet_out, icmp_packet_in;
+ struct icmp_packet_rr icmp_packet_out, icmp_packet_in;
struct timeval tv;
- struct ether_addr *dst_mac = NULL;
- struct bat_host *bat_host;
+ struct ether_addr *dst_mac = NULL, *rr_mac = NULL;
+ struct bat_host *bat_host, *rr_host;
ssize_t read_len;
fd_set read_socket;
int ret = EXIT_FAILURE, ping_fd = 0, res, optchar, found_args = 1;
- int loop_count = -1, loop_interval = 1, timeout = 1;
+ int loop_count = -1, loop_interval = 1, timeout = 1, rr = 0, i;
unsigned int seq_counter = 0, packets_out = 0, packets_in = 0, packets_loss;
- char *dst_string, *mac_string;
+ char *dst_string, *mac_string, *rr_string;
double time_delta;
float min = 0.0, max = 0.0, avg = 0.0;
+ uint8_t last_rr_cur = 0, last_rr[BAT_RR_LEN][ETH_ALEN];
+ size_t packet_len;
- while ((optchar = getopt(argc, argv, "hc:i:t:")) != -1) {
+ while ((optchar = getopt(argc, argv, "hc:i:t:R")) != -1) {
switch (optchar) {
case 'c':
loop_count = strtol(optarg, NULL , 10);
@@ -100,6 +103,10 @@
timeout = 1;
found_args += ((*((char*)(optarg - 1)) == optchar ) ? 1 : 2);
break;
+ case 'R':
+ rr = 1;
+ found_args++;
+ break;
default:
ping_usage();
return EXIT_FAILURE;
@@ -141,6 +148,8 @@
goto out;
}
+ packet_len = sizeof(struct icmp_packet);
+
memcpy(&icmp_packet_out.dst, dst_mac, ETH_ALEN);
icmp_packet_out.packet_type = BAT_ICMP;
icmp_packet_out.version = COMPAT_VERSION;
@@ -148,8 +157,15 @@
icmp_packet_out.ttl = 50;
icmp_packet_out.seqno = 0;
+ if (rr) {
+ icmp_packet_out.packet_type = BAT_ICMP_RR;
+ packet_len = sizeof(struct icmp_packet_rr);
+ icmp_packet_out.rr_cur = 1;
+ memset(&icmp_packet_out.rr, 0, BAT_RR_LEN * ETH_ALEN);
+ }
+
printf("PING %s (%s) %zu(%zu) bytes of data\n", dst_string, mac_string,
- sizeof(icmp_packet_out), sizeof(icmp_packet_out) + 28);
+ packet_len, packet_len + 28);
while (!is_aborted) {
if (loop_count == 0)
@@ -160,7 +176,7 @@
icmp_packet_out.seqno = htons(++seq_counter);
- if (write(ping_fd, (char *)&icmp_packet_out, sizeof(icmp_packet_out)) < 0) {
+ if (write(ping_fd, (char *)&icmp_packet_out, packet_len) < 0) {
printf("Error - can't write to batman adv kernel file '%s': %s\n", BAT_DEVICE, strerror(errno));
goto sleep;
}
@@ -188,26 +204,55 @@
if (res < 0)
goto sleep;
- read_len = read(ping_fd, (char *)&icmp_packet_in, sizeof(icmp_packet_in));
+ read_len = read(ping_fd, (char *)&icmp_packet_in, packet_len);
if (read_len < 0) {
printf("Error - can't read from batman adv kernel file '%s': %s\n", BAT_DEVICE, strerror(errno));
goto sleep;
}
- if ((size_t)read_len < sizeof(icmp_packet_in)) {
+ if ((size_t)read_len < packet_len) {
printf("Warning - dropping received packet as it is smaller than expected (%zu): %zd\n",
- sizeof(icmp_packet_in), read_len);
+ packet_len, read_len);
goto sleep;
}
switch (icmp_packet_in.msg_type) {
case ECHO_REPLY:
time_delta = end_timer();
- printf("%zd bytes from %s icmp_seq=%hu ttl=%d time=%.2f ms\n",
+ printf("%zd bytes from %s icmp_seq=%hu ttl=%d time=%.2f ms",
read_len, dst_string, ntohs(icmp_packet_in.seqno),
icmp_packet_in.ttl, time_delta);
+ if (icmp_packet_in.packet_type == BAT_ICMP_RR) {
+ if (last_rr_cur == icmp_packet_in.rr_cur
+ && !memcmp(last_rr, icmp_packet_in.rr, BAT_RR_LEN * ETH_ALEN)) {
+
+ printf("\t(same route)\n");
+
+ } else {
+ printf("\nRR: ");
+ for (i = 0; i < BAT_RR_LEN
+ && i < icmp_packet_in.rr_cur; i++) {
+
+ rr_mac = (struct ether_addr *)&icmp_packet_in.rr[i];
+ rr_host = bat_hosts_find_by_mac((char *)rr_mac);
+ if (rr_host)
+ rr_string = rr_host->name;
+ else
+ rr_string = ether_ntoa_long(rr_mac);
+ printf("\t%s\n", rr_string);
+ if (memcmp(rr_mac, dst_mac, ETH_ALEN) == 0)
+ printf("\t%s\n", rr_string);
+ }
+ printf("\n");
+
+ last_rr_cur = icmp_packet_in.rr_cur;
+ memcpy(last_rr, icmp_packet_in.rr, BAT_RR_LEN * ETH_ALEN);
+ }
+ } else
+ printf("\n");
+
if ((time_delta < min) || (min == 0.0))
min = time_delta;
if (time_delta > max)
12 years, 11 months
[B.A.T.M.A.N.] [PATCH v2] batman-adv: Record route for ICMP messages
by Daniel Seither
The standard layer 3 ping utility can use the record route (RR) option
of IP to collect route data for sent ping messages (ping -R). This
patch introduces comparable functionality for batman-adv ICMP messages.
The patch adds a second batman ICMP packet format (icmp_packet_rr) such
that up to 17 MAC addresses can be recorded (sufficient for up to 8
hops per direction). When no RR is wanted, the old icmp_packet without
the RR overhead can be sent.
batctl is extended to recognize the -R option for the ping subcommand.
The output should be the same as for the standard iputils ping program.
For this, the destination host is printed two times.
Signed-off-by: Daniel Seither <post(a)tiwoc.de>
---
Index: batman-adv-kernelland/types.h
===================================================================
--- batman-adv-kernelland/types.h (revision 1573)
+++ batman-adv-kernelland/types.h (working copy)
@@ -106,7 +106,7 @@
struct device_packet {
struct list_head list;
- struct icmp_packet icmp_packet;
+ struct icmp_packet_rr icmp_packet;
};
struct hna_local_entry {
Index: batman-adv-kernelland/packet.h
===================================================================
--- batman-adv-kernelland/packet.h (revision 1573)
+++ batman-adv-kernelland/packet.h (working copy)
@@ -26,6 +26,7 @@
#define BAT_UNICAST 0x03
#define BAT_BCAST 0x04
#define BAT_VIS 0x05
+#define BAT_ICMP_RR 0x06
/* this file is included by batctl which needs these defines */
#define COMPAT_VERSION 9
@@ -71,6 +72,23 @@
uint8_t uid;
} __attribute__((packed));
+#define BAT_RR_LEN 96
+
+/* icmp_packet_rr must start with all fields from imcp_packet
+ as this is assumed by code that handles ICMP packets */
+struct icmp_packet_rr {
+ uint8_t packet_type;
+ uint8_t version; /* batman version field */
+ uint8_t msg_type; /* see ICMP message types above */
+ uint8_t ttl;
+ uint8_t dst[6];
+ uint8_t orig[6];
+ uint16_t seqno;
+ uint8_t uid;
+ uint8_t rr_cur;
+ uint8_t rr[BAT_RR_LEN];
+} __attribute__((packed));
+
struct unicast_packet {
uint8_t packet_type;
uint8_t version; /* batman version field */
Index: batman-adv-kernelland/device.c
===================================================================
--- batman-adv-kernelland/device.c (revision 1573)
+++ batman-adv-kernelland/device.c (working copy)
@@ -165,6 +165,7 @@
struct device_packet *device_packet;
int error;
unsigned long flags;
+ size_t packet_len = sizeof(struct icmp_packet);
if ((file->f_flags & O_NONBLOCK) && (device_client->queue_len == 0))
return -EAGAIN;
@@ -190,15 +191,18 @@
spin_unlock_irqrestore(&device_client->lock, flags);
+ if (device_packet->icmp_packet.packet_type == BAT_ICMP_RR)
+ packet_len = sizeof(struct icmp_packet_rr);
+
error = __copy_to_user(buf, &device_packet->icmp_packet,
- sizeof(struct icmp_packet));
+ packet_len);
kfree(device_packet);
if (error)
return error;
- return sizeof(struct icmp_packet);
+ return packet_len;
}
ssize_t bat_device_write(struct file *file, const char __user *buff,
@@ -206,28 +210,42 @@
{
struct device_client *device_client =
(struct device_client *)file->private_data;
- struct icmp_packet icmp_packet;
+ struct icmp_packet_rr icmp_packet;
struct orig_node *orig_node;
struct batman_if *batman_if;
uint8_t dstaddr[ETH_ALEN];
unsigned long flags;
+ size_t packet_len = sizeof(struct icmp_packet);
+ int with_rr = 0;
if (len < sizeof(struct icmp_packet)) {
bat_dbg(DBG_BATMAN, "batman-adv:Error - can't send packet from char device: invalid packet size\n");
return -EINVAL;
}
- if (!access_ok(VERIFY_READ, buff, sizeof(struct icmp_packet)))
+ if (len >= sizeof(struct icmp_packet_rr)) {
+ with_rr = 1;
+ packet_len = sizeof(struct icmp_packet_rr);
+ }
+
+ if (!access_ok(VERIFY_READ, buff, packet_len))
return -EFAULT;
- if (__copy_from_user(&icmp_packet, buff, sizeof(icmp_packet)))
+ if (__copy_from_user(&icmp_packet, buff, packet_len))
return -EFAULT;
- if (icmp_packet.packet_type != BAT_ICMP) {
- bat_dbg(DBG_BATMAN, "batman-adv:Error - can't send packet from char device: got bogus packet type (expected: BAT_ICMP)\n");
+ if (icmp_packet.packet_type != BAT_ICMP
+ && icmp_packet.packet_type != BAT_ICMP_RR) {
+ bat_dbg(DBG_BATMAN, "batman-adv:Error - can't send packet from char device: got bogus packet type (expected: BAT_ICMP or BAT_ICMP_RR)\n");
return -EINVAL;
}
+ if (!with_rr && icmp_packet.packet_type == BAT_ICMP_RR) {
+ bat_dbg(DBG_BATMAN, "batman-adv:Error - can't send packet from "
+ "char device: invalid packet size for BAT_ICMP_RR\n");
+ return -EINVAL;
+ }
+
if (icmp_packet.msg_type != ECHO_REQUEST) {
bat_dbg(DBG_BATMAN, "batman-adv:Error - can't send packet from char device: got bogus message type (expected: ECHO_REQUEST)\n");
return -EINVAL;
@@ -269,8 +287,14 @@
batman_if->net_dev->dev_addr,
ETH_ALEN);
+ if (with_rr) {
+ memcpy(icmp_packet.rr,
+ batman_if->net_dev->dev_addr,
+ ETH_ALEN);
+ }
+
send_raw_packet((unsigned char *)&icmp_packet,
- sizeof(struct icmp_packet),
+ packet_len,
batman_if, dstaddr);
goto out;
@@ -298,11 +322,15 @@
}
void bat_device_add_packet(struct device_client *device_client,
- struct icmp_packet *icmp_packet)
+ struct icmp_packet_rr *icmp_packet)
{
struct device_packet *device_packet;
unsigned long flags;
+ size_t packet_len = sizeof(struct icmp_packet);
+ if (icmp_packet->packet_type == BAT_ICMP_RR)
+ packet_len = sizeof(struct icmp_packet_rr);
+
device_packet = kmalloc(sizeof(struct device_packet), GFP_KERNEL);
if (!device_packet)
@@ -310,7 +338,7 @@
INIT_LIST_HEAD(&device_packet->list);
memcpy(&device_packet->icmp_packet, icmp_packet,
- sizeof(struct icmp_packet));
+ packet_len);
spin_lock_irqsave(&device_client->lock, flags);
@@ -339,7 +367,7 @@
wake_up(&device_client->queue_wait);
}
-void bat_device_receive_packet(struct icmp_packet *icmp_packet)
+void bat_device_receive_packet(struct icmp_packet_rr *icmp_packet)
{
struct device_client *hash = device_client_hash[icmp_packet->uid];
Index: batman-adv-kernelland/device.h
===================================================================
--- batman-adv-kernelland/device.h (revision 1573)
+++ batman-adv-kernelland/device.h (working copy)
@@ -32,5 +32,5 @@
size_t len, loff_t *off);
unsigned int bat_device_poll(struct file *file, poll_table *wait);
void bat_device_add_packet(struct device_client *device_client,
- struct icmp_packet *icmp_packet);
-void bat_device_receive_packet(struct icmp_packet *icmp_packet);
+ struct icmp_packet_rr *icmp_packet);
+void bat_device_receive_packet(struct icmp_packet_rr *icmp_packet);
Index: batman-adv-kernelland/hard-interface.c
===================================================================
--- batman-adv-kernelland/hard-interface.c (revision 1573)
+++ batman-adv-kernelland/hard-interface.c (working copy)
@@ -479,6 +479,7 @@
/* batman icmp packet */
case BAT_ICMP:
+ case BAT_ICMP_RR:
ret = recv_icmp_packet(skb);
break;
Index: batman-adv-kernelland/routing.c
===================================================================
--- batman-adv-kernelland/routing.c (revision 1573)
+++ batman-adv-kernelland/routing.c (working copy)
@@ -709,15 +709,16 @@
static int recv_my_icmp_packet(struct sk_buff *skb)
{
struct orig_node *orig_node;
- struct icmp_packet *icmp_packet;
+ struct icmp_packet_rr *icmp_packet;
struct ethhdr *ethhdr;
struct sk_buff *skb_old;
struct batman_if *batman_if;
int ret;
unsigned long flags;
uint8_t dstaddr[ETH_ALEN];
+ int packet_len = sizeof(struct icmp_packet);
- icmp_packet = (struct icmp_packet *) skb->data;
+ icmp_packet = (struct icmp_packet_rr *) skb->data;
ethhdr = (struct ethhdr *) skb_mac_header(skb);
/* add data to device queue */
@@ -726,6 +727,9 @@
return NET_RX_DROP;
}
+ if (icmp_packet->packet_type == BAT_ICMP_RR)
+ packet_len = sizeof(struct icmp_packet_rr);
+
/* answer echo request (ping) */
/* get routing information */
spin_lock_irqsave(&orig_hash_lock, flags);
@@ -745,12 +749,12 @@
/* create a copy of the skb, if needed, to modify it. */
skb_old = NULL;
- if (!skb_clone_writable(skb, sizeof(struct icmp_packet))) {
+ if (!skb_clone_writable(skb, packet_len)) {
skb_old = skb;
skb = skb_copy(skb, GFP_ATOMIC);
if (!skb)
return NET_RX_DROP;
- icmp_packet = (struct icmp_packet *) skb->data;
+ icmp_packet = (struct icmp_packet_rr *) skb->data;
kfree_skb(skb_old);
}
@@ -778,6 +782,7 @@
int ret;
unsigned long flags;
uint8_t dstaddr[ETH_ALEN];
+ int len = sizeof(struct icmp_packet);
icmp_packet = (struct icmp_packet *)skb->data;
ethhdr = (struct ethhdr *)skb_mac_header(skb);
@@ -789,6 +794,9 @@
return NET_RX_DROP;
}
+ if (icmp_packet->packet_type == BAT_ICMP_RR)
+ len = sizeof(struct icmp_packet_rr);
+
/* get routing information */
spin_lock_irqsave(&orig_hash_lock, flags);
orig_node = ((struct orig_node *)
@@ -806,7 +814,7 @@
spin_unlock_irqrestore(&orig_hash_lock, flags);
/* create a copy of the skb, if needed, to modify it. */
- if (!skb_clone_writable(skb, sizeof(struct icmp_packet))) {
+ if (!skb_clone_writable(skb, len)) {
skb_old = skb;
skb = skb_copy(skb, GFP_ATOMIC);
if (!skb)
@@ -832,7 +840,7 @@
int recv_icmp_packet(struct sk_buff *skb)
{
- struct icmp_packet *icmp_packet;
+ struct icmp_packet_rr *icmp_packet;
struct ethhdr *ethhdr;
struct orig_node *orig_node;
struct sk_buff *skb_old;
@@ -860,8 +868,24 @@
if (!is_my_mac(ethhdr->h_dest))
return NET_RX_DROP;
- icmp_packet = (struct icmp_packet *) skb->data;
+ icmp_packet = (struct icmp_packet_rr *) skb->data;
+ if (icmp_packet->packet_type == BAT_ICMP_RR) {
+ hdr_size = sizeof(struct icmp_packet_rr);
+
+ /* drop packet if it has not necessary minimum size */
+ if (skb_headlen(skb) < hdr_size)
+ return NET_RX_DROP;
+
+ /* add record route information if not full */
+ if (icmp_packet->rr_cur > 0
+ && icmp_packet->rr_cur < BAT_RR_LEN / ETH_ALEN) {
+ memcpy(&(icmp_packet->rr[icmp_packet->rr_cur * ETH_ALEN]),
+ ethhdr->h_dest, ETH_ALEN);
+ icmp_packet->rr_cur++;
+ }
+ }
+
/* packet for me */
if (is_my_mac(icmp_packet->dst))
return recv_my_icmp_packet(skb);
@@ -888,12 +912,12 @@
spin_unlock_irqrestore(&orig_hash_lock, flags);
/* create a copy of the skb, if needed, to modify it. */
- if (!skb_clone_writable(skb, sizeof(struct icmp_packet))) {
+ if (!skb_clone_writable(skb, hdr_size)) {
skb_old = skb;
skb = skb_copy(skb, GFP_ATOMIC);
if (!skb)
return NET_RX_DROP;
- icmp_packet = (struct icmp_packet *) skb->data;
+ icmp_packet = (struct icmp_packet_rr *) skb->data;
kfree_skb(skb_old);
}
Index: batctl/ping.c
===================================================================
--- batctl/ping.c (revision 1573)
+++ batctl/ping.c (working copy)
@@ -48,6 +48,7 @@
printf(" \t -h print this help\n");
printf(" \t -i interval in seconds\n");
printf(" \t -t timeout in seconds\n");
+ printf(" \t -R record route\n");
}
void sig_handler(int sig)
@@ -64,20 +65,22 @@
int ping(int argc, char **argv)
{
- struct icmp_packet icmp_packet_out, icmp_packet_in;
+ struct icmp_packet_rr icmp_packet_out, icmp_packet_in;
struct timeval tv;
- struct ether_addr *dst_mac = NULL;
- struct bat_host *bat_host;
+ struct ether_addr *dst_mac = NULL, *rr_mac = NULL;
+ struct bat_host *bat_host, *rr_host;
ssize_t read_len;
fd_set read_socket;
int ret = EXIT_FAILURE, ping_fd = 0, res, optchar, found_args = 1;
- int loop_count = -1, loop_interval = 1, timeout = 1;
+ int loop_count = -1, loop_interval = 1, timeout = 1, rr = 0, i;
unsigned int seq_counter = 0, packets_out = 0, packets_in = 0, packets_loss;
- char *dst_string, *mac_string;
+ char *dst_string, *mac_string, *rr_string;
double time_delta;
float min = 0.0, max = 0.0, avg = 0.0;
+ uint8_t last_rr_cur = 0, last_rr[BAT_RR_LEN];
+ size_t packet_len;
- while ((optchar = getopt(argc, argv, "hc:i:t:")) != -1) {
+ while ((optchar = getopt(argc, argv, "hc:i:t:R")) != -1) {
switch (optchar) {
case 'c':
loop_count = strtol(optarg, NULL , 10);
@@ -100,6 +103,10 @@
timeout = 1;
found_args += ((*((char*)(optarg - 1)) == optchar ) ? 1 : 2);
break;
+ case 'R':
+ rr = 1;
+ found_args++;
+ break;
default:
ping_usage();
return EXIT_FAILURE;
@@ -141,6 +148,8 @@
goto out;
}
+ packet_len = sizeof(struct icmp_packet);
+
memcpy(&icmp_packet_out.dst, dst_mac, ETH_ALEN);
icmp_packet_out.packet_type = BAT_ICMP;
icmp_packet_out.version = COMPAT_VERSION;
@@ -148,8 +157,15 @@
icmp_packet_out.ttl = 50;
icmp_packet_out.seqno = 0;
+ if (rr) {
+ icmp_packet_out.packet_type = BAT_ICMP_RR;
+ packet_len = sizeof(struct icmp_packet_rr);
+ icmp_packet_out.rr_cur = 1;
+ memset(&icmp_packet_out.rr, 0, BAT_RR_LEN);
+ }
+
printf("PING %s (%s) %zu(%zu) bytes of data\n", dst_string, mac_string,
- sizeof(icmp_packet_out), sizeof(icmp_packet_out) + 28);
+ packet_len, packet_len + 28);
while (!is_aborted) {
if (loop_count == 0)
@@ -160,7 +176,7 @@
icmp_packet_out.seqno = htons(++seq_counter);
- if (write(ping_fd, (char *)&icmp_packet_out, sizeof(icmp_packet_out)) < 0) {
+ if (write(ping_fd, (char *)&icmp_packet_out, packet_len) < 0) {
printf("Error - can't write to batman adv kernel file '%s': %s\n", BAT_DEVICE, strerror(errno));
goto sleep;
}
@@ -188,26 +204,55 @@
if (res < 0)
goto sleep;
- read_len = read(ping_fd, (char *)&icmp_packet_in, sizeof(icmp_packet_in));
+ read_len = read(ping_fd, (char *)&icmp_packet_in, packet_len);
if (read_len < 0) {
printf("Error - can't read from batman adv kernel file '%s': %s\n", BAT_DEVICE, strerror(errno));
goto sleep;
}
- if ((size_t)read_len < sizeof(icmp_packet_in)) {
+ if ((size_t)read_len < packet_len) {
printf("Warning - dropping received packet as it is smaller than expected (%zu): %zd\n",
- sizeof(icmp_packet_in), read_len);
+ packet_len, read_len);
goto sleep;
}
switch (icmp_packet_in.msg_type) {
case ECHO_REPLY:
time_delta = end_timer();
- printf("%zd bytes from %s icmp_seq=%hu ttl=%d time=%.2f ms\n",
+ printf("%zd bytes from %s icmp_seq=%hu ttl=%d time=%.2f ms",
read_len, dst_string, ntohs(icmp_packet_in.seqno),
icmp_packet_in.ttl, time_delta);
+ if (icmp_packet_in.packet_type == BAT_ICMP_RR) {
+ if (last_rr_cur == icmp_packet_in.rr_cur
+ && !memcmp(last_rr, icmp_packet_in.rr, BAT_RR_LEN)) {
+
+ printf("\t(same route)\n");
+
+ } else {
+ printf("\nRR: ");
+ for (i = 0; i < BAT_RR_LEN/ETH_ALEN
+ && i < icmp_packet_in.rr_cur; i++) {
+
+ rr_mac = (struct ether_addr *)&icmp_packet_in.rr[i*ETH_ALEN];
+ rr_host = bat_hosts_find_by_mac((char *)rr_mac);
+ if (rr_host)
+ rr_string = rr_host->name;
+ else
+ rr_string = ether_ntoa_long(rr_mac);
+ printf("\t%s\n", rr_string);
+ if (memcmp(rr_mac, dst_mac, ETH_ALEN) == 0)
+ printf("\t%s\n", rr_string);
+ }
+ printf("\n");
+
+ last_rr_cur = icmp_packet_in.rr_cur;
+ memcpy(last_rr, icmp_packet_in.rr, BAT_RR_LEN);
+ }
+ } else
+ printf("\n");
+
if ((time_delta < min) || (min == 0.0))
min = time_delta;
if (time_delta > max)
12 years, 11 months
[B.A.T.M.A.N.] [PATCH] batman-adv: Record route for ICMP messages
by Daniel Seither
The standard layer 3 ping utility can use the record route option of IP
to collect route data for sent ping messages (ping -R). This patch
introduces comparable functionality for batman-adv ICMP messages.
The patch modifies the batman ICMP packet format such that up to 17 MAC
addresses can be recorded (sufficient for up to 8 hops per direction).
batctl is extended to recognize the -R option for the ping subcommand.
The output should be the same as for the standard iputils ping program.
For this, the destination host is printed two times.
In device.c, the sender's MAC address is inserted at the first position
when receiving a ping message from batctl and RR is enabled (rr_cur >
0). In routing.c, each forwarding node then appends its own MAC address.
This patch could be improved by dynamically growing the packet when a
MAC address is to be added to the recorded route instead of statically
allocating a buffer of fixed length.
Signed-off-by: Daniel Seither <post(a)tiwoc.de>
---
Index: batman-adv-kernelland/packet.h
===================================================================
--- batman-adv-kernelland/packet.h (revision 1568)
+++ batman-adv-kernelland/packet.h (working copy)
@@ -60,6 +60,8 @@
#define BAT_PACKET_LEN sizeof(struct batman_packet)
+#define BAT_RR_LEN 96
+
struct icmp_packet {
uint8_t packet_type;
uint8_t version; /* batman version field */
@@ -69,6 +71,8 @@
uint8_t orig[6];
uint16_t seqno;
uint8_t uid;
+ uint8_t rr_cur;
+ uint8_t rr[BAT_RR_LEN];
} __attribute__((packed));
struct unicast_packet {
Index: batman-adv-kernelland/device.c
===================================================================
--- batman-adv-kernelland/device.c (revision 1568)
+++ batman-adv-kernelland/device.c (working copy)
@@ -268,6 +268,12 @@
memcpy(icmp_packet.orig,
batman_if->net_dev->dev_addr,
ETH_ALEN);
+
+ if (icmp_packet.rr_cur) {
+ memcpy(icmp_packet.rr,
+ batman_if->net_dev->dev_addr,
+ ETH_ALEN);
+ }
send_raw_packet((unsigned char *)&icmp_packet,
sizeof(struct icmp_packet),
Index: batman-adv-kernelland/routing.c
===================================================================
--- batman-adv-kernelland/routing.c (revision 1568)
+++ batman-adv-kernelland/routing.c (working copy)
@@ -862,6 +862,12 @@
icmp_packet = (struct icmp_packet *) skb->data;
+ /* add record route information if not full */
+ if (icmp_packet->rr_cur && icmp_packet->rr_cur < BAT_RR_LEN / ETH_ALEN) {
+ memcpy(&(icmp_packet->rr[icmp_packet->rr_cur * ETH_ALEN]),
ethhdr->h_dest, ETH_ALEN);
+ icmp_packet->rr_cur++;
+ }
+
/* packet for me */
if (is_my_mac(icmp_packet->dst))
return recv_my_icmp_packet(skb);
Index: batctl/ping.c
===================================================================
--- batctl/ping.c (revision 1568)
+++ batctl/ping.c (working copy)
@@ -48,6 +48,7 @@
printf(" \t -h print this help\n");
printf(" \t -i interval in seconds\n");
printf(" \t -t timeout in seconds\n");
+ printf(" \t -R record route\n");
}
void sig_handler(int sig)
@@ -66,18 +67,19 @@
{
struct icmp_packet icmp_packet_out, icmp_packet_in;
struct timeval tv;
- struct ether_addr *dst_mac = NULL;
- struct bat_host *bat_host;
+ struct ether_addr *dst_mac = NULL, *rr_mac = NULL;
+ struct bat_host *bat_host, *rr_host;
ssize_t read_len;
fd_set read_socket;
int ret = EXIT_FAILURE, ping_fd = 0, res, optchar, found_args = 1;
- int loop_count = -1, loop_interval = 1, timeout = 1;
+ int loop_count = -1, loop_interval = 1, timeout = 1, rr = 0, i;
unsigned int seq_counter = 0, packets_out = 0, packets_in = 0,
packets_loss;
- char *dst_string, *mac_string;
+ char *dst_string, *mac_string, *rr_string;
double time_delta;
float min = 0.0, max = 0.0, avg = 0.0;
+ uint8_t last_rr_cur = 0, last_rr[BAT_RR_LEN];
- while ((optchar = getopt(argc, argv, "hc:i:t:")) != -1) {
+ while ((optchar = getopt(argc, argv, "hc:i:t:R")) != -1) {
switch (optchar) {
case 'c':
loop_count = strtol(optarg, NULL , 10);
@@ -100,6 +102,10 @@
timeout = 1;
found_args += ((*((char*)(optarg - 1)) == optchar ) ? 1 : 2);
break;
+ case 'R':
+ rr = 1;
+ found_args++;
+ break;
default:
ping_usage();
return EXIT_FAILURE;
@@ -147,6 +153,8 @@
icmp_packet_out.msg_type = ECHO_REQUEST;
icmp_packet_out.ttl = 50;
icmp_packet_out.seqno = 0;
+ icmp_packet_out.rr_cur = (rr) ? 1 : 0;
+ memset(&icmp_packet_out.rr, 0, BAT_RR_LEN);
printf("PING %s (%s) %zu(%zu) bytes of data\n", dst_string, mac_string,
sizeof(icmp_packet_out), sizeof(icmp_packet_out) + 28);
@@ -204,10 +212,34 @@
switch (icmp_packet_in.msg_type) {
case ECHO_REPLY:
time_delta = end_timer();
- printf("%zd bytes from %s icmp_seq=%hu ttl=%d time=%.2f ms\n",
+ printf("%zd bytes from %s icmp_seq=%hu ttl=%d time=%.2f ms",
read_len, dst_string, ntohs(icmp_packet_in.seqno),
icmp_packet_in.ttl, time_delta);
+ if (icmp_packet_in.rr_cur) {
+ if (last_rr_cur == icmp_packet_in.rr_cur && !memcmp(last_rr,
icmp_packet_in.rr, BAT_RR_LEN)) {
+ printf("\t(same route)\n");
+ } else {
+ printf("\nRR: ");
+ for (i = 0; i < BAT_RR_LEN/ETH_ALEN && i < icmp_packet_in.rr_cur;
i++) {
+ rr_mac = (struct ether_addr *)&icmp_packet_in.rr[i*ETH_ALEN];
+ rr_host = bat_hosts_find_by_mac((char *)rr_mac);
+ if (rr_host)
+ rr_string = rr_host->name;
+ else
+ rr_string = ether_ntoa_long(rr_mac);
+ printf("\t%s\n", rr_string);
+ if (memcmp(rr_mac, dst_mac, ETH_ALEN) == 0)
+ printf("\t%s\n", rr_string);
+ }
+ printf("\n");
+
+ last_rr_cur = icmp_packet_in.rr_cur;
+ memcpy(last_rr, icmp_packet_in.rr, BAT_RR_LEN);
+ }
+ } else
+ printf("\n");
+
if ((time_delta < min) || (min == 0.0))
min = time_delta;
if (time_delta > max)
12 years, 11 months
[B.A.T.M.A.N.] race condition with activate_module?
by Linus Lüssing
Hi guys,
I think I've seen this bug a couple of times but I've never been
able to reproduce it. Now I added a little patch to slow down the
activate_module() procedure and the bug occures every time now. My
question is, did I make a race condition apparent or did I introduce
a bug with this patch?
Cheers, Linus
12 years, 11 months
[B.A.T.M.A.N.] Can't load batman-module on 2.6.26
by Linus Lüssing
And next thing, batman-adv is crashing on Debian stable with a
2.6.26 kernel. The call trace is showing bat_printk() right after
insmodding the batman-adv kernel module from the current
maintenance branch.
(And also thanks to Chris/|x|, I guess you've been experiencing the
same problem on your router with the maintenance branch.)
Cheers, Linus
12 years, 11 months