[Top][All Lists]

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

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

From: Or Gerlitz
Subject: Re: [Qemu-devel] [PATCH] net: add raw backend
Date: Tue, 07 Jul 2009 17:45:39 +0300
User-agent: Thunderbird (X11/20081209)

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"?

>> @@ -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

>> +    "-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


>> +    "                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?



reply via email to

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