X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=blobdiff_plain;f=pppd%2Fsys-linux.c;h=74ee20a8832f53502a5e32958752659e62a37329;hp=017248b590f3a70c66c84b083760cad8abe1a4d5;hb=b49b9d4f3f7c175c722aa4e42da1458d54365b20;hpb=e4a31c6f37af0b063e7bd9b2807ca387d75f8ae1 diff --git a/pppd/sys-linux.c b/pppd/sys-linux.c index 017248b..74ee20a 100644 --- a/pppd/sys-linux.c +++ b/pppd/sys-linux.c @@ -469,8 +469,12 @@ int establish_ppp (int tty_fd) if (!looped) set_kdebugflag (kdebugflag); - set_flags(ppp_fd, get_flags(ppp_fd) & ~(SC_RCV_B7_0 | SC_RCV_B7_1 | - SC_RCV_EVNP | SC_RCV_ODDP)); +#define SC_RCVB (SC_RCV_B7_0 | SC_RCV_B7_1 | SC_RCV_EVNP | SC_RCV_ODDP) +#define SC_LOGB (SC_DEBUG | SC_LOG_INPKT | SC_LOG_OUTPKT | SC_LOG_RAWIN \ + | SC_LOG_FLUSH) + + set_flags(ppp_fd, ((get_flags(ppp_fd) & ~(SC_RCVB | SC_LOGB)) + | ((kdebugflag * SC_DEBUG) & SC_LOGB))); SYSDEBUG ((LOG_NOTICE, "Using version %d.%d.%d of PPP driver", driver_version, driver_modification, driver_patch)); @@ -1808,24 +1812,20 @@ u_int32_t GetMask (u_int32_t addr) static void decode_version (char *buf, int *version, int *modification, int *patch) { - *version = (int) strtoul (buf, &buf, 10); + char *endp; + + *version = (int) strtoul (buf, &endp, 10); *modification = 0; *patch = 0; - if (*buf == '.') { - ++buf; - *modification = (int) strtoul (buf, &buf, 10); - if (*buf == '.') { - ++buf; + if (endp != buf && *endp == '.') { + buf = endp + 1; + *modification = (int) strtoul (buf, &endp, 10); + if (endp != buf && *endp == '.') { + buf = endp + 1; *patch = (int) strtoul (buf, &buf, 10); } } - - if (*buf != '\0') { - *version = - *modification = - *patch = 0; - } } /********************************************************************