forked from freifunk-franken/firmware
fff-network: use upstream function to set local bit
OpenWrt provides a function to set the local-bit in IP addresses. This removes our custom function macFlipLocalBit() and switches to the upstream version. Note that technically the upstream version _sets_ the local bit, i.e. only works one way, while our version _toggled_ the status. Since we always start from addresses without the local bit set, this is irrelevant for the given cases, though. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
This commit is contained in:
parent
fcb19bd233
commit
70873b58fe
|
@ -1,7 +1,7 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=fff-network
|
||||
PKG_RELEASE:=31
|
||||
PKG_RELEASE:=32
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
|
|
|
@ -28,14 +28,3 @@ ipEUISuffix() {
|
|||
echo "$mac" | awk -F: '{ printf("%02x%s:%sff:fe%s:%s%s\n", xor(("0x"$1),2), $2, $3, $4, $5, $6) }'
|
||||
return 0
|
||||
}
|
||||
|
||||
macFlipLocalBit() {
|
||||
# Returns given MAC-address with locally administered bit flipped
|
||||
#
|
||||
# Argument: MAC-address
|
||||
|
||||
local mac=$1
|
||||
|
||||
echo "$mac" | awk -F: '{ printf("%02x:%s:%s:%s:%s:%s\n", xor(("0x"$1),2), $2, $3, $4, $5, $6) }'
|
||||
return 0
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
. /lib/functions/fff/network
|
||||
. /lib/functions/system.sh
|
||||
|
||||
WANDEV=eth0
|
||||
SWITCHDEV=eth0
|
||||
|
@ -9,7 +9,7 @@ BATMAN_PORTS="0t"
|
|||
# use mac address from phy0 with 'locally administered' bit set to '1'
|
||||
# only possible, because wXmesh is created first and therefore gets the 'universally administered address'
|
||||
|
||||
ETHMESHMAC=$(macFlipLocalBit "$(cat /sys/class/ieee80211/phy0/macaddress)")
|
||||
ETHMESHMAC=$(macaddr_setbit_la "$(cat /sys/class/ieee80211/phy0/macaddress)")
|
||||
ROUTERMAC=$(cat /sys/class/net/eth0/address)
|
||||
|
||||
. /etc/network.mode
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
. /lib/functions/fff/network
|
||||
. /lib/functions/system.sh
|
||||
|
||||
WANDEV=eth0
|
||||
SWITCHDEV=eth0
|
||||
|
@ -9,7 +9,7 @@ BATMAN_PORTS="0t"
|
|||
# use mac address from phy0 with 'locally administered' bit set to '1'
|
||||
# only possible, because wXmesh is created first and therefore gets the 'universally administered address'
|
||||
|
||||
ETHMESHMAC=$(macFlipLocalBit "$(cat /sys/class/ieee80211/phy0/macaddress)")
|
||||
ETHMESHMAC=$(macaddr_setbit_la "$(cat /sys/class/ieee80211/phy0/macaddress)")
|
||||
ROUTERMAC=$(cat /sys/class/net/eth0/address)
|
||||
|
||||
. /etc/network.mode
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
. /lib/functions/fff/network
|
||||
. /lib/functions/system.sh
|
||||
|
||||
WANDEV=eth1
|
||||
SWITCHDEV=eth0
|
||||
|
@ -7,7 +7,7 @@ BATMAN_PORTS="0t"
|
|||
CLIENT_PORTS="0t"
|
||||
|
||||
ROUTERMAC=$(cat /sys/class/net/eth0/address)
|
||||
ETHMESHMAC="$(macFlipLocalBit "$ROUTERMAC")"
|
||||
ETHMESHMAC="$(macaddr_setbit_la "$ROUTERMAC")"
|
||||
|
||||
. /etc/network.mode
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
. /lib/functions/fff/network
|
||||
. /lib/functions/system.sh
|
||||
|
||||
WANDEV=eth0
|
||||
SWITCHDEV=eth0
|
||||
|
@ -9,5 +9,5 @@ BATMAN_PORTS="2 3 0t"
|
|||
# use mac address from phy1 with 'locally administered' bit set to '1'
|
||||
# only possible, because wXmesh is created first and therefore gets the 'universally administered address'
|
||||
|
||||
ETHMESHMAC=$(macFlipLocalBit "$(cat /sys/class/ieee80211/phy1/macaddress)")
|
||||
ETHMESHMAC=$(macaddr_setbit_la "$(cat /sys/class/ieee80211/phy1/macaddress)")
|
||||
ROUTERMAC=$(cat /sys/class/net/eth0/address)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
. /lib/functions/fff/network
|
||||
. /lib/functions/system.sh
|
||||
|
||||
WANDEV=eth0
|
||||
SWITCHDEV=eth0
|
||||
|
@ -9,5 +9,5 @@ BATMAN_PORTS="1 2 5t"
|
|||
# use mac address from phy0 with 'locally administered' bit set to '1'
|
||||
# only possible, because wXmesh is created first and therefore gets the 'universally administered address'
|
||||
|
||||
ETHMESHMAC=$(macFlipLocalBit "$(cat /sys/class/ieee80211/phy0/macaddress)")
|
||||
ETHMESHMAC=$(macaddr_setbit_la "$(cat /sys/class/ieee80211/phy0/macaddress)")
|
||||
ROUTERMAC=$(cat /sys/class/net/eth0/address)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
. /lib/functions/fff/network
|
||||
. /lib/functions/system.sh
|
||||
|
||||
WANDEV=eth0
|
||||
SWITCHDEV=eth0
|
||||
|
@ -7,4 +7,4 @@ WAN_PORTS="6t 4"
|
|||
BATMAN_PORTS="6t 2 3"
|
||||
|
||||
ROUTERMAC=$(cat /sys/class/net/eth0/address)
|
||||
ETHMESHMAC=$(macFlipLocalBit "$(cat /sys/class/net/eth0/address)")
|
||||
ETHMESHMAC=$(macaddr_setbit_la "$(cat /sys/class/net/eth0/address)")
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
. /lib/functions/fff/network
|
||||
. /lib/functions/system.sh
|
||||
|
||||
WANDEV=eth0
|
||||
SWITCHDEV=eth0
|
||||
|
@ -7,4 +7,4 @@ WAN_PORTS="6t 0"
|
|||
BATMAN_PORTS="6t 1 2"
|
||||
|
||||
ROUTERMAC=$(cat /sys/class/net/eth0/address)
|
||||
ETHMESHMAC=$(macFlipLocalBit "$(cat /sys/class/net/eth0/address)")
|
||||
ETHMESHMAC=$(macaddr_setbit_la "$(cat /sys/class/net/eth0/address)")
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
. /lib/functions/fff/network
|
||||
. /lib/functions/system.sh
|
||||
|
||||
WANDEV=eth0
|
||||
SWITCHDEV=eth0
|
||||
|
@ -7,4 +7,4 @@ WAN_PORTS="6t 0"
|
|||
BATMAN_PORTS="6t 1 2"
|
||||
|
||||
ROUTERMAC=$(cat /sys/class/net/eth0/address)
|
||||
ETHMESHMAC=$(macFlipLocalBit "$(cat /sys/class/net/eth0/address)")
|
||||
ETHMESHMAC=$(macaddr_setbit_la "$(cat /sys/class/net/eth0/address)")
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
. /lib/functions/fff/network
|
||||
. /lib/functions/system.sh
|
||||
|
||||
WANDEV=eth0
|
||||
SWITCHDEV=eth0
|
||||
|
@ -9,5 +9,5 @@ BATMAN_PORTS="0t 2 3"
|
|||
# use mac address from phy1 with 'locally administered' bit set to '1'
|
||||
# only possible, because wXmesh is created first and therefore gets the 'universally administered address'
|
||||
|
||||
ETHMESHMAC=$(macFlipLocalBit "$(cat /sys/class/ieee80211/phy1/macaddress)")
|
||||
ETHMESHMAC=$(macaddr_setbit_la "$(cat /sys/class/ieee80211/phy1/macaddress)")
|
||||
ROUTERMAC=$(cat /sys/class/net/eth0/address)
|
||||
|
|
Loading…
Reference in New Issue