summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/ipcp.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1997-05-10 01:22:19 +0000
committerbrian <brian@FreeBSD.org>1997-05-10 01:22:19 +0000
commit82bac13560d095243e9988bfb770da73089749c1 (patch)
tree262cfd051516c08f29f6f133a950e9de9f2d42fd /usr.sbin/ppp/ipcp.c
parent1da867bda76bc701006945dfbc4733f550c91c2d (diff)
downloadFreeBSD-src-82bac13560d095243e9988bfb770da73089749c1.zip
FreeBSD-src-82bac13560d095243e9988bfb770da73089749c1.tar.gz
Tidy up the code - bounds checking, return
value checking etc. Submitted by: eivind
Diffstat (limited to 'usr.sbin/ppp/ipcp.c')
-rw-r--r--usr.sbin/ppp/ipcp.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/usr.sbin/ppp/ipcp.c b/usr.sbin/ppp/ipcp.c
index 3f13f1f..fc00b62 100644
--- a/usr.sbin/ppp/ipcp.c
+++ b/usr.sbin/ppp/ipcp.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id$
+ * $Id: ipcp.c,v 1.13 1997/02/22 16:10:20 peter Exp $
*
* TODO:
* o More RFC1772 backwoard compatibility
@@ -118,7 +118,7 @@ IpcpStartReport()
StartTimer(&IpcpReportTimer);
}
-void
+int
ReportIpcpStatus()
{
struct ipcpstate *icp = &IpcpInfo;
@@ -137,6 +137,7 @@ ReportIpcpStatus()
inet_ntoa(DefHisAddress.ipaddr), DefHisAddress.width);
printf(" Negotiation: %s/%d\n",
inet_ntoa(DefTriggerAddress.ipaddr), DefTriggerAddress.width);
+ return 0;
}
void
@@ -267,12 +268,15 @@ struct fsm *fp;
#ifdef VERBOSE
fprintf(stderr, "%s: LayerUp(%d).\r\n", fp->name, fp->state);
#endif
- Prompt(1);
+ Prompt();
LogPrintf(LOG_LCP_BIT, "%s: LayerUp.\n", fp->name);
snprintf(tbuff, sizeof(tbuff), "myaddr = %s ",
inet_ntoa(IpcpInfo.want_ipaddr));
LogPrintf(LOG_LCP_BIT|LOG_LINK_BIT, " %s hisaddr = %s\n", tbuff, inet_ntoa(IpcpInfo.his_ipaddr));
- OsSetIpaddress(IpcpInfo.want_ipaddr, IpcpInfo.his_ipaddr, ifnetmask);
+ if (OsSetIpaddress(IpcpInfo.want_ipaddr, IpcpInfo.his_ipaddr, ifnetmask) < 0) {
+ printf("unable to set ip address\n");
+ return;
+ }
OsLinkup();
IpcpStartReport();
StartIdleTimer();
OpenPOWER on IntegriCloud