qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] net: add raw backend


From: Michael S. Tsirkin
Subject: Re: [Qemu-devel] [PATCH] net: add raw backend
Date: Tue, 7 Jul 2009 17:49:32 +0300
User-agent: Mutt/1.5.19 (2009-01-05)

On Tue, Jul 07, 2009 at 05:45:39PM +0300, Or Gerlitz wrote:
> Michael S. Tsirkin wrote:
> >> +static void raw_send(void *opaque)
> >> +  do {
> >> +          size = recv(s->fd, s->buf, sizeof(s->buf), MSG_TRUNC);
> >> +          if (size <= 0)
> >> +                  break;
>  
> > A couple of improvement suggestions here:
> > - You might get size > sizeof(s->buf). Should not happen, but you might 
> > want to 
> >   check for this condition and report it + discard the packet.
> 
> okay, will do
> 
> > - It might be a good idea to request aux data and verify that checksum is 
> > set, 
> >   calculate it if not. this will make it possible to bind to a local device 
> > as well.
> 
> thanks for the heads up, I am still not sure to follow the 
> documentation/logic wrt to checksum reporting of the af_packet kernel code. 
> I'll look on this. What do you mean by "this will make it possible to bind to 
> a local device as well"?

See comment in qemu-kvm about dhclient as an example.

> >> @@ -2348,6 +2500,41 @@ int net_client_init(Monitor *mon, const char 
> >> *device, const char *p)
> >> +    if (!strcmp(device, "raw")) {
> >> +        int promisc = 1;
>  
> > promisc = 0 might be a safer default
> 
> I can do that, but I am not sure why its safer, e.g bridge always set all 
> interfaces to promisc

Think of what happens if someone does kill -9 on qemu
This can not happen with bridge.

> >> +    "-net raw[,vlan=n][,name=str],ifname=name[,promisc=m]\n"
> >> +    "                bound the host network interface to VLAN 'n' in a 
> >> raw manner:\n"
> 
> > in a raw manner -> using a raw packet socket
> 
> okay
> 
> >> +    "                packets received on the interface are delivered to 
> >> the vlan and\n"
> >> +    "                packets delivered on the vlan are sent to the 
> >> interface\n"
> 
> > document promisc option?
> 
> sure
> 
> 
> Or.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]