summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/filter.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1997-06-28 01:34:03 +0000
committerbrian <brian@FreeBSD.org>1997-06-28 01:34:03 +0000
commit512e26e794408148587a0cc63614c8743ac348ea (patch)
treebac242ee9fe70bd7d0619b1e0098b19b41b09dfa /usr.sbin/ppp/filter.c
parent4cd0616eedceb71683cb87759c1f36069ad2f73d (diff)
downloadFreeBSD-src-512e26e794408148587a0cc63614c8743ac348ea.zip
FreeBSD-src-512e26e794408148587a0cc63614c8743ac348ea.tar.gz
Deal with HISADDR/MYADDR in filter rules.
Mostly submitted by: kfurge@worldnet.att.net Allow MYADDR in add/delete commands to facilitate dynamic additions of a loopback route to MYADDR.
Diffstat (limited to 'usr.sbin/ppp/filter.c')
-rw-r--r--usr.sbin/ppp/filter.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/usr.sbin/ppp/filter.c b/usr.sbin/ppp/filter.c
index 305573e..60e0506 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.9 1997/05/10 01:22:08 brian Exp $
+ * $Id: filter.c,v 1.10 1997/06/09 03:27:19 brian Exp $
*
* TODO: Shoud send ICMP error message when we discard packets.
*/
@@ -37,6 +37,7 @@
#include "filter.h"
#include "loadalias.h"
#include "vars.h"
+#include "ipcp.h"
static struct filterent filterdata;
@@ -60,7 +61,6 @@ struct in_addr *paddr;
struct in_addr *pmask;
int *pwidth;
{
- u_long addr;
int bits;
char *cp, *wp;
@@ -72,8 +72,12 @@ int *pwidth;
pmask->s_addr = 0xffffffff; /* Assume 255.255.255.255 as default */
cp = index(*argv, '/');
if (cp) *cp++ = '\0';
- addr = inet_addr(*argv);
- paddr->s_addr = addr;
+ if (strcasecmp(*argv, "HISADDR") == 0)
+ *paddr = IpcpInfo.his_ipaddr;
+ else if (strcasecmp(*argv, "MYADDR") == 0)
+ *paddr = IpcpInfo.want_ipaddr;
+ else
+ paddr->s_addr = inet_addr(*argv);
if (cp && *cp) {
bits = strtol(cp, &wp, 0);
if (cp == wp || bits < 0 || bits > 32) {
OpenPOWER on IntegriCloud