lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 10 Mar 2008 02:16:31 +0100
From:	Roel Kluin <12o3l@...cali.nl>
To:	Paul Gortmaker <p_gortmaker@...oo.com>
CC:	jschlst@...ba.org, netdev@...r.kernel.org
Subject: Re: drivers/net/tokenring/smctr.c: logical-bitwise or confusion?

Paul Gortmaker wrote:
> --- Roel Kluin <12o3l@...cali.nl> wrote:
> 
>> drivers/net/tokenring/smctr.c:3416
>>
>> tsv->svv[0] = ((tx_fstatus & 0x0100 >> 6) || IBM_PASS_SOURCE_ADDR);
>>
>> shouldn't this be a bit-wise or?
>> from drivers/net/tokenring/smctr.h:50:
>>
>> #define      IBM_PASS_SOURCE_ADDR    0x01
> 
> Probably a safe bet that is what they meant to have. Since
> as it stands, gcc will (correctly) optimize that into:
> 
> tsv->svv[0]= 1;
> 
> which probably isn't particularly useful.
> 
> Paul.

That was what I was thinking as well.
---
logical-bitwise | confusion

Signed-off-by: Roel Kluin <12o3l@...cali.nl>
---
diff --git a/drivers/net/tokenring/smctr.c b/drivers/net/tokenring/smctr.c
index 8909050..8ae5837 100644
--- a/drivers/net/tokenring/smctr.c
+++ b/drivers/net/tokenring/smctr.c
@@ -3413,7 +3413,7 @@ static int smctr_make_tx_status_code(struct net_device *dev,
         tsv->svi = TRANSMIT_STATUS_CODE;
         tsv->svl = S_TRANSMIT_STATUS_CODE;
 
-        tsv->svv[0] = ((tx_fstatus & 0x0100 >> 6) || IBM_PASS_SOURCE_ADDR);
+        tsv->svv[0] = ((tx_fstatus & 0x0100 >> 6) | IBM_PASS_SOURCE_ADDR);
 
         /* Stripped frame status of Transmitted Frame */
         tsv->svv[1] = tx_fstatus & 0xff;
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ