X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;ds=sidebyside;f=pppd%2Fsys-solaris.c;h=113eb7bdf74c7617e577a41c1dfac9a0e74d8b67;hb=505ec5cbd15ec23ed84282462ae9e451a1978133;hp=65b173a79695b7e80b8b421072532073be513ca0;hpb=b1fcf16fa66159f380ee4abd7c9a76b59809dc7b;p=ppp.git diff --git a/pppd/sys-solaris.c b/pppd/sys-solaris.c index 65b173a..113eb7b 100644 --- a/pppd/sys-solaris.c +++ b/pppd/sys-solaris.c @@ -1551,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. @@ -2427,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;