* [PATCH] lguest: two net bugfixes
@ 2007-05-08 11:22 Rusty Russell
2007-05-08 13:17 ` James Morris
0 siblings, 1 reply; 2+ messages in thread
From: Rusty Russell @ 2007-05-08 11:22 UTC (permalink / raw)
To: Andrew Morton; +Cc: lkml - Kernel Mailing List, virtualization
1) Bridging via host is broken: we need to set "promisc" bit in MAC
address published by the host so the guest sends us everything.
Thanks James Morris for the report (I don't use bridging).
2) Lguest network device uses 0 to mean "noone at this slot". It used to
use 0xFF, and one spot was missed. Minor: it just means we'll have a
useless extra transmit for broadcast packets.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
---
Documentation/lguest/lguest.c | 2 ++
drivers/net/lguest_net.c | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
diff -r 999a9058a151 Documentation/lguest/lguest.c
--- a/Documentation/lguest/lguest.c Tue May 08 19:49:33 2007 +1000
+++ b/Documentation/lguest/lguest.c Tue May 08 21:04:51 2007 +1000
@@ -860,6 +860,10 @@ static void setup_tun_net(const char *ar
/* We are peer 0, ie. first slot. */
configure_device(ipfd, ifr.ifr_name, ip, dev->mem);
+
+ /* Set "promisc" bit: we want every single packet. */
+ *((u8 *)dev->mem) |= 0x1;
+
close(ipfd);
verbose("device %p: tun net %u.%u.%u.%u\n",
diff -r 999a9058a151 drivers/net/lguest_net.c
--- a/drivers/net/lguest_net.c Tue May 08 19:49:33 2007 +1000
+++ b/drivers/net/lguest_net.c Tue May 08 21:03:47 2007 +1000
@@ -249,7 +249,7 @@ static int lguestnet_close(struct net_de
struct lguestnet_info *info = dev->priv;
/* Clear all trace: others might deliver packets, we'll ignore it. */
- memset(&info->peer[info->me], 0xFF, sizeof(info->peer[info->me]));
+ memset(&info->peer[info->me], 0, sizeof(info->peer[info->me]));
/* Deregister sg lists. */
hcall(LHCALL_BIND_DMA, peer_key(info, info->me), __pa(info->dma), 0);
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] lguest: two net bugfixes
2007-05-08 11:22 [PATCH] lguest: two net bugfixes Rusty Russell
@ 2007-05-08 13:17 ` James Morris
0 siblings, 0 replies; 2+ messages in thread
From: James Morris @ 2007-05-08 13:17 UTC (permalink / raw)
To: Rusty Russell; +Cc: Andrew Morton, lkml - Kernel Mailing List, virtualization
On Tue, 8 May 2007, Rusty Russell wrote:
> 1) Bridging via host is broken: we need to set "promisc" bit in MAC
> address published by the host so the guest sends us everything.
> Thanks James Morris for the report (I don't use bridging).
>
> 2) Lguest network device uses 0 to mean "noone at this slot". It used to
> use 0xFF, and one spot was missed. Minor: it just means we'll have a
> useless extra transmit for broadcast packets.
>
> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Acked-by: James Morris <jmorris@namei.org>
> ---
> Documentation/lguest/lguest.c | 2 ++
> drivers/net/lguest_net.c | 2 +-
> 2 files changed, 3 insertions(+), 1 deletion(-)
>
> diff -r 999a9058a151 Documentation/lguest/lguest.c
> --- a/Documentation/lguest/lguest.c Tue May 08 19:49:33 2007 +1000
> +++ b/Documentation/lguest/lguest.c Tue May 08 21:04:51 2007 +1000
> @@ -860,6 +860,10 @@ static void setup_tun_net(const char *ar
>
> /* We are peer 0, ie. first slot. */
> configure_device(ipfd, ifr.ifr_name, ip, dev->mem);
> +
> + /* Set "promisc" bit: we want every single packet. */
> + *((u8 *)dev->mem) |= 0x1;
> +
> close(ipfd);
>
> verbose("device %p: tun net %u.%u.%u.%u\n",
> diff -r 999a9058a151 drivers/net/lguest_net.c
> --- a/drivers/net/lguest_net.c Tue May 08 19:49:33 2007 +1000
> +++ b/drivers/net/lguest_net.c Tue May 08 21:03:47 2007 +1000
> @@ -249,7 +249,7 @@ static int lguestnet_close(struct net_de
> struct lguestnet_info *info = dev->priv;
>
> /* Clear all trace: others might deliver packets, we'll ignore it. */
> - memset(&info->peer[info->me], 0xFF, sizeof(info->peer[info->me]));
> + memset(&info->peer[info->me], 0, sizeof(info->peer[info->me]));
>
> /* Deregister sg lists. */
> hcall(LHCALL_BIND_DMA, peer_key(info, info->me), __pa(info->dma), 0);
>
>
>
--
James Morris
<jmorris@namei.org>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-05-08 13:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-08 11:22 [PATCH] lguest: two net bugfixes Rusty Russell
2007-05-08 13:17 ` James Morris
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).