diff --git a/dist/ipf/tools/ipf_y.y b/dist/ipf/tools/ipf_y.y index 85347c2507ae..57b15335edae 100644 --- a/dist/ipf/tools/ipf_y.y +++ b/dist/ipf/tools/ipf_y.y @@ -1,4 +1,4 @@ -/* $NetBSD: ipf_y.y,v 1.3 2004/04/09 20:39:22 jwise Exp $ */ +/* $NetBSD: ipf_y.y,v 1.4 2004/05/09 03:53:23 christos Exp $ */ %{ #include "ipf.h" @@ -477,11 +477,22 @@ dup: IPFY_DUPTO name { strncpy(fr->fr_dif.fd_ifname, $2, sizeof(fr->fr_dif.fd_ifname)); free($2); } - | IPFY_DUPTO name ':' hostname + | IPFY_DUPTO name duptoseparator hostname { strncpy(fr->fr_dif.fd_ifname, $2, sizeof(fr->fr_dif.fd_ifname)); fr->fr_dif.fd_ip = $4; + yyexpectaddr = 0; free($2); } + | IPFY_DUPTO name duptoseparator YY_IPV6 + { strncpy(fr->fr_dif.fd_ifname, $2, sizeof(fr->fr_dif.fd_ifname)); + bcopy(&$4, &fr->fr_dif.fd_ip6, sizeof(fr->fr_dif.fd_ip6)); + yyexpectaddr = 0; + free($2); + } + ; + +duptoseparator: + ':' { yyexpectaddr = 1; yycont = &yyexpectaddr; resetaddr(); } ; froute: IPFY_FROUTE { fr->fr_flags |= FR_FASTROUTE; } @@ -491,9 +502,16 @@ proute: routeto name { strncpy(fr->fr_tif.fd_ifname, $2, sizeof(fr->fr_tif.fd_ifname)); free($2); } - | routeto name ':' hostname + | routeto name duptoseparator hostname { strncpy(fr->fr_tif.fd_ifname, $2, sizeof(fr->fr_tif.fd_ifname)); fr->fr_tif.fd_ip = $4; + yyexpectaddr = 0; + free($2); + } + | routeto name duptoseparator YY_IPV6 + { strncpy(fr->fr_tif.fd_ifname, $2, sizeof(fr->fr_tif.fd_ifname)); + bcopy(&$4, &fr->fr_tif.fd_ip6, sizeof(fr->fr_tif.fd_ip6)); + yyexpectaddr = 0; free($2); } ; @@ -508,7 +526,7 @@ replyto: { strncpy(fr->fr_rif.fd_ifname, $2, sizeof(fr->fr_rif.fd_ifname)); free($2); } - | IPFY_REPLY_TO name ':' hostname + | IPFY_REPLY_TO name duptoseparator hostname { strncpy(fr->fr_rif.fd_ifname, $2, sizeof(fr->fr_rif.fd_ifname)); fr->fr_rif.fd_ip = $4; free($2); @@ -756,6 +774,7 @@ addr: IPFY_ANY { bzero(&($$), sizeof($$)); } fill6bits(128, (u_32_t *)&$$.m); } | YY_IPV6 maskspace ipv6mask { bcopy(&$1, &$$.a, sizeof($$.a)); bcopy(&$3, &$$.m, sizeof($$.m)); } + ; maskspace: '/' diff --git a/dist/ipf/tools/lexer.c b/dist/ipf/tools/lexer.c index dd8a20b0756a..230c17df2f14 100644 --- a/dist/ipf/tools/lexer.c +++ b/dist/ipf/tools/lexer.c @@ -1,4 +1,4 @@ -/* $NetBSD: lexer.c,v 1.1.1.1 2004/03/28 08:56:35 martti Exp $ */ +/* $NetBSD: lexer.c,v 1.2 2004/05/09 03:53:23 christos Exp $ */ /* * Copyright (C) 2003 by Darren Reed. @@ -44,6 +44,7 @@ int yyexpectaddr = 0; int yybreakondot = 0; int yyvarnext = 0; int yytokentype = 0; +int *yycont; wordtab_t *yywordtab = NULL; static wordtab_t *yyfindkey __P((char *)); diff --git a/dist/ipf/tools/lexer.h b/dist/ipf/tools/lexer.h index 5d37d24bdc3b..fba2066c10ab 100644 --- a/dist/ipf/tools/lexer.h +++ b/dist/ipf/tools/lexer.h @@ -1,4 +1,4 @@ -/* $NetBSD: lexer.h,v 1.1.1.1 2004/03/28 08:56:35 martti Exp $ */ +/* $NetBSD: lexer.h,v 1.2 2004/05/09 03:53:23 christos Exp $ */ typedef struct wordtab { @@ -30,6 +30,7 @@ extern char *yykeytostr __P((int)); extern FILE *yyin; extern int yylineNum; extern int yyexpectaddr; +extern int *yycont; extern int yybreakondot; extern int yyvarnext;