}
if (!sifaddr(u, wo->ouraddr, wo->hisaddr, GetMask(wo->ouraddr)))
return 0;
- ipcp_script(_PATH_IPPREUP, 1);
+ ipcp_script(PPP_PATH_IPPREUP, 1);
if (!sifup(u))
return 0;
if (!sifnpmode(u, PPP_IP, NPMODE_QUEUE))
ifindex = if_nametoindex(ifname);
/* run the pre-up script, if any, and wait for it to finish */
- ipcp_script(_PATH_IPPREUP, 1);
+ ipcp_script(PPP_PATH_IPPREUP, 1);
/* check if preup script renamed the interface */
if (!if_indextoname(ifindex, ifname)) {
{
FILE *f;
- f = fopen(_PATH_RESOLV, "w");
+ f = fopen(PPP_PATH_RESOLV, "w");
if (f == NULL) {
- error("Failed to create %s: %m", _PATH_RESOLV);
+ error("Failed to create %s: %m", PPP_PATH_RESOLV);
return;
}
if (peerdns1)
fprintf(f, "nameserver %s\n", ip_ntoa(peerdns1));
- if (peerdns2)
+ if (peerdns2 && peerdns2 != peerdns1)
fprintf(f, "nameserver %s\n", ip_ntoa(peerdns2));
if (ferror(f))
- error("Write failed to %s: %m", _PATH_RESOLV);
+ error("Write failed to %s: %m", PPP_PATH_RESOLV);
fclose(f);
}