lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 20 Jun 2014 15:48:56 +0000
From:	Haiyang Zhang <haiyangz@...rosoft.com>
To:	Dan Carpenter <dan.carpenter@...cle.com>
CC:	"davem@...emloft.net" <davem@...emloft.net>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	"olaf@...fle.de" <olaf@...fle.de>,
	"jasowang@...hat.com" <jasowang@...hat.com>,
	"driverdev-devel@...uxdriverproject.org" 
	<driverdev-devel@...uxdriverproject.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH net-next] hyperv: Add handler for
 RNDIS_STATUS_NETWORK_CHANGE event



> -----Original Message-----
> From: Dan Carpenter [mailto:dan.carpenter@...cle.com]
> Sent: Friday, June 20, 2014 4:42 AM
> To: Haiyang Zhang
> Cc: davem@...emloft.net; netdev@...r.kernel.org; olaf@...fle.de;
> jasowang@...hat.com; driverdev-devel@...uxdriverproject.org; linux-
> kernel@...r.kernel.org
> Subject: Re: [PATCH net-next] hyperv: Add handler for
> RNDIS_STATUS_NETWORK_CHANGE event
> 
> On Thu, Jun 19, 2014 at 06:34:36PM -0700, Haiyang Zhang wrote:
> > @@ -589,7 +590,19 @@ void netvsc_linkstatus_callback(struct hv_device
> *device_obj,
> >  	net_device = hv_get_drvdata(device_obj);
> >  	rdev = net_device->extension;
> >
> > -	rdev->link_state = status != 1;
> > +	switch (indicate->status) {
> > +	case RNDIS_STATUS_MEDIA_CONNECT:
> > +		rdev->link_state = false;
> 
> link_state false means that we want to connect?
Yes

> 
> > +		break;
> > +	case RNDIS_STATUS_MEDIA_DISCONNECT:
> > +		rdev->link_state = true;
> 
> link_state true means that we are disconnecting.
Yes.

> > @@ -782,10 +797,17 @@ static void netvsc_link_change(struct
> work_struct *w)
> >  	} else {
> >  		netif_carrier_on(net);
> >  		notify = true;
> > +		if (rdev->link_change) {
> > +			rdev->link_change = false;
> > +			refresh = true;
> > +		}
> 
> How do we know that we received a RNDIS_STATUS_MEDIA_CONNECT before we
> received the RNDIS_STATUS_NETWORK_CHANGE?  In other words, why does
> RNDIS_STATUS_NETWORK_CHANGE imply that the link_state is false?

After host sleep, both RNDIS_STATUS_MEDIA_CONNECT and 
RNDIS_STATUS_NETWORK_CHANGE events are received, but not necessarily in
this order. If RNDIS_STATUS_MEDIA_CONNECT arrives later, the flag saved
in rdev->link_change previously will trigger the refresh, not in the
RNDIS_STATUS_NETWORK_CHANGE event, but in the latter RNDIS_STATUS_MEDIA_CONNECT
event.

> 
> >  	}
> >
> >  	rtnl_unlock();
> >
> > +	if (refresh)
> > +		call_usermodehelper(argv[0], argv, envp, UMH_WAIT_EXEC);
> 
> You may as well use UMH_NO_WAIT since there is no error handling if
> /etc/init.d/network is not found.

I previously tried UMH_NO_WAIT, but not working. We need to wait for the 
exec (not process completion) in this case. Since it's in the work queue,
a bit of waiting is OK.

Thanks,
- Haiyang


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ