View | Details | Raw Unified | Return to bug 251725 | Differences between
and this patch

Collapse All | Expand All

(-)b/sbin/ping/main.c (-9 / +15 lines)
Lines 126-140 main(int argc, char *argv[]) Link Here
126
	else if (ipv4)
126
	else if (ipv4)
127
		hints.ai_family = AF_INET;
127
		hints.ai_family = AF_INET;
128
	else {
128
	else {
129
		struct addrinfo *res;
129
		if (!feature_present("inet6"))
130
130
			hints.ai_family = AF_INET;
131
		memset(&hints, 0, sizeof(hints));
131
		else if (!feature_present("inet"))
132
		hints.ai_socktype = SOCK_RAW;
132
			hints.ai_family = AF_INET6;
133
		hints.ai_family = AF_UNSPEC;
133
		else {
134
		getaddrinfo(argv[argc - 1], NULL, &hints, &res);
134
			struct addrinfo *res;
135
		if (res != NULL) {
135
136
			hints.ai_family = res[0].ai_family;
136
			memset(&hints, 0, sizeof(hints));
137
			freeaddrinfo(res);
137
			hints.ai_socktype = SOCK_RAW;
138
			hints.ai_family = AF_UNSPEC;
139
			getaddrinfo(argv[argc - 1], NULL, &hints, &res);
140
			if (res != NULL) {
141
				hints.ai_family = res[0].ai_family;
142
				freeaddrinfo(res);
143
			}
138
		}
144
		}
139
	}
145
	}
140
#elif defined(INET)
146
#elif defined(INET)

Return to bug 251725