<html>
<head>
</head>
<body class='hmmessage'><div dir='ltr'>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style>
<div dir="ltr">Hi Alvaro:<br><br>> Date: Sat, 18 Oct 2014 13:55:39 +0200<br><div>> From: noltari@gmail.com<br>> To: openwrt-devel@lists.openwrt.org; hauke@hauke-m.de; blogic@openwrt.org; nbd@openwrt.org<br>> Subject: [OpenWrt-Devel] [PATCH v4] brcm-wl: fix bash comparison error<br>> <br>> wlc returns a string number ending with "\n", making it impossible to compare this value to a number.<br>> <br>> Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com><br>> ---<br>> v4: remove bashishm as suggested by Bastian Bittorf.<br>> v3: avoid using an extra variable.<br>> v2: use string comparison<br>> <br>> diff --git a/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh b/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh<br>> index 69e3132..5994e26 100644<br>> --- a/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh<br>> +++ b/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh<br>> @@ -209,7 +209,7 @@ enable_broadcom() {<br>> }<br>> <br>> local leddc=$(wlc ifname "$device" leddc)<br>> - [ "$leddc" -eq 0xffff ] || {<br>> + [ "$leddc" = '0xffff\n' ] || {<br>> leddc=0x005a000a;<br>> }<br>Using the "\n" is not correct. I think the real problem is that the logic is reversed (should be && instead of ||); although it might<br>be better to eliminate the conditional entirely since leddc is always commanded to "0xffff" when the interface is taken down.<br><br>local leddc=$(wlc ifname "$device" leddc)<br>[ "$leddc" = "0xffff" ] && {<br> leddc=0x005a000a<br>}<br><br>Nathan<br><br>> <br>> _______________________________________________<br>> openwrt-devel mailing list<br>> openwrt-devel@lists.openwrt.org<br>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel<br></div></div>
</div></body>
</html>