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

  • From: Adrien Destugues <pulkomandy@xxxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 21 Dec 2018 03:30:29 -0500 (EST)

hrev52671 adds 1 changeset to branch 'master'
old head: a0efb75a5cd8942c574cba7aab924e11a62e5ff4
new head: 949a1ff7cc91f8404c1a60e3f4dca52b6708970e
overview: 
https://git.haiku-os.org/haiku/log/?qt=range&q=949a1ff7cc91+%5Ea0efb75a5cd8

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

949a1ff7cc91: net_server: Documented suggested interface behavior
  
  * Also simplified updating the interface message with SetString().
  
  Change-Id: I29635cba5ddde693f6b7b97b8bd01769b02919d5
  Reviewed-on: https://review.haiku-os.org/788
  Reviewed-by: waddlesplash <waddlesplash@xxxxxxxxx>

                                   [ Axel Dörfler <axeld@xxxxxxxxxxxxxxxx> ]

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

Revision:    hrev52671
Commit:      949a1ff7cc91f8404c1a60e3f4dca52b6708970e
URL:         https://git.haiku-os.org/haiku/commit/?id=949a1ff7cc91
Author:      Axel Dörfler <axeld@xxxxxxxxxxxxxxxx>
Date:        Wed Dec 19 16:40:14 2018 UTC
Committer:   Adrien Destugues <pulkomandy@xxxxxxxxxxxxx>
Commit-Date: Fri Dec 21 08:30:25 2018 UTC

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

1 file changed, 9 insertions(+), 2 deletions(-)
src/servers/net/NetServer.cpp | 11 +++++++++--

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

diff --git a/src/servers/net/NetServer.cpp b/src/servers/net/NetServer.cpp
index 323fe3bd74..c86180fbf4 100644
--- a/src/servers/net/NetServer.cpp
+++ b/src/servers/net/NetServer.cpp
@@ -666,6 +666,14 @@ NetServer::_ConfigureDevice(const char* device)
 }
 
 
+/*! \brief Traverses the device tree starting from \a startPath, and configures
+               everything that has not yet been configured via settings before.
+
+       \param suggestedInterface Contains the configuration of an interface 
that
+               does not have any hardware left. It is used to configure the 
first
+               unconfigured device. This allows to move a Haiku configuration 
around
+               without losing the network configuration.
+*/
 void
 NetServer::_ConfigureDevices(const char* startPath,
        BStringList& devicesAlreadyConfigured, BMessage* suggestedInterface)
@@ -683,8 +691,7 @@ NetServer::_ConfigureDevices(const char* startPath,
 
                if (S_ISBLK(stat.st_mode) || S_ISCHR(stat.st_mode)) {
                        if (suggestedInterface != NULL
-                               && suggestedInterface->RemoveName("device") == 
B_OK
-                               && suggestedInterface->AddString("device", 
path.Path()) == B_OK
+                               && suggestedInterface->SetString("device", 
path.Path()) == B_OK
                                && _ConfigureInterface(*suggestedInterface) == 
B_OK)
                                suggestedInterface = NULL;
                        else if 
(!devicesAlreadyConfigured.HasString(path.Path()))


Other related posts:

  • » [haiku-commits] haiku: hrev52671 - src/servers/net - Adrien Destugues