Skip to content

Commit 2007d14

Browse files
jukkarrlubos
authored andcommitted
[nrf fromtree] net: ppp: Bind DNS to device ppp network interface
Make sure received DNS server information is bound to the ppp network interface. Signed-off-by: Jukka Rissanen <[email protected]> (cherry picked from commit 8704b3a) Signed-off-by: Robert Lubos <[email protected]>
1 parent 81e0ce2 commit 2007d14

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

subsys/net/l2/ppp/ipcp.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,8 @@ static void ipcp_set_dns_servers(struct ppp_fsm *fsm)
362362
(struct sockaddr *) &dns2,
363363
NULL
364364
};
365+
int ifindex = net_if_get_by_iface(ctx->iface);
366+
int interfaces[2] = { ifindex, ifindex };
365367
int ret;
366368

367369
if (!dns1.sin_addr.s_addr) {
@@ -373,7 +375,8 @@ static void ipcp_set_dns_servers(struct ppp_fsm *fsm)
373375
}
374376

375377
dnsctx = dns_resolve_get_default();
376-
ret = dns_resolve_reconfigure(dnsctx, NULL, dns_servers);
378+
ret = dns_resolve_reconfigure_with_interfaces(dnsctx, NULL, dns_servers,
379+
interfaces);
377380
if (ret < 0) {
378381
NET_ERR("Could not set DNS servers");
379382
return;

0 commit comments

Comments
 (0)