X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=blobdiff_plain;f=pppd%2Fsys-solaris.c;fp=pppd%2Fsys-solaris.c;h=113eb7bdf74c7617e577a41c1dfac9a0e74d8b67;hp=a85c73301ed2b474ee644f170ff733714811306d;hb=e87fe1bbd37a1486c5223f110e9ce3ef75971f93;hpb=ad3937a0a38a696eb1a37dbf8f92e8e6072cdccb diff --git a/pppd/sys-solaris.c b/pppd/sys-solaris.c index a85c733..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.