Repository : ssh://git@open-mesh.org/batctl
On branch : next
>---------------------------------------------------------------
commit 24113255a00ef454e2b3a995947dab9b59fc9ce3
Author: Simon Wunderlich <sw(a)simonwunderlich.de>
Date: Mon Dec 2 20:38:33 2013 +0100
batctl: fix size of batadv_bla_claim_dst
Since this is a mac address and always 48 bit, and we can assume that
it is always aligned to 2-byte boundaries, add a pack(2) pragma.
Signed-off-by: Simon Wunderlich <sw(a)simonwunderlich.de>
Signed-off-by: Marek Lindner <mareklindner(a)neomailbox.ch>
>---------------------------------------------------------------
24113255a00ef454e2b3a995947dab9b59fc9ce3
packet.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/packet.h b/packet.h
index 2a857ed..04cf27c 100644
--- a/packet.h
+++ b/packet.h
@@ -155,6 +155,7 @@ enum batadv_tvlv_type {
BATADV_TVLV_ROAM = 0x05,
};
+#pragma pack(2)
/* the destination hardware field in the ARP frame is used to
* transport the claim type and the group id
*/
@@ -163,6 +164,7 @@ struct batadv_bla_claim_dst {
uint8_t type; /* bla_claimframe */
__be16 group; /* group id */
};
+#pragma pack()
/**
* struct batadv_ogm_packet - ogm (routing protocol) packet
Repository : ssh://git@open-mesh.org/batctl
On branch : next
>---------------------------------------------------------------
commit fafc1818166982100921055aa9817063244d8fef
Author: Simon Wunderlich <sw(a)simonwunderlich.de>
Date: Mon Dec 2 20:38:30 2013 +0100
batctl: fix alignment for batadv_coded_packet
The compiler may decide to pad the structure, and then it does not
have the expected size of 46 byte. Fix this by moving it in the
pragma pack(2) part of the code.
Signed-off-by: Simon Wunderlich <sw(a)simonwunderlich.de>
Signed-off-by: Marek Lindner <mareklindner(a)neomailbox.ch>
>---------------------------------------------------------------
fafc1818166982100921055aa9817063244d8fef
packet.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/packet.h b/packet.h
index 207459b..10597a6 100644
--- a/packet.h
+++ b/packet.h
@@ -315,8 +315,6 @@ struct batadv_bcast_packet {
*/
};
-#pragma pack()
-
/**
* struct batadv_coded_packet - network coded packet
* @header: common batman packet header and ttl of first included packet
@@ -349,6 +347,8 @@ struct batadv_coded_packet {
__be16 coded_len;
};
+#pragma pack()
+
/**
* struct batadv_unicast_tvlv - generic unicast packet with tvlv payload
* @header: common batman packet header
Repository : ssh://git@open-mesh.org/openwrt-feed-alfred
On branch : master
>---------------------------------------------------------------
commit 0a7457d02124597182b8e3174561dd2d8a449f93
Author: Gui Iribarren <gui(a)altermundi.net>
Date: Fri Dec 13 16:05:26 2013 -0300
alfred: workaround race condition when batmanif is not ready at boot time
Wait up to 30 seconds during init.d script on boot, so that batmanif can
come up. If the timeout is reached, the init.d script refuses to start
alfred and related daemons.
This prevents an alfred crash when it would start during early boot, before
batmanif is available. Instead, alfred is started as soon as batmanif appears,
if that happens during the 30-second window.
Signed-off-by: Gui Iribarren <gui(a)altermundi.net>
>---------------------------------------------------------------
0a7457d02124597182b8e3174561dd2d8a449f93
alfred/Makefile | 2 +-
alfred/files/alfred.init | 18 +++++++++++++++++-
2 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/alfred/Makefile b/alfred/Makefile
index 0367ebb..3d70246 100644
--- a/alfred/Makefile
+++ b/alfred/Makefile
@@ -12,7 +12,7 @@ include $(TOPDIR)/rules.mk
#
PKG_NAME:=alfred
PKG_VERSION:=2013.4.0
-PKG_RELEASE:=2
+PKG_RELEASE:=3
PKG_REV:=67e0d7e9cad9f1e2143925183da64a14ab28eb0f
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE).tar.gz
diff --git a/alfred/files/alfred.init b/alfred/files/alfred.init
index b678d4c..b777b53 100755
--- a/alfred/files/alfred.init
+++ b/alfred/files/alfred.init
@@ -16,6 +16,7 @@ pid_file_alfred="/var/run/alfred.pid"
pid_file_vis="/var/run/batadv-vis.pid"
enable=0
vis_enable=0
+batmanif=""
SERVICE_DAEMONIZE=1
SERVICE_WRITE_PID=1
@@ -23,7 +24,7 @@ alfred_start()
{
local args=""
local section="$1"
- local disabled interface mode batmanif
+ local disabled interface mode
# check if section is disabled
config_get_bool disabled "$section" disabled 0
@@ -62,6 +63,21 @@ start()
if [ "$enable" = "0" ]; then
exit 0
fi
+
+ mesh_dir="/sys/class/net/$batmanif/mesh/"
+ if ! [ -d "$mesh_dir" ] ; then
+ timeout=30
+ echo "${initscript}: waiting $timeout secs for $batmanif interface..."
+ for i in $(seq $timeout); do
+ sleep 1
+ [ -d "$mesh_dir" ] && break
+ if [ $i == $timeout ] ; then
+ echo "${initscript}: $batmanif not detected, alfred not starting."
+ exit 1
+ fi
+ done
+ fi
+
echo "${initscript}: starting alfred"
SERVICE_PID_FILE="$pid_file_alfred"
service_start /usr/sbin/alfred ${alfred_args}