X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Fsys-linux.c;h=c5ba49d6e1fed38177c657dc02849af9b518b677;hb=44609bfc974bdafc0316d069aabf5e2903efa805;hp=e7f851c02512394cc1ebe5b63f771eb4890846b4;hpb=6dbc350dc42130c71c448e6a7624fde8242e3eb6;p=ppp.git diff --git a/pppd/sys-linux.c b/pppd/sys-linux.c index e7f851c..c5ba49d 100644 --- a/pppd/sys-linux.c +++ b/pppd/sys-linux.c @@ -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");