2011-04-21 08:22:53 -06:00
|
|
|
// Copyright 2011 The Go Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
2014-07-08 11:42:14 -06:00
|
|
|
// +build !android,cgo,!netgo
|
2013-06-10 12:55:16 -06:00
|
|
|
|
2011-04-21 08:22:53 -06:00
|
|
|
package net
|
|
|
|
|
|
|
|
/*
|
|
|
|
#include <netdb.h>
|
|
|
|
*/
|
|
|
|
import "C"
|
|
|
|
|
2015-04-17 02:56:58 -06:00
|
|
|
// NOTE(rsc): In theory there are approximately balanced
|
|
|
|
// arguments for and against including AI_ADDRCONFIG
|
|
|
|
// in the flags (it includes IPv4 results only on IPv4 systems,
|
|
|
|
// and similarly for IPv6), but in practice setting it causes
|
|
|
|
// getaddrinfo to return the wrong canonical name on Linux.
|
|
|
|
// So definitely leave it out.
|
|
|
|
const cgoAddrInfoFlags = C.AI_CANONNAME | C.AI_V4MAPPED | C.AI_ALL
|