X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=blobdiff_plain;f=pppd%2Fsys-aix4.c;h=c244c3ecad56385a57179cc0d8101b577c95b4e4;hp=9c92e3ffb565126a50cf68e6d4bc830285d20b1d;hb=9b4646bd15f16035b8ff161730b3da9df3fb4713;hpb=ee9e29919a9c98b9c9b3805ebe9e975a9d143d73 diff --git a/pppd/sys-aix4.c b/pppd/sys-aix4.c index 9c92e3f..c244c3e 100644 --- a/pppd/sys-aix4.c +++ b/pppd/sys-aix4.c @@ -20,9 +20,7 @@ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ -#ifndef lint -static char rcsid[] = "$Id: sys-aix4.c,v 1.17 1999/03/16 22:53:46 paulus Exp $"; -#endif +#define RCSID "$Id: sys-aix4.c,v 1.22 1999/08/13 06:46:17 paulus Exp $" /* * TODO: @@ -54,6 +52,8 @@ static char rcsid[] = "$Id: sys-aix4.c,v 1.17 1999/03/16 22:53:46 paulus Exp $"; #include "pppd.h" +static const char rcsid[] = RCSID; + #ifndef ifr_mtu #define ifr_mtu ifr_metric #endif @@ -111,7 +111,7 @@ sys_cleanup() struct ifreq ifr; if (if_is_up) { - strlcpy(ifr.ifr_name, sizeof(ifr.ifr_name), ifname); + strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)); if (ioctl(sockfd, SIOCGIFFLAGS, &ifr) >= 0 && ((ifr.ifr_flags & IFF_UP) != 0)) { ifr.ifr_flags &= ~IFF_UP; @@ -137,7 +137,7 @@ int have_route_to(u_int32_t addr) return -1; } - +#if 0 /* * daemon - Detach us from the terminal session. */ @@ -161,7 +161,7 @@ daemon(nochdir, noclose) } return 0; } - +#endif /* * ppp_available - check if this kernel supports PPP. @@ -581,7 +581,8 @@ wait_input(timo) /* * add_fd - add an fd to the set that wait_input waits for. */ -void add_fd(int fd) +void add_fd(fd) + int fd; { int n; @@ -599,7 +600,8 @@ void add_fd(int fd) /* * remove_fd - remove an fd from the set that wait_input waits for. */ -void remove_fd(int fd) +void remove_fd(fd) + int fd; { int n; @@ -664,7 +666,7 @@ ppp_send_config(unit, mtu, asyncmap, pcomp, accomp) int c; struct ifreq ifr; - strlcpy(ifr.ifr_name, sizeof (ifr.ifr_name), ifname); + strlcpy(ifr.ifr_name, ifname, sizeof (ifr.ifr_name)); ifr.ifr_mtu = mtu; if (ioctl(sockfd, SIOCSIFMTU, (caddr_t) &ifr) < 0) fatal("ioctl(SIOCSIFMTU): %m"); @@ -805,7 +807,7 @@ sifup(u) { struct ifreq ifr; - strlcpy(ifr.ifr_name, sizeof (ifr.ifr_name), ifname); + strlcpy(ifr.ifr_name, ifname, sizeof (ifr.ifr_name)); if (ioctl(sockfd, SIOCGIFFLAGS, (caddr_t) &ifr) < 0) { error("ioctl (SIOCGIFFLAGS): %m"); return 0; @@ -857,7 +859,7 @@ sifdown(u) ioctl(ttyfd, SIOCSETNPMODE, &npi); /* ignore errors, because ttyfd might have been closed by now. */ - strlcpy(ifr.ifr_name, sizeof (ifr.ifr_name), ifname); + strlcpy(ifr.ifr_name, ifname, sizeof (ifr.ifr_name)); if (ioctl(sockfd, SIOCGIFFLAGS, (caddr_t) &ifr) < 0) { error("ioctl (SIOCGIFFLAGS): %m"); rv = 0; @@ -891,7 +893,7 @@ sifaddr(u, o, h, m) struct ifreq ifr; ret = 1; - strlcpy(ifr.ifr_name, sizeof (ifr.ifr_name), ifname); + strlcpy(ifr.ifr_name, ifname, sizeof (ifr.ifr_name)); SET_SA_FAMILY(ifr.ifr_addr, AF_INET); if (m != 0) { info("Setting interface mask to %s\n", ip_ntoa(m)); @@ -1259,7 +1261,7 @@ GetMask(addr) /* * Check that the interface is up, and not point-to-point or loopback. */ - strlcpy(ifreq.ifr_name, sizeof(ifreq.ifr_name), ifr->ifr_name); + strlcpy(ifreq.ifr_name, ifr->ifr_name, sizeof(ifreq.ifr_name)); if (ioctl(sockfd, SIOCGIFFLAGS, &ifreq) < 0) continue; if ((ifreq.ifr_flags & (IFF_UP|IFF_POINTOPOINT|IFF_LOOPBACK)) @@ -1289,9 +1291,9 @@ logwtmp(line, name, host) if ((fd = open(WTMPFILE, O_WRONLY|O_APPEND, 0)) < 0) return; if (!fstat(fd, &buf)) { - strlcpy(ut.ut_line, sizeof(ut.ut_line), line); - strlcpy(ut.ut_name, sizeof(ut.ut_name), name); - strlcpy(ut.ut_host, sizeof(ut.ut_host), host); + strncpy(ut.ut_line, line, sizeof(ut.ut_line)); + strncpy(ut.ut_name, name, sizeof(ut.ut_name)); + strncpy(ut.ut_host, host, sizeof(ut.ut_host)); (void)time(&ut.ut_time); if (write(fd, (char *)&ut, sizeof(struct utmp)) != sizeof(struct utmp)) (void)ftruncate(fd, buf.st_size);