Project

General

Profile

0001-qmi-Fix-Secondary-DNS-overwriting-Primary-DNS.patch

pespin, 12/11/2018 07:48 PM

View differences:

drivers/qmimodem/gprs-context.c
88 88
	char* straddr;
89 89
	char* apn;
90 90
	const char *dns[3] = { NULL, NULL, NULL };
91
	char dns_buf[2][INET_ADDRSTRLEN];
91 92

  
92 93
	DBG("");
93 94

  
......
131 132
	if (qmi_result_get_uint32(result,
132 133
				QMI_WDS_RESULT_PRIMARY_DNS, &ip_addr)) {
133 134
		addr.s_addr = htonl(ip_addr);
134
		dns[0] = inet_ntoa(addr);
135
		dns[0] = inet_ntop(AF_INET, &addr, dns_buf[0], sizeof(dns_buf[0]));
135 136
		DBG("Primary DNS: %s", dns[0]);
136 137
	}
137 138

  
138 139
	if (qmi_result_get_uint32(result,
139 140
				QMI_WDS_RESULT_SECONDARY_DNS, &ip_addr)) {
140 141
		addr.s_addr = htonl(ip_addr);
141
		dns[1] = inet_ntoa(addr);
142
		dns[1] = inet_ntop(AF_INET, &addr, dns_buf[1], sizeof(dns_buf[1]));
142 143
		DBG("Secondary DNS: %s", dns[1]);
143 144
	}
144 145

  
145
- 
Add picture from clipboard (Maximum size: 48.8 MB)