summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/filter.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1997-12-13 02:37:33 +0000
committerbrian <brian@FreeBSD.org>1997-12-13 02:37:33 +0000
commitb51dc6a0ad3ce435d5255b72124d2220a345c748 (patch)
tree01ae43c4ae528f7d4f3a9b7aaad7063e4c34bc05 /usr.sbin/ppp/filter.c
parent982ed8caa2c928574b4adcc4149fb11f323b0f46 (diff)
downloadFreeBSD-src-b51dc6a0ad3ce435d5255b72124d2220a345c748.zip
FreeBSD-src-b51dc6a0ad3ce435d5255b72124d2220a345c748.tar.gz
Allow random IP number allocation to peer.
Validate the peers suggested IP by attempting to make a routing table entry. Give up IPCP negotiation if the peer NAKs us with an unusable IP. Always SIOCDIFADDR then SIOCAIFADDR when configuring the tun device. Using SIOCSIFDSTADDR allows duplicate dst addresses (which we don't want)!!! Allow up to 200 interface names (was 50) (now that ppp can play server properly). Up the version number (1.5 -> 1.6). Cosmetic: Log unexpected CCP packets in the CCP log rather than the ERROR log. Log unexpected Config Reqs in the appropriate LCP/IPCP/CCP log rather than the ERROR log. Log failed route additions and deletions with WARN, not TCPIP. Log the option id and length for unrecognised IPCP options. Change some .Sq to .Ar in the man page.
Diffstat (limited to 'usr.sbin/ppp/filter.c')
-rw-r--r--usr.sbin/ppp/filter.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/usr.sbin/ppp/filter.c b/usr.sbin/ppp/filter.c
index b154e1a..d152799 100644
--- a/usr.sbin/ppp/filter.c
+++ b/usr.sbin/ppp/filter.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: filter.c,v 1.18 1997/11/12 18:47:30 brian Exp $
+ * $Id: filter.c,v 1.19 1997/11/22 03:37:30 brian Exp $
*
* TODO: Shoud send ICMP error message when we discard packets.
*/
@@ -75,9 +75,11 @@ ParseAddr(int argc,
LogPrintf(LogWARN, "ParseAddr: address/mask is expected.\n");
return (0);
}
- pmask->s_addr = 0xffffffff; /* Assume 255.255.255.255 as default */
- cp = strchr(*argv, '/');
+ if (pmask)
+ pmask->s_addr = 0xffffffff; /* Assume 255.255.255.255 as default */
+
+ cp = pmask || pwidth ? strchr(*argv, '/') : NULL;
len = cp ? cp - *argv : strlen(*argv);
if (strncasecmp(*argv, "HISADDR", len) == 0)
@@ -106,8 +108,11 @@ ParseAddr(int argc,
bits = 32;
}
- *pwidth = bits;
- pmask->s_addr = htonl(netmasks[bits]);
+ if (pwidth)
+ *pwidth = bits;
+
+ if (pmask)
+ pmask->s_addr = htonl(netmasks[bits]);
return (1);
}
OpenPOWER on IntegriCloud