]> git.ozlabs.org Git - ppp.git/blobdiff - pppd/main.c
pppd: Fix `ifname` option in case of multilink (#105)
[ppp.git] / pppd / main.c
index 1b3f1e54bdd3250cb41fb986b89b3aaff355128e..9e9803a2c81fdce2e44f781cc98f354b557df08d 100644 (file)
@@ -743,6 +743,9 @@ set_ifunit(iskey)
        slprintf(ifname, sizeof(ifname), "%s%d", PPP_DRV_NAME, ifunit);
     info("Using interface %s", ifname);
     script_setenv("IFNAME", ifname, iskey);
+    char ifkey[32];
+    slprintf(ifkey, sizeof(ifkey), "%d", ifunit);
+    script_setenv("UNIT", ifkey, iskey);
     if (iskey) {
        create_pidfile(getpid());       /* write pid to file */
        create_linkpidfile(getpid());