]> git.ozlabs.org Git - ppp.git/commitdiff
Merge pull request #358 from enaess/ppp-autotools
authorPaul Mackerras <paulus@ozlabs.org>
Tue, 9 Aug 2022 09:42:51 +0000 (19:42 +1000)
committerGitHub <noreply@github.com>
Tue, 9 Aug 2022 09:42:51 +0000 (19:42 +1000)
PPP autotools

.github/workflows/solaris.yaml
pppd/sys-linux.c

index 9ede782fe8928c7bf9f2d5c4263a212588356d83..ab02e9666f13f816451ef285c78d676d76efb7fb 100644 (file)
@@ -3,12 +3,12 @@ on: [push, pull_request]
 
 jobs:
   solaris:
-    runs-on: macos-10.15
+    runs-on: macos-12
     steps:
     - name: Checkout PPP sources
       uses: actions/checkout@v2
     - name: Build
-      uses: vmactions/solaris-vm@v0.0.4
+      uses: vmactions/solaris-vm@v0
       with:
         run: |
           pkg update
index e7f851c02512394cc1ebe5b63f771eb4890846b4..9c0455c0da62e4fb31ed0e4b3ae542bab293844d 100644 (file)
@@ -878,6 +878,11 @@ static int make_ppp_unit(void)
                ifunit = -1;
                x = ioctl(ppp_dev_fd, PPPIOCNEWUNIT, &ifunit);
        }
+       if (x < 0 && errno == EEXIST) {
+               srand(time(NULL) * getpid());
+               ifunit = rand() % 10000;
+               x = ioctl(ppp_dev_fd, PPPIOCNEWUNIT, &ifunit);
+       }
        if (x < 0)
                error("Couldn't create new ppp unit: %m");
 
@@ -1790,13 +1795,10 @@ get_ppp_stats_rtnetlink(int u, struct pppd_stats *stats)
     }
 
     if (nlresp.nlh.nlmsg_type == NLMSG_ERROR) {
-       if (nlresplen < offsetof(struct nlresp, __end_err)) {
-           if (kernel_version >= KVERSION(4,7,0))
-               error("get_ppp_stats_rtnetlink: Netlink responded with error: %s (line %d)", strerror(-nlresp.nlerr.error), __LINE__);
-       } else {
-           error("get_ppp_stats_rtnetlink: Netlink responded with an error message, but the nlmsgerr structure is incomplete (line %d).",
-                   __LINE__);
-       }
+       if (nlresplen < offsetof(struct nlresp, __end_err))
+           error("get_ppp_stats_rtnetlink: Netlink responded with an error message, but the nlmsgerr structure is incomplete (line %d).", __LINE__);
+       else if (kernel_version >= KVERSION(4,7,0))
+           error("get_ppp_stats_rtnetlink: Netlink responded with error: %s (line %d)", strerror(-nlresp.nlerr.error), __LINE__);
        goto err;
     }