Re: [Qemu-devel] [PULL 4/4] net: disallow to specify multicast MAC address

2013-10-22 Thread Dmitry Krivenok
This was my original intention, but I noticed that structs defined differently and standard one may be bigger depending on some #defines. So I renamed in6_addr to in6_address in include/net/eth.h (see v2 patch I sent yesterday). In case qemu version is not supposed to be a different struct, then yo

[Qemu-devel] [PATCH v2] net: disallow to specify multicast MAC address

2013-10-21 Thread Dmitry Krivenok
Changes to v1: 1) Resolved names clash in include/net/eth.h 2) Reused is_multicast_ether_addr() from that header for MAC check. Signed-off-by: Dmitry V. Krivenok --- include/net/eth.h | 6 +++--- net/net.c | 6 ++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/include

Re: [Qemu-devel] [PULL 4/4] net: disallow to specify multicast MAC address

2013-10-18 Thread Dmitry Krivenok
> Duplicate, we already have is_multicast_ether_addr() in include/net/eth.h I tried to #include "net/eth.h" in net/net.c, but it didn't work: diff --git a/net/net.c b/net/net.c index c330c9a..870d3bb 100644 --- a/net/net.c +++ b/net/net.c @@ -27,6 +27,7 @@ #include "clients.h" #include "hub.h"

Re: [Qemu-devel] [PULL 4/4] net: disallow to specify multicast MAC address

2013-10-18 Thread Dmitry Krivenok
> Scratch what I said about bit 0 and bit 1, this function is using '%' not > '&'. > > But we should still respin to use the existing function in eth.h. This is my first qemu patch, so sorry for inconsistent style and reinventing the wheel. I'll re-use existing function and send new patch. Thanks!

[Qemu-devel] [PATCH] net: disallow to specify multicast MAC address

2013-10-17 Thread Dmitry Krivenok
Added explicit check of MAC address specified via macaddr option. Multicast MAC addresses are no longer allowed. This fixes bug #495566. Signed-off-by: Dmitry V. Krivenok --- net/net.c | 5 + net/util.c | 5 + net/util.h | 2 ++ 3 files changed, 12 insertions(+) diff --git a/net/net.c

Re: [Qemu-devel] [PATCH] net: disallow to specify multicast MAC address

2013-10-17 Thread Dmitry Krivenok
> Personally, I find 'expr ? true : false' rather verbose; why not just: > > return macaddr[0] % 2; I agree, your variant is shorter and easier to read.

[Qemu-devel] [PATCH] net: disallow to specify multicast MAC address

2013-10-17 Thread Dmitry Krivenok
Added explicit check of MAC address specified via macaddr option. Multicast MAC addresses are no longer allowed. This fixes bug #495566. Signed-off-by: Dmitry V. Krivenok --- net/net.c | 5 + net/util.c | 5 + net/util.h | 2 ++ 3 files changed, 12 insertions(+) diff --git a/net/net.c