[haiku-commits] haiku: hrev53582 - src/servers/net

  • From: Axel Dörfler <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Thu, 21 Nov 2019 02:08:10 -0500 (EST)

hrev53582 adds 1 changeset to branch 'master'
old head: f1271b6454e45ea7081146438391a56b8fe8f527
new head: b240f0ad50b9138fa1a9e5c4022cc0c989769005
overview: 
https://git.haiku-os.org/haiku/log/?qt=range&q=b240f0ad50b9+%5Ef1271b6454e4

----------------------------------------------------------------------------

b240f0ad50b9: net_server: Fixed overwriting wrong interface config
  
  * When the "interfaces" file contains a configuration for a missing
    device, the first interface found would be overwritten, irregardless
    of its status.
  * Now, _ConfigureDevices() properly honours the
    "devicesAlreadyConfigured" list.
  * This fixes bug #14908.

                                   [ Axel Dörfler <axeld@xxxxxxxxxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev53582
Commit:      b240f0ad50b9138fa1a9e5c4022cc0c989769005
URL:         https://git.haiku-os.org/haiku/commit/?id=b240f0ad50b9
Author:      Axel Dörfler <axeld@xxxxxxxxxxxxxxxx>
Date:        Wed Nov 20 20:02:49 2019 UTC

Ticket:      https://dev.haiku-os.org/ticket/14908

----------------------------------------------------------------------------

1 file changed, 4 insertions(+), 3 deletions(-)
src/servers/net/NetServer.cpp | 7 ++++---

----------------------------------------------------------------------------

diff --git a/src/servers/net/NetServer.cpp b/src/servers/net/NetServer.cpp
index bd32a69730..6e5eb82160 100644
--- a/src/servers/net/NetServer.cpp
+++ b/src/servers/net/NetServer.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006-2018, Haiku, Inc. All Rights Reserved.
+ * Copyright 2006-2019, Haiku, Inc. All Rights Reserved.
  * Distributed under the terms of the MIT License.
  *
  * Authors:
@@ -731,7 +731,8 @@ NetServer::_ConfigureDevices(const char* startPath,
                BPath path;
                if (entry.GetName(name) != B_OK
                        || entry.GetPath(&path) != B_OK
-                       || entry.GetStat(&stat) != B_OK)
+                       || entry.GetStat(&stat) != B_OK
+                       || devicesAlreadyConfigured.HasString(path.Path()))
                        continue;
 
                if (S_ISBLK(stat.st_mode) || S_ISCHR(stat.st_mode)) {
@@ -739,7 +740,7 @@ NetServer::_ConfigureDevices(const char* startPath,
                                && suggestedInterface->SetString("device", 
path.Path()) == B_OK
                                && _ConfigureInterface(*suggestedInterface) == 
B_OK)
                                suggestedInterface = NULL;
-                       else if 
(!devicesAlreadyConfigured.HasString(path.Path()))
+                       else
                                _ConfigureDevice(path.Path());
                } else if (entry.IsDirectory()) {
                        _ConfigureDevices(path.Path(), devicesAlreadyConfigured,


Other related posts:

  • » [haiku-commits] haiku: hrev53582 - src/servers/net - Axel Dörfler