*/
#ifndef lint
-static char rcsid[] = "$Id: sys-sunos4.c,v 1.5 1996/05/27 00:00:56 paulus Exp $";
+static char rcsid[] = "$Id: sys-sunos4.c,v 1.8 1997/04/30 05:58:52 paulus Exp $";
#endif
#include <stdio.h>
#if defined(sun) && defined(sparc)
#include <alloca.h>
+#ifndef __GNUC__
+extern void *alloca();
+#endif
#endif /*sparc*/
static int pppfd;
if (ifaddrs[0])
cifaddr(0, ifaddrs[0], ifaddrs[1]);
if (default_route_gateway)
- cifdefaultroute(0, default_route_gateway);
+ cifdefaultroute(0, 0, default_route_gateway);
if (proxy_arp_addr)
cifproxyarp(0, proxy_arp_addr);
}
struct pollfd pfd;
if (debug)
- log_packet(p, len, "sent ");
+ log_packet(p, len, "sent ", LOG_DEBUG);
data.len = len;
data.buf = (caddr_t) p;
int pcomp, accomp;
{
int cf[2];
+ struct ifreq ifr;
link_mtu = mtu;
if (strioctl(pppfd, PPPIO_MTU, &mtu, sizeof(mtu), 0) < 0) {
if (strioctl(pppfd, PPPIO_CFLAGS, cf, sizeof(cf), sizeof(int)) < 0) {
syslog(LOG_ERR, "Couldn't set prot/AC compression: %m");
}
+
+ /* set mtu for ip as well */
+ memset(&ifr, 0, sizeof(ifr));
+ strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
+ ifr.ifr_metric = link_mtu;
+ if (ioctl(sockfd, SIOCSIFMTU, &ifr) < 0) {
+ syslog(LOG_ERR, "Couldn't set IP MTU: %m");
+ }
}
/*
npi[0] = proto;
npi[1] = (int) mode;
- if (strioctl(pppfd, PPPIO_NPMODE, &npi, 2 * sizeof(int), 0) < 0) {
+ if (strioctl(pppfd, PPPIO_NPMODE, npi, 2 * sizeof(int), 0) < 0) {
syslog(LOG_ERR, "ioctl(set NP %d mode to %d): %m", proto, mode);
return 0;
}
if (ioctl(sockfd, SIOCSIFDSTADDR, &ifr) < 0) {
syslog(LOG_ERR, "Couldn't set remote IP address: %m");
}
+#if 0 /* now done in ppp_send_config */
ifr.ifr_metric = link_mtu;
if (ioctl(sockfd, SIOCSIFMTU, &ifr) < 0) {
syslog(LOG_ERR, "Couldn't set IP MTU: %m");
}
+#endif
ifaddrs[0] = o;
ifaddrs[1] = h;
* sifdefaultroute - assign a default route through the address given.
*/
int
-sifdefaultroute(u, g)
+sifdefaultroute(u, l, g)
int u;
- u_int32_t g;
+ u_int32_t l, g;
{
struct rtentry rt;
* cifdefaultroute - delete a default route through the address given.
*/
int
-cifdefaultroute(u, g)
+cifdefaultroute(u, l, g)
int u;
- u_int32_t g;
+ u_int32_t l, g;
{
struct rtentry rt;
#define WTMPFILE "/usr/adm/wtmp"
-int
+void
logwtmp(line, name, host)
- char *line, *name, *host;
+ const char *line, *name, *host;
{
int fd;
struct stat buf;