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-next>] [day] [month] [year] [list]
Date:	Wed, 24 Sep 2008 14:20:55 -0700
From:	Trent Piepho <tpiepho@...escale.com>
To:	netdev@...r.kernel.org
Cc:	Trent Piepho <tpiepho@...escale.com>,
	Andy Fleming <afleming@...escale.com>
Subject: [PATCH 7/9] [ETH]: Start net device with carrier down

Because it _is_ down when the device starts.

The device's carrier status is controlled via the functions
netif_carrier_on() and netif_carrier_off().  These set or clear a bit
indicating the lower level link aka carrier is down, and if the state
changed, they fire off a routing netlink event.

The problem is that when the device is first created and opened, the state
bit indicating the carrier is down isn't set, i.e. the state is wrong.
When the carrier comes up for the first time no netlink event is sent,
since the device state indicated the carrier was already up.

Signed-off-by: Trent Piepho <tpiepho@...escale.com>
CC: Andy Fleming <afleming@...escale.com>
---
 net/ethernet/eth.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c
index a80839b..cdba6d0 100644
--- a/net/ethernet/eth.c
+++ b/net/ethernet/eth.c
@@ -333,6 +333,7 @@ void ether_setup(struct net_device *dev)
 	dev->addr_len		= ETH_ALEN;
 	dev->tx_queue_len	= 1000;	/* Ethernet wants good queues */
 	dev->flags		= IFF_BROADCAST|IFF_MULTICAST;
+	dev->state		= 1 << __LINK_STATE_NOCARRIER;
 
 	memset(dev->broadcast, 0xFF, ETH_ALEN);
 
-- 
1.5.4.1

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