View | Details | Raw Unified | Return to bug 12782
Collapse All | Expand All

(-)ntp_io.c (-1 / +6 lines)
Lines 214-220 Link Here
214
#endif /* STREAMS_TLI */
214
#endif /* STREAMS_TLI */
215
	char	buf[MAXINTERFACES*sizeof(struct ifreq)];
215
	char	buf[MAXINTERFACES*sizeof(struct ifreq)];
216
	struct	ifconf	ifc;
216
	struct	ifconf	ifc;
217
	struct	ifreq	ifreq, *ifr;
217
	struct	ifreq	oifreq, ifreq, *ifr;
218
	int n, i, j, vs, size;
218
	int n, i, j, vs, size;
219
	struct sockaddr_in resmask;
219
	struct sockaddr_in resmask;
220
220
Lines 325-335 Link Here
325
		ioc.ic_len = sizeof(struct ifreq);
325
		ioc.ic_len = sizeof(struct ifreq);
326
		if(ioctl(vs, I_STR, &ioc)) {
326
		if(ioctl(vs, I_STR, &ioc)) {
327
#else /* ! STREAMS_TLI */
327
#else /* ! STREAMS_TLI */
328
		oifreq = ifreq; /* save old interface information from SIOCGIFCONF */
328
		if (ioctl(vs, SIOCGIFADDR, (char *)&ifreq) < 0) {
329
		if (ioctl(vs, SIOCGIFADDR, (char *)&ifreq) < 0) {
329
#endif /* STREAMS_TLI */
330
#endif /* STREAMS_TLI */
330
			syslog(LOG_ERR, "get interface addr: %m");
331
			syslog(LOG_ERR, "get interface addr: %m");
331
			continue;
332
			continue;
332
		}
333
		}
334
		if (!strncmp(oifreq.ifr_name, ifreq.ifr_name, strlen(oifreq.ifr_name)))
335
			if (((struct sockaddr_in *)&ifreq.ifr_addr)->sin_addr.s_addr !=
336
			((struct sockaddr_in *)&oifreq.ifr_addr)->sin_addr.s_addr)
337
				ifreq = oifreq; /* Different from SIOCGIFADDR, probably an IP alias */
333
338
334
		(void)strncpy(inter_list[i].name, ifreq.ifr_name,
339
		(void)strncpy(inter_list[i].name, ifreq.ifr_name,
335
		    sizeof(inter_list[i].name));
340
		    sizeof(inter_list[i].name));

Return to bug 12782