mailing list of musl libc
 help / color / mirror / code / Atom feed
427d92992412a7e0f3f375e99dcd0759e1a6299c blob 856 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
 
#include "lookup.h"

#include <arpa/inet.h>
#include <netinet/in.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <unistd.h>

void __lookup_addrconfig( struct addrconfig *cfg ) {
	int r;
	int fd;

	struct sockaddr_in sai = {
		.sin_family = AF_INET,
		.sin_port = htons( 42 ),
		.sin_addr.s_addr = INADDR_LOOPBACK,
	};
	cfg->af_inet = false;
	r = socket( AF_INET, SOCK_DGRAM, 0 );
	if ( -1 != r ) {
		fd = r;
		r = connect( fd, (struct sockaddr *) & sai, sizeof( sai ) );
		cfg->af_inet = 0 == r;
		close( fd );
	}

	struct sockaddr_in6 sai6 = {
		.sin6_family = AF_INET6,
		.sin6_port = htons( 42 ),
		.sin6_addr = IN6ADDR_LOOPBACK_INIT,
	};
	cfg->af_inet6 = false;
	r = socket( AF_INET6, SOCK_DGRAM, 0 );
	if ( -1 != r ) {
		fd = r;
		r = connect( fd, (struct sockaddr *) & sai6, sizeof( sai6 ) );
		cfg->af_inet6 = 0 == r;
		close( fd );
	}
}
debug log:

solving 427d9299 ...
found 427d9299 in https://inbox.vuxu.org/musl/20180711164417.GX1392@brightrain.aerifal.cx/

applying [1/1] https://inbox.vuxu.org/musl/20180711164417.GX1392@brightrain.aerifal.cx/
diff --git a/src/network/lookup_addrconfig.c b/src/network/lookup_addrconfig.c
new file mode 100644
index 00000000..427d9299

Checking patch src/network/lookup_addrconfig.c...
Applied patch src/network/lookup_addrconfig.c cleanly.

index at:
100644 427d92992412a7e0f3f375e99dcd0759e1a6299c	src/network/lookup_addrconfig.c

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).