You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2013/08/30 18:20:47 UTC

[34/50] git commit: TS-2160: Remove use of ats_is_ip_nonroutable and replace with ats_is_ip_linklocal and ats_is_ip_private.

TS-2160: Remove use of ats_is_ip_nonroutable and replace with
ats_is_ip_linklocal and ats_is_ip_private.


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/3c78ec9a
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/3c78ec9a
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/3c78ec9a

Branch: refs/heads/5.0.x
Commit: 3c78ec9a6161aa46bec14628fc048f6c9f25a78f
Parents: bf34ca0
Author: Phil Sorber <so...@apache.org>
Authored: Mon Aug 26 21:24:18 2013 -0600
Committer: Phil Sorber <so...@apache.org>
Committed: Mon Aug 26 21:24:18 2013 -0600

----------------------------------------------------------------------
 iocore/utils/Machine.cc | 10 ++++++----
 lib/ts/ink_inet.cc      | 10 ++++++----
 2 files changed, 12 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/3c78ec9a/iocore/utils/Machine.cc
----------------------------------------------------------------------
diff --git a/iocore/utils/Machine.cc b/iocore/utils/Machine.cc
index 3e555e4..fdc089c 100644
--- a/iocore/utils/Machine.cc
+++ b/iocore/utils/Machine.cc
@@ -99,9 +99,10 @@ Machine::Machine(char const* the_hostname, sockaddr const* addr)
       enum {
         NA, // Not an (IP) Address.
         LO, // Loopback.
-        NR, // Non-Routable.
+        LL, // Link Local
+        PR, // Private.
         MC, // Multicast.
-        GA  // Globally unique Address.
+        GL  // Global.
       } spot_type = NA, ip4_type = NA, ip6_type = NA;
       sockaddr const* ifip;
       for (
@@ -119,9 +120,10 @@ Machine::Machine(char const* the_hostname, sockaddr const* addr)
 
         if (!ats_is_ip(ifip)) spot_type = NA;
         else if (ats_is_ip_loopback(ifip)) spot_type = LO;
-        else if (ats_is_ip_nonroutable(ifip)) spot_type = NR;
+        else if (ats_is_ip_linklocal(ifip)) spot_type = LL;
+        else if (ats_is_ip_private(ifip)) spot_type = PR;
         else if (ats_is_ip_multicast(ifip)) spot_type = MC;
-        else spot_type = GA;
+        else spot_type = GL;
 
         if (spot_type == NA) continue; // Next!
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/3c78ec9a/lib/ts/ink_inet.cc
----------------------------------------------------------------------
diff --git a/lib/ts/ink_inet.cc b/lib/ts/ink_inet.cc
index 8948b91..7ec7c6a 100644
--- a/lib/ts/ink_inet.cc
+++ b/lib/ts/ink_inet.cc
@@ -401,9 +401,10 @@ ats_ip_getbestaddrinfo(char const* host,
       enum {
         NA, // Not an (IP) Address.
         LO, // Loopback.
+        LL, // Link Local.
+        PR, // Private.
         MC, // Multicast.
-        NR, // Non-Routable.
-        GA  // Globally unique Address.
+        GL  // Global.
       } spot_type = NA, ip4_type = NA, ip6_type = NA;
       sockaddr const* ip4_src = 0;
       sockaddr const* ip6_src = 0;
@@ -415,9 +416,10 @@ ats_ip_getbestaddrinfo(char const* host,
         sockaddr const* ai_ip = ai_spot->ai_addr;
         if (!ats_is_ip(ai_ip)) spot_type = NA;
         else if (ats_is_ip_loopback(ai_ip)) spot_type = LO;
-        else if (ats_is_ip_nonroutable(ai_ip)) spot_type = NR;
+        else if (ats_is_ip_linklocal(ai_ip)) spot_type = LL;
+        else if (ats_is_ip_private(ai_ip)) spot_type = PR;
         else if (ats_is_ip_multicast(ai_ip)) spot_type = MC;
-        else spot_type = GA;
+        else spot_type = GL;
         
         if (spot_type == NA) continue; // Next!