On Wed, Aug 17, 2016 at 9:54 PM, Benoit Canet <
benoit.canet.cont...@gmail.com> wrote:

> Signed-of-by: BenoÃt Canet <ben...@scylladb.com>
> ---
>  bsd/porting/networking.cc | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/bsd/porting/networking.cc b/bsd/porting/networking.cc
> index 1af0ecc..92a423f 100644
> --- a/bsd/porting/networking.cc
> +++ b/bsd/porting/networking.cc
> @@ -135,7 +135,7 @@ int ifup(std::string if_name)
>      // FIXME: SIOCGIFFLAGS returns IFF_UP for some reason for virtio-net0
>      // on the first call to osv_ifup(), this should be investigated
>
> -    ifr.ifr_flags |= IFF_UP;
> +    ifr.ifr_flags |= IFF_UP | IFF_DRV_RUNNING;
>      error = ifioctl(NULL, SIOCSIFFLAGS, (caddr_t)&ifr, NULL);
>

Hi Benoit, why was this change necesary?

We call here SIOCSIFFLAGS, and looking at the implementation of this ioctl
in drivers/virtio-net.cc, drivers/vmxnet3.cc,  bsd/sys/net/if_loop.cc it
always set IFF_DRV_RUNNING (if IFF_UP is set).
The only exception I can see is bsd/sys/dev/xen/netfront/netfront.cc where
if I understand correctly, this logic is missing. did you have this problem
on Xen?

Should we perhaps fix the Xen code instead of changing the default
ifr_flags like you did?

What worries me is that your change only changes the default flags when an
interface is created - and doesn't change what happens when an interface is
brought up and down with the ioctls (not with osv::ifup() which you
changed).



>      return (error);
>  }
> --
> 2.7.4
>
> --
> You received this message because you are subscribed to the Google Groups
> "OSv Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to osv-dev+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to