From ed18d7cf71f7dea3256e652d1826da9221f64724 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Tue, 17 Aug 2010 11:45:26 +0000 Subject: [PATCH] * Initialized the domain_datalink's first_{protocol|info} members. This fixes the crashing bug reported by Atis when trying to add an interface which fails (the bug causing this has already been fixed with the previous commit). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38180 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/kernel/network/stack/interfaces.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/add-ons/kernel/network/stack/interfaces.cpp b/src/add-ons/kernel/network/stack/interfaces.cpp index cb877fbfce..f6ae524f1b 100644 --- a/src/add-ons/kernel/network/stack/interfaces.cpp +++ b/src/add-ons/kernel/network/stack/interfaces.cpp @@ -904,6 +904,8 @@ Interface::SetDown() void Interface::WentDown() { + TRACE("Interface %p: went down\n", this); + RecursiveLocker locker(fLock); AddressList::Iterator iterator = fAddresses.GetIterator(); @@ -928,6 +930,8 @@ Interface::CreateDomainDatalinkIfNeeded(net_domain* domain) if (datalink == NULL) return B_NO_MEMORY; + datalink->first_protocol = NULL; + datalink->first_info = NULL; datalink->domain = domain; // setup direct route for bound devices @@ -987,6 +991,7 @@ Interface::Dump() const kprintf("type: %u\n", type); kprintf("mtu: %" B_PRIu32 "\n", mtu); kprintf("metric: %" B_PRIu32 "\n", metric); + kprintf("ref count: %" B_PRId32 "\n", CountReferences()); kprintf("datalink protocols:\n");