[PATCH] add multicast route for mesh collaboration
James Cameron
quozl at laptop.org
Thu Jun 3 01:41:14 EDT 2010
Add a multicast route when msh0 is raised by Network Manager. Fix a
minor backslash quoting issue on eth0.
Tested by creating the file on os240py and starting mesh, then
checking with "ip route list" command and confirming that a Chat
activity shared from an os802 laptop causes an icon to appear in the
Neighbourhood View of the os240py laptop.
---
modules/base/kspost.10.core.inc | 19 ++++++++++++++-----
1 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/modules/base/kspost.10.core.inc b/modules/base/kspost.10.core.inc
index 40c7483..03e2345 100644
--- a/modules/base/kspost.10.core.inc
+++ b/modules/base/kspost.10.core.inc
@@ -96,12 +96,21 @@ echo "NM_IGNORE_HOSTNAME_LOCALHOST=yes" >> /etc/sysconfig/network
cat >/etc/NetworkManager/dispatcher.d/adhoc-route <<EOF
#!/bin/sh
# workaround for http://dev.laptop.org/ticket/9669
-[ "\$1" = "eth0" ] || exit 0
-if [ "\$2" = "down" ]; then
- /sbin/ip route del 224.0.0.0/4 dev eth0 &>/dev/null
+if [ "\$1" = "eth0" ]; then
+ if [ "\$2" = "down" ]; then
+ /sbin/ip route del 224.0.0.0/4 dev eth0 &>/dev/null
else
- /sbin/iwconfig \$1 | /bin/grep -q "Mode:Ad-Hoc" && \
- /sbin/ip route add 224.0.0.0/4 dev eth0 &>/dev/null
+ else
+ /sbin/iwconfig eth0 | /bin/grep -q "Mode:Ad-Hoc" && \\
+ /sbin/ip route add 224.0.0.0/4 dev eth0 &>/dev/null
+ fi
+fi
+if [ "\$1" = "msh0" ]; then
+ if [ "\$2" = "down" ]; then
+ /sbin/ip route del 224.0.0.0/4 dev msh0 &>/dev/null
+ else
+ /sbin/ip route add 224.0.0.0/4 dev msh0 &>/dev/null
+ fi
fi
exit 0
EOF
--
1.7.1
--
James Cameron
http://quozl.linux.org.au/
More information about the Testing
mailing list