summaryrefslogtreecommitdiff
path: root/files/etc/init.d/n2n
diff options
context:
space:
mode:
authoregon_ffj <egon@freifunk-jena.de>2011-06-25 10:39:34 (GMT)
committeregon_ffj <egon@freifunk-jena.de>2011-06-25 10:39:34 (GMT)
commit425e20c0b13cb117e4d2fff04f523478a0618e24 (patch)
tree25b2405d73236d9e9e011388f7da8a28d94287d6 /files/etc/init.d/n2n
parent621d12b6d0144a344d4ba80eadc35c9cfe856d92 (diff)
* added radomization for the second bit of the used mac-address (n2n)
Diffstat (limited to 'files/etc/init.d/n2n')
-rwxr-xr-xfiles/etc/init.d/n2n3
1 files changed, 2 insertions, 1 deletions
diff --git a/files/etc/init.d/n2n b/files/etc/init.d/n2n
index 22d7a36..26f2e72 100755
--- a/files/etc/init.d/n2n
+++ b/files/etc/init.d/n2n
@@ -19,7 +19,8 @@ config_cb() {
node_mac=`ifconfig ath0 | grep HWaddr | awk '{print $5}' | tr -d "\n" | cut -c6-`
[ "$route" = "1" ] && args='-r'
if [ "$ipaddr" != "" ]; then
- edge -f $args -a 169.254.0.1 -d $devname -c $community -k $key -m 12:34${node_mac} -l ${supernode}:${port}
+ mac_random=`echo $(head -30 /dev/urandom | tr -dc "0123456789" | head -c2)`
+ edge -f $args -a 169.254.0.1 -d $devname -c $community -k $key -m 12:${mac_random}${node_mac} -l ${supernode}:${port}
ifconfig $devname 0.0.0.0
batctl if add $devname
fi
contact: Jan Huwald // Impressum