bug-hurd
[Top][All Lists]
Advanced

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

Re: The patch of gnumach to enable the user to set the network device in


From: zhengda
Subject: Re: The patch of gnumach to enable the user to set the network device into the promiscuous mode
Date: Sun, 10 Aug 2008 20:24:07 +0200
User-agent: Thunderbird 2.0.0.16 (X11/20080707)

Samuel Thibault wrote:
On Fri, Aug 8, 2008 at 9:33 PM, Samuel Thibault <samuel.thibault@ens-lyon.org>
wrote:
    zhengda, le Fri 08 Aug 2008 06:44:16 +0200, a écrit :
    > +    dev->flags = (flags &
    > +            (IFF_BROADCAST | IFF_DEBUG | IFF_LOOPBACK |
    > +             IFF_POINTOPOINT | IFF_NOTRAILERS | IFF_RUNNING |
    > +             IFF_NOARP | IFF_PROMISC | IFF_ALLMULTI | IFF_SLAVE
    > +             | IFF_MASTER | IFF_MULTICAST))
    > +        | (dev->flags & (IFF_SOFTHEADERS|IFF_UP));

I had a look in if_hdr.h, there's a IFF_CANTCHANGE macro, which includes
BROADCAST, POINTOPOINT and RUNNING, shouldn't at least these be excluded
from set_flags then?  When I look at the corresponding nowaday's linux
code:

        dev->flags = (flags & (IFF_DEBUG | IFF_NOTRAILERS | IFF_NOARP |
                               IFF_DYNAMIC | IFF_MULTICAST | IFF_PORTSEL |
                               IFF_AUTOMEDIA)) |
                     (dev->flags & (IFF_UP | IFF_VOLATILE | IFF_PROMISC |
                                    IFF_ALLMULTI));
        ...
        (plus IFF_UP, IFF_PROMISC and IFF_ALLMULTI which are handled
        separately)

it looks so.
I don't know.
look at the code in gnumach/linux/dev/net/core/dev.c (in line 1130):
               dev->flags = (ifr.ifr_flags & (
                   IFF_BROADCAST | IFF_DEBUG | IFF_LOOPBACK |
                   IFF_POINTOPOINT | IFF_NOTRAILERS | IFF_RUNNING |
IFF_NOARP | IFF_PROMISC | IFF_ALLMULTI | IFF_SLAVE | IFF_MASTER | IFF_MULTICAST)) | (dev->flags & (IFF_SOFTHEADERS|IFF_UP));
I think the person who wrote the patch copied the code from here.
but maybe you're right.

Zheng Da




reply via email to

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