X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Fsys-solaris.c;h=113eb7bdf74c7617e577a41c1dfac9a0e74d8b67;hb=e87fe1bbd37a1486c5223f110e9ce3ef75971f93;hp=0b993a50139ed0136d8511f7ee5838c64ea6e0df;hpb=a1e950a04bcd9b19be22c19aa3bdaa66d9538701;p=ppp.git diff --git a/pppd/sys-solaris.c b/pppd/sys-solaris.c index 0b993a5..113eb7b 100644 --- a/pppd/sys-solaris.c +++ b/pppd/sys-solaris.c @@ -114,6 +114,7 @@ #include #include #include +#include #include #include #include @@ -1550,6 +1551,26 @@ netif_set_mtu(unit, mtu) #endif /* defined(INET6) && defined(SOL2) */ } + + +/* + * netif_get_mtu - get the MTU on the PPP network interface. + */ +int +netif_get_mtu(int unit) +{ + struct ifreq ifr; + + memset (&ifr, '\0', sizeof (ifr)); + strlcpy(ifr.ifr_name, ifname, sizeof (ifr.ifr_name)); + + if (ioctl(ipfd, SIOCGIFMTU, (caddr_t) &ifr) < 0) { + error("ioctl(SIOCGIFMTU): %m (line %d)", __LINE__); + return 0; + } + return ifr.ifr_mtu; +} + /* * tty_send_config - configure the transmit characteristics of * the ppp interface. @@ -2426,7 +2447,7 @@ dlpi_get_reply(fd, reply, expected_prim, maxlen) pfd.events = POLLIN | POLLPRI; do { n = poll(&pfd, 1, 1000); - } while (n == -1 && errno == EINTR); + } while (n == -1 && errno == EINTR && !got_sigterm); if (n <= 0) return -1; @@ -2863,3 +2884,13 @@ get_pty(master_fdp, slave_fdp, slave_name, uid) return 1; } + +/******************************************************************** + * + * get_time - Get current time, monotonic if possible. + */ +int +get_time(struct timeval *tv) +{ + return gettimeofday(tv, NULL); +}