summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/route.c
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1996-10-12 16:20:34 +0000
committerjkh <jkh@FreeBSD.org>1996-10-12 16:20:34 +0000
commitbba6a15120372e3d04f14cec0157e229a6953825 (patch)
tree9aaae040d84f7ca8e4d17ddd75851bfa12290e17 /usr.sbin/ppp/route.c
parent4ea380d58eccafbaafafcc405737bfcb59e8ee8b (diff)
downloadFreeBSD-src-bba6a15120372e3d04f14cec0157e229a6953825.zip
FreeBSD-src-bba6a15120372e3d04f14cec0157e229a6953825.tar.gz
1. Room to calculate MD5 for CHAP negotiation is shorter than
required. a core is not dumped at first connecting time and dumped at second or third time. (patch I) 2. A routine for "show route" refers out of allocated space. Values pointed by "lp" should be read as CHAR, I think. there is also no free() for disallocation. (patch II) Here is also a patch for an improvement: In current imprementation, even if PPP connection is disconnected by time out, prompt of interactive mode does not change from "PPP>" to "ppp>" to indicate the disconnection on a terminal. So I modified the code to do that. (patch III) Submitted-By: NAKAMURA Motonori <motonori@econ.kyoto-u.ac.jp>
Diffstat (limited to 'usr.sbin/ppp/route.c')
-rw-r--r--usr.sbin/ppp/route.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/usr.sbin/ppp/route.c b/usr.sbin/ppp/route.c
index b9570fa..9416836 100644
--- a/usr.sbin/ppp/route.c
+++ b/usr.sbin/ppp/route.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: route.c,v 1.7 1996/08/13 09:19:45 peter Exp $
+ * $Id: route.c,v 1.8 1996/10/06 13:32:35 jkh Exp $
*
*/
#include <sys/types.h>
@@ -198,10 +198,12 @@ ShowRoute()
#if (BSD >= 199306)
if (sysctl(mib, 6, sp, &needed, NULL, 0) < 0) {
perror("sysctl-getroute");
+ free(sp);
return(1);
}
#else
if (getkerninfo(KINFO_RT_DUMP, sp, &needed, 0) < 0)
+ free(sp);
return(1);
#endif
ep = sp + needed;
@@ -226,11 +228,11 @@ ShowRoute()
#endif
wp = (u_char *)(lp + 1);
mask = 0;
- for (nb = *lp; nb > 4; nb--) {
+ for (nb = *(char *)lp; nb > 4; nb--) {
mask <<= 8;
mask |= *wp++;
}
- for (nb = 8 - *lp; nb > 0; nb--)
+ for (nb = 8 - *(char *)lp; nb > 0; nb--)
mask <<= 8;
}
}
@@ -238,7 +240,7 @@ ShowRoute()
p_flags(rtm->rtm_flags & (RTF_UP|RTF_GATEWAY|RTF_HOST), "%-6.6s ");
printf("(%d)\n", rtm->rtm_index);
}
-
+ free(sp);
return(1);
}
OpenPOWER on IntegriCloud