Thread (11 messages) flat view 11 messages, 4 authors, 2012-05-08

Re: [PATCH] net: compare_ether_addr[_64bits]() has no ordering

From: Eric Dumazet <hidden>
Date: 2012-05-07 13:53:34

On Mon, 2012-05-07 at 15:39 +0200, Johannes Berg wrote:
From: Johannes Berg <redacted>

Neither compare_ether_addr() nor compare_ether_addr_64bits()
(as it can fall back to the former) have comparison semantics
like memcmp() where the sign of the return value indicates sort
order. We had a bug in the wireless code due to a blind memcmp
replacement because of this.

A cursory look suggests that the wireless bug was the only one
due to this semantic difference.

Signed-off-by: Johannes Berg <redacted>
---
 include/linux/etherdevice.h |   11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
The right way to avoid this kind of problems is to change these
functions to return a bool
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help