Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(299)

Unified Diff: runtime/bin/socket_macos.cc

Issue 76383002: Update InternetAddress (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review commetns Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/socket_linux.cc ('k') | runtime/bin/socket_patch.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/socket_macos.cc
diff --git a/runtime/bin/socket_macos.cc b/runtime/bin/socket_macos.cc
index 4b6ead679101ec4dcb397fa0c340f5a688224f48..656837912d1abff72f67ccdd552a1cb4e28d8394 100644
--- a/runtime/bin/socket_macos.cc
+++ b/runtime/bin/socket_macos.cc
@@ -244,6 +244,18 @@ bool Socket::ReverseLookup(RawAddr addr,
}
+bool Socket::ParseAddress(int type, const char* address, RawAddr* addr) {
+ int result;
+ if (type == SocketAddress::TYPE_IPV4) {
+ result = inet_pton(AF_INET, address, &addr->in.sin_addr);
+ } else {
+ ASSERT(type == SocketAddress::TYPE_IPV6);
+ result = inet_pton(AF_INET6, address, &addr->in6.sin6_addr);
+ }
+ return result == 1;
+}
+
+
static bool ShouldIncludeIfaAddrs(struct ifaddrs* ifa, int lookup_family) {
if (ifa->ifa_addr == NULL) {
// OpenVPN's virtual device tun0.
« no previous file with comments | « runtime/bin/socket_linux.cc ('k') | runtime/bin/socket_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698