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

  • From: kallisti5@xxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 8 Feb 2012 01:10:42 +0100 (CET)

hrev43722 adds 1 changeset to branch 'master'
old head: dd7f08b519348fc0fb96ec52f841cd09e40da8b8
new head: 8b371b91e441655a541d256be048962f22b296fa

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

8b371b9: NetServer: Prevent duplicate v6 link local addresses
  
  * Check to ensure the address doesn't already exist on card
  * In the future we will want to check interface address flags
    for any local scoped addresses on a card.

                          [ Alexander von Gluck IV <kallisti5@xxxxxxxxxxx> ]

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

Revision:    hrev43722
Commit:      8b371b91e441655a541d256be048962f22b296fa
URL:         http://cgit.haiku-os.org/haiku/commit/?id=8b371b9
Author:      Alexander von Gluck IV <kallisti5@xxxxxxxxxxx>
Date:        Wed Feb  8 00:14:21 2012 UTC

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

1 files changed, 11 insertions(+), 0 deletions(-)
src/servers/net/NetServer.cpp |   11 +++++++++++

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

diff --git a/src/servers/net/NetServer.cpp b/src/servers/net/NetServer.cpp
index 7b59ec4..000bec7 100644
--- a/src/servers/net/NetServer.cpp
+++ b/src/servers/net/NetServer.cpp
@@ -911,6 +911,17 @@ NetServer::_ConfigureIPv6LinkLocal(const char* name)
        BNetworkAddress localLinkMask("ffff:ffff:ffff:ffff::"); // 64
        BNetworkAddress localLinkBroadcast("fe80::ffff:ffff:ffff:ffff");
 
+       if (interface.FindAddress(localLinkAddress) >= 0) {
+               // uhoh... already has a local link address
+
+               /*      TODO: Check for any local link scope addresses assigned 
to card
+                       There isn't any flag at the moment though for address 
scope
+               */
+               syslog(LOG_DEBUG, "%s: Local Link address already assigned to 
%s\n",
+                       __func__, name);
+               return;
+       }
+
        BNetworkInterfaceAddress interfaceAddress;
        interfaceAddress.SetAddress(localLinkAddress);
        interfaceAddress.SetMask(localLinkMask);


Other related posts:

  • » [haiku-commits] haiku: hrev43722 - src/servers/net - kallisti5