Thread: [ipfilter-cvs] ipfilter/tools ipnat_y.y,v5-1-RELEASE
Brought to you by:
darren_r
From: Darren <dar...@us...> - 2009-07-27 18:52:12
|
Update of /cvsroot/ipfilter/ipfilter/tools In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv1906/tools Modified Files: Tag: v5-1-RELEASE ipnat_y.y Log Message: 2827998 extra keywords in dictionary Index: ipnat_y.y =================================================================== RCS file: /cvsroot/ipfilter/ipfilter/tools/ipnat_y.y,v retrieving revision 1.19 retrieving revision 1.19.2.1 diff -C2 -d -r1.19 -r1.19.2.1 *** ipnat_y.y 7 Jul 2009 07:40:10 -0000 1.19 --- ipnat_y.y 27 Jul 2009 18:52:01 -0000 1.19.2.1 *************** *** 119,123 **** %token IPNY_TLATE IPNY_POOL IPNY_HASH IPNY_NO IPNY_REWRITE IPNY_PROTO %token IPNY_ON IPNY_SRC IPNY_DST IPNY_IN IPNY_OUT IPNY_DIVERT IPNY_ENCAP ! %token IPNY_RANDOM IPNY_HASHMD5 IPNY_CONFIG IPNY_ALLOW IPNY_DENY IPNY_DNS %token IPNY_SEQUENTIAL IPNY_DSTLIST %type <port> portspec --- 119,123 ---- %token IPNY_TLATE IPNY_POOL IPNY_HASH IPNY_NO IPNY_REWRITE IPNY_PROTO %token IPNY_ON IPNY_SRC IPNY_DST IPNY_IN IPNY_OUT IPNY_DIVERT IPNY_ENCAP ! %token IPNY_CONFIG IPNY_ALLOW IPNY_DENY IPNY_DNS %token IPNY_SEQUENTIAL IPNY_DSTLIST %type <port> portspec *************** *** 1223,1227 **** { "from", IPNY_FROM }, { "hash", IPNY_HASH }, - { "hash-md5", IPNY_HASHMD5 }, { "icmpidmap", IPNY_ICMPIDMAP }, { "in", IPNY_IN }, --- 1223,1226 ---- *************** *** 1240,1244 **** { "proto", IPNY_PROTO }, { "proxy", IPNY_PROXY }, - { "random", IPNY_RANDOM }, { "range", IPNY_RANGE }, { "rewrite", IPNY_REWRITE }, --- 1239,1242 ---- |
From: Darren <dar...@us...> - 2012-06-05 04:46:27
|
Update of /cvsroot/ipfilter/ipfilter/tools In directory vz-cvs-4.sog:/tmp/cvs-serv12025/tools Modified Files: Tag: v5-1-RELEASE ipnat_y.y Log Message: 3531870 ipnat.conf parsing needs to support inet6 Index: ipnat_y.y =================================================================== RCS file: /cvsroot/ipfilter/ipfilter/tools/ipnat_y.y,v retrieving revision 1.19.2.5 retrieving revision 1.19.2.6 diff -C2 -d -r1.19.2.5 -r1.19.2.6 *** ipnat_y.y 29 May 2012 12:22:39 -0000 1.19.2.5 --- ipnat_y.y 5 Jun 2012 04:46:25 -0000 1.19.2.6 *************** *** 119,123 **** %token IPNY_TLATE IPNY_POOL IPNY_HASH IPNY_NO IPNY_REWRITE IPNY_PROTO %token IPNY_ON IPNY_SRC IPNY_DST IPNY_IN IPNY_OUT IPNY_DIVERT IPNY_ENCAP ! %token IPNY_CONFIG IPNY_ALLOW IPNY_DENY IPNY_DNS %token IPNY_SEQUENTIAL IPNY_DSTLIST IPNY_PURGE %type <port> portspec --- 119,123 ---- %token IPNY_TLATE IPNY_POOL IPNY_HASH IPNY_NO IPNY_REWRITE IPNY_PROTO %token IPNY_ON IPNY_SRC IPNY_DST IPNY_IN IPNY_OUT IPNY_DIVERT IPNY_ENCAP ! %token IPNY_CONFIG IPNY_ALLOW IPNY_DENY IPNY_DNS IPNY_INET IPNY_INET6 %token IPNY_SEQUENTIAL IPNY_DSTLIST IPNY_PURGE %type <port> portspec *************** *** 355,359 **** rewrite: IPNY_REWRITE oninout rwrproto mapfrom tlate newdst newopts ! { if (nat->in_redir & NAT_MAP) setmapifnames(); else --- 355,360 ---- rewrite: IPNY_REWRITE oninout rwrproto mapfrom tlate newdst newopts ! { nat->in_v[0] = ftov($4); ! if (nat->in_redir & NAT_MAP) setmapifnames(); else *************** *** 364,368 **** divert: IPNY_DIVERT oninout rwrproto mapfrom tlate divdst newopts ! { if (nat->in_redir & NAT_MAP) { setmapifnames(); nat->in_pr[0] = IPPROTO_UDP; --- 365,370 ---- divert: IPNY_DIVERT oninout rwrproto mapfrom tlate divdst newopts ! { nat->in_v[0] = ftov($4); ! if (nat->in_redir & NAT_MAP) { setmapifnames(); nat->in_pr[0] = IPPROTO_UDP; *************** *** 376,380 **** encap: IPNY_ENCAP oninout rwrproto mapfrom tlate encapdst newopts ! { if (nat->in_redir & NAT_MAP) { setmapifnames(); nat->in_pr[0] = IPPROTO_IPIP; --- 378,383 ---- encap: IPNY_ENCAP oninout rwrproto mapfrom tlate encapdst newopts ! { nat->in_v[0] = ftov($4); ! if (nat->in_redir & NAT_MAP) { setmapifnames(); nat->in_pr[0] = IPPROTO_IPIP; *************** *** 817,822 **** ifnames: ! ifname { yyexpectaddr = 1; } ! | ifname ',' otherifname { yyexpectaddr = 1; } ; --- 820,825 ---- ifnames: ! ifname family { yyexpectaddr = 1; } ! | ifname ',' otherifname family { yyexpectaddr = 1; } ; *************** *** 826,829 **** --- 829,836 ---- ; + family: | IPNY_INET { nat->in_v[0] = 4; nat->in_v[1] = 4; } + | IPNY_INET6 { nat->in_v[0] = 6; nat->in_v[1] = 6; } + ; + otherifname: YY_STR { setifname(&nat, 1, $1); *************** *** 1236,1239 **** --- 1243,1248 ---- { "icmpidmap", IPNY_ICMPIDMAP }, { "in", IPNY_IN }, + { "inet", IPNY_INET }, + { "inet6", IPNY_INET6 }, { "mask", IPNY_MASK }, { "map", IPNY_MAP }, |
From: Darren <dar...@us...> - 2012-06-20 03:46:38
|
Update of /cvsroot/ipfilter/ipfilter/tools In directory vz-cvs-4.sog:/tmp/cvs-serv17916/tools Modified Files: Tag: v5-1-RELEASE ipnat_y.y Log Message: 3536479 ipnat.conf line numbers not stored Index: ipnat_y.y =================================================================== RCS file: /cvsroot/ipfilter/ipfilter/tools/ipnat_y.y,v retrieving revision 1.19.2.8 retrieving revision 1.19.2.9 diff -C2 -d -r1.19.2.8 -r1.19.2.9 *** ipnat_y.y 19 Jun 2012 07:56:34 -0000 1.19.2.8 --- ipnat_y.y 20 Jun 2012 03:46:36 -0000 1.19.2.9 *************** *** 147,152 **** err = (*nataddfunc)(natfd, natioctlfunc, nat); free(nat); ! if (err != 0) parser_error = err; } if (parser_error == 0 && prules != NULL) { --- 147,154 ---- err = (*nataddfunc)(natfd, natioctlfunc, nat); free(nat); ! if (err != 0) { parser_error = err; + break; + } } if (parser_error == 0 && prules != NULL) { *************** *** 1302,1305 **** --- 1304,1309 ---- char *s; + yylineNum = 1; + (void) yysettab(yywords); *************** *** 1342,1347 **** int i; - yylineNum = 1; - natfd = fd; parser_error = 0; --- 1346,1349 ---- *************** *** 1388,1391 **** --- 1390,1394 ---- } + n->in_flineno = yylineNum; n->in_ifnames[0] = -1; n->in_ifnames[1] = -1; *************** *** 1523,1526 **** --- 1526,1533 ---- sprintf(msg, "%d:ioctl(add/insert nat rule)", yylineNum); + if (errno == EEXIST) { + sprintf(msg + strlen(msg), "(line %d)", + ipn->in_flineno); + } return ipf_perror_fd(fd, ioctlfunc, msg); } |
From: Darren <dar...@us...> - 2012-07-07 01:41:48
|
Update of /cvsroot/ipfilter/ipfilter/tools In directory vz-cvs-4.sog:/tmp/cvs-serv27835/tools Modified Files: Tag: v5-1-RELEASE ipnat_y.y Log Message: 3540999 ipnat.conf parsing has trouble with icmpidmap for ipv6 Index: ipnat_y.y =================================================================== RCS file: /cvsroot/ipfilter/ipfilter/tools/ipnat_y.y,v retrieving revision 1.19.2.9 retrieving revision 1.19.2.10 diff -C2 -d -r1.19.2.9 -r1.19.2.10 *** ipnat_y.y 20 Jun 2012 03:46:36 -0000 1.19.2.9 --- ipnat_y.y 7 Jul 2012 01:41:45 -0000 1.19.2.10 *************** *** 863,867 **** } | IPNY_ICMPIDMAP YY_STR portpair sequential ! { if (strcmp($2, "icmp") != 0) { yyerror("icmpidmap not followed by icmp"); } --- 863,868 ---- } | IPNY_ICMPIDMAP YY_STR portpair sequential ! { if (strcmp($2, "icmp") != 0 && ! strcmp($2, "ipv6-icmp") != 0) { yyerror("icmpidmap not followed by icmp"); } *************** *** 871,876 **** if ($3.p2 < 0 || $3.p2 > 65535) yyerror("invalid ICMP Id number"); ! nat->in_pr[0] = IPPROTO_ICMP; ! nat->in_pr[1] = IPPROTO_ICMP; nat->in_flags = IPN_ICMPQUERY; nat->in_spmin = $3.p1; --- 872,882 ---- if ($3.p2 < 0 || $3.p2 > 65535) yyerror("invalid ICMP Id number"); ! if (strcmp($2, "ipv6-icmp") == 0) { ! nat->in_pr[0] = IPPROTO_ICMPV6; ! nat->in_pr[1] = IPPROTO_ICMPV6; ! } else { ! nat->in_pr[0] = IPPROTO_ICMP; ! nat->in_pr[1] = IPPROTO_ICMP; ! } nat->in_flags = IPN_ICMPQUERY; nat->in_spmin = $3.p1; |
From: Darren <dar...@us...> - 2012-07-09 15:57:17
|
Update of /cvsroot/ipfilter/ipfilter/tools In directory vz-cvs-4.sog:/tmp/cvs-serv5669/tools Modified Files: Tag: v5-1-RELEASE ipnat_y.y Log Message: 3541637 ipnat parser does not zero port fields for non-port protocol Index: ipnat_y.y =================================================================== RCS file: /cvsroot/ipfilter/ipfilter/tools/ipnat_y.y,v retrieving revision 1.19.2.10 retrieving revision 1.19.2.11 diff -C2 -d -r1.19.2.10 -r1.19.2.11 *** ipnat_y.y 7 Jul 2012 01:41:45 -0000 1.19.2.10 --- ipnat_y.y 9 Jul 2012 15:57:15 -0000 1.19.2.11 *************** *** 192,199 **** map: mapit ifnames addr tlate rhsaddr proxy mapoptions { nat->in_v[0] = $3.v; ! if ($3.f != 0 && $3.f != $5.f && $5.f != 0) { ! fprintf(stderr,"3.f=%d 5.f=%d\n", $3.f, $5.f); yyerror("3.address family mismatch"); - } if (nat->in_v[0] == 0 && $5.v != 0) nat->in_v[0] = $5.v; --- 192,197 ---- map: mapit ifnames addr tlate rhsaddr proxy mapoptions { nat->in_v[0] = $3.v; ! if ($3.f != 0 && $3.f != $5.f && $5.f != 0) yyerror("3.address family mismatch"); if (nat->in_v[0] == 0 && $5.v != 0) nat->in_v[0] = $5.v; *************** *** 1443,1456 **** nat->in_dcmp = 0; nat->in_scmp = 0; - nat->in_spmin = 0; - nat->in_spmax = 0; - nat->in_spnext = 0; nat->in_dpmin = 0; nat->in_dpmax = 0; nat->in_dpnext = 0; } break; } if ((nat->in_flags & (IPN_TCPUDP|IPN_FIXEDDPORT)) == IPN_FIXEDDPORT) nat->in_flags &= ~IPN_FIXEDDPORT; --- 1441,1464 ---- nat->in_dcmp = 0; nat->in_scmp = 0; nat->in_dpmin = 0; nat->in_dpmax = 0; nat->in_dpnext = 0; + nat->in_spmin = 0; + nat->in_spmax = 0; + nat->in_spnext = 0; } break; } + if ((nat->in_flags & (IPN_TCP|IPN_UDP)) == 0) { + nat->in_stop = 0; + nat->in_dtop = 0; + nat->in_osport = 0; + nat->in_odport = 0; + nat->in_stop = 0; + nat->in_osport = 0; + nat->in_dtop = 0; + nat->in_odport = 0; + } if ((nat->in_flags & (IPN_TCPUDP|IPN_FIXEDDPORT)) == IPN_FIXEDDPORT) nat->in_flags &= ~IPN_FIXEDDPORT; |
From: Darren <dar...@us...> - 2012-07-13 06:47:02
|
Update of /cvsroot/ipfilter/ipfilter/tools In directory vz-cvs-4.sog:/tmp/cvs-serv13535/tools Modified Files: Tag: v5-1-RELEASE ipnat_y.y Log Message: 3543404 ipnat.conf parsing uses family/ip version badly 3543403 incorrect line number printed in ipnat parsing errors Index: ipnat_y.y =================================================================== RCS file: /cvsroot/ipfilter/ipfilter/tools/ipnat_y.y,v retrieving revision 1.19.2.11 retrieving revision 1.19.2.12 diff -C2 -d -r1.19.2.11 -r1.19.2.12 *** ipnat_y.y 9 Jul 2012 15:57:15 -0000 1.19.2.11 --- ipnat_y.y 13 Jul 2012 06:47:00 -0000 1.19.2.12 *************** *** 191,196 **** map: mapit ifnames addr tlate rhsaddr proxy mapoptions ! { nat->in_v[0] = $3.v; ! if ($3.f != 0 && $3.f != $5.f && $5.f != 0) yyerror("3.address family mismatch"); if (nat->in_v[0] == 0 && $5.v != 0) --- 191,195 ---- map: mapit ifnames addr tlate rhsaddr proxy mapoptions ! { if ($3.f != 0 && $3.f != $5.f && $5.f != 0) yyerror("3.address family mismatch"); if (nat->in_v[0] == 0 && $5.v != 0) *************** *** 217,221 **** if (nat->in_v[1] == 0 && $5.v != 0) nat->in_v[1] = $5.v; - nat->in_v[0] = $3.v; if (nat->in_v[0] == 0 && $5.v != 0) nat->in_v[0] = $5.v; --- 216,219 ---- *************** *** 235,239 **** } | no mapit ifnames addr setproto ';' ! { nat->in_v[0] = $4.v; nat->in_osrcatype = $4.t; bcopy(&$4.a, &nat->in_osrc.na_addr[0], --- 233,238 ---- } | no mapit ifnames addr setproto ';' ! { if (nat->in_v[0] == 0) ! nat->in_v[0] = $4.v; nat->in_osrcatype = $4.t; bcopy(&$4.a, &nat->in_osrc.na_addr[0], *************** *** 245,250 **** } | mapit ifnames mapfrom tlate rhsaddr proxy mapoptions ! { nat->in_v[0] = ftov($3); ! if ($3 != 0 && $5.f != 0 && $3 != $5.f) yyerror("5.address family mismatch"); if (nat->in_v[0] == 0 && $5.v != 0) --- 244,248 ---- } | mapit ifnames mapfrom tlate rhsaddr proxy mapoptions ! { if ($3 != 0 && $5.f != 0 && $3 != $5.f) yyerror("5.address family mismatch"); if (nat->in_v[0] == 0 && $5.v != 0) *************** *** 266,271 **** } | mapit ifnames mapfrom tlate rhsaddr mapport mapoptions ! { nat->in_v[0] = ftov($3); ! if ($3 != 0 && $5.f != 0 && $3 != $5.f) yyerror("6.address family mismatch"); if (nat->in_v[0] == 0 && $5.v != 0) --- 264,268 ---- } | mapit ifnames mapfrom tlate rhsaddr mapport mapoptions ! { if ($3 != 0 && $5.f != 0 && $3 != $5.f) yyerror("6.address family mismatch"); if (nat->in_v[0] == 0 && $5.v != 0) *************** *** 286,291 **** mapblock: mapblockit ifnames addr tlate addr ports mapoptions ! { nat->in_v[0] = $3.v; ! if ($3.f != 0 && $5.f != 0 && $3.f != $5.f) yyerror("7.address family mismatch"); if (nat->in_v[0] == 0 && $5.v != 0) --- 283,287 ---- mapblock: mapblockit ifnames addr tlate addr ports mapoptions ! { if ($3.f != 0 && $5.f != 0 && $3.f != $5.f) yyerror("7.address family mismatch"); if (nat->in_v[0] == 0 && $5.v != 0) *************** *** 308,312 **** } | no mapblockit ifnames { yyexpectaddr = 1; } addr setproto ';' ! { nat->in_v[0] = $5.v; nat->in_osrcatype = $5.t; bcopy(&$5.a, &nat->in_osrc.na_addr[0], --- 304,311 ---- } | no mapblockit ifnames { yyexpectaddr = 1; } addr setproto ';' ! { if (nat->in_v[0] == 0) ! nat->in_v[0] = $5.v; ! if (nat->in_v[1] == 0) ! nat->in_v[1] = $5.v; nat->in_osrcatype = $5.t; bcopy(&$5.a, &nat->in_osrc.na_addr[0], *************** *** 322,329 **** { if ($6 != 0 && $3.f != 0 && $6 != $3.f) yyerror("21.address family mismatch"); ! if ($3.v != AF_UNSPEC) ! nat->in_v[0] = ftov($3.f); ! else ! nat->in_v[0] = ftov($6); nat->in_odstatype = $3.t; bcopy(&$3.a, &nat->in_odst.na_addr[0], --- 321,330 ---- { if ($6 != 0 && $3.f != 0 && $6 != $3.f) yyerror("21.address family mismatch"); ! if (nat->in_v[0] == 0) { ! if ($3.v != AF_UNSPEC) ! nat->in_v[0] = ftov($3.f); ! else ! nat->in_v[0] = ftov($6); ! } nat->in_odstatype = $3.t; bcopy(&$3.a, &nat->in_odst.na_addr[0], *************** *** 335,339 **** } | no rdrit ifnames addr dport setproto ';' ! { nat->in_v[0] = ftov($4.f); nat->in_odstatype = $4.t; bcopy(&$4.a, &nat->in_odst.na_addr[0], --- 336,341 ---- } | no rdrit ifnames addr dport setproto ';' ! { if (nat->in_v[0] == 0) ! nat->in_v[0] = ftov($4.f); nat->in_odstatype = $4.t; bcopy(&$4.a, &nat->in_odst.na_addr[0], *************** *** 347,354 **** { if ($5 != 0 && $3 != 0 && $5 != $3) yyerror("20.address family mismatch"); ! if ($3 != AF_UNSPEC) ! nat->in_v[0] = ftov($3); ! else ! nat->in_v[0] = ftov($5); setrdrifnames(); } --- 349,358 ---- { if ($5 != 0 && $3 != 0 && $5 != $3) yyerror("20.address family mismatch"); ! if (nat->in_v[0] == 0) { ! if ($3 != AF_UNSPEC) ! nat->in_v[0] = ftov($3); ! else ! nat->in_v[0] = ftov($5); ! } setrdrifnames(); } *************** *** 362,366 **** rewrite: IPNY_REWRITE oninout rwrproto mapfrom tlate newdst newopts ! { nat->in_v[0] = ftov($4); if (nat->in_redir & NAT_MAP) setmapifnames(); --- 366,371 ---- rewrite: IPNY_REWRITE oninout rwrproto mapfrom tlate newdst newopts ! { if (nat->in_v[0] == 0) ! nat->in_v[0] = ftov($4); if (nat->in_redir & NAT_MAP) setmapifnames(); *************** *** 372,376 **** divert: IPNY_DIVERT oninout rwrproto mapfrom tlate divdst newopts ! { nat->in_v[0] = ftov($4); if (nat->in_redir & NAT_MAP) { setmapifnames(); --- 377,382 ---- divert: IPNY_DIVERT oninout rwrproto mapfrom tlate divdst newopts ! { if (nat->in_v[0] == 0) ! nat->in_v[0] = ftov($4); if (nat->in_redir & NAT_MAP) { setmapifnames(); *************** *** 385,389 **** encap: IPNY_ENCAP oninout rwrproto mapfrom tlate encapdst newopts ! { nat->in_v[0] = ftov($4); if (nat->in_redir & NAT_MAP) { setmapifnames(); --- 391,396 ---- encap: IPNY_ENCAP oninout rwrproto mapfrom tlate encapdst newopts ! { if (nat->in_v[0] == 0) ! nat->in_v[0] = ftov($4); if (nat->in_redir & NAT_MAP) { setmapifnames(); *************** *** 422,426 **** oninout: ! inout IPNY_ON ifnames { nat->in_v[0] = 4; } ; --- 429,433 ---- oninout: ! inout IPNY_ON ifnames { ; } ; *************** *** 945,948 **** --- 952,957 ---- { bzero(&$$, sizeof($$)); $$.a = $1.a; + $$.f = $1.f; + $$.v = ftov($1.f); $$.t = FRI_NORMAL; ntomask($$.f, $3, (u_32_t *)&$$.m); *************** *** 951,956 **** $$.a.i6[2] &= $$.m.i6[2]; $$.a.i6[3] &= $$.m.i6[3]; - $$.f = $1.f; - $$.v = ftov($1.f); yyexpectaddr = 0; } --- 960,963 ---- *************** *** 978,981 **** --- 985,990 ---- $$.f = $1.f; $$.v = ftov($1.f); + if ($$.f == AF_INET6) + yyerror("incorrect inet6 mask"); } | hostname mask ipaddr { bzero(&$$, sizeof($$)); *************** *** 1509,1513 **** sprintf(msg, "%d:ioctl(zero nat rule)", ! yylineNum); return ipf_perror_fd(fd, ioctlfunc, msg); } --- 1518,1522 ---- sprintf(msg, "%d:ioctl(zero nat rule)", ! ipn->in_flineno); return ipf_perror_fd(fd, ioctlfunc, msg); } *************** *** 1529,1533 **** sprintf(msg, "%d:ioctl(delete nat rule)", ! yylineNum); return ipf_perror_fd(fd, ioctlfunc, msg); } --- 1538,1542 ---- sprintf(msg, "%d:ioctl(delete nat rule)", ! ipn->in_flineno); return ipf_perror_fd(fd, ioctlfunc, msg); } *************** *** 1539,1543 **** sprintf(msg, "%d:ioctl(add/insert nat rule)", ! yylineNum); if (errno == EEXIST) { sprintf(msg + strlen(msg), "(line %d)", --- 1548,1552 ---- sprintf(msg, "%d:ioctl(add/insert nat rule)", ! ipn->in_flineno); if (errno == EEXIST) { sprintf(msg + strlen(msg), "(line %d)", |
From: Darren <dar...@us...> - 2012-07-20 08:14:08
|
Update of /cvsroot/ipfilter/ipfilter/tools In directory vz-cvs-4.sog:/tmp/cvs-serv29879/tools Modified Files: Tag: v5-1-RELEASE ipnat_y.y Log Message: 3544313 remove nat encap feature 3544318 ipnat.conf parsing ignores LHS address family Index: ipnat_y.y =================================================================== RCS file: /cvsroot/ipfilter/ipfilter/tools/ipnat_y.y,v retrieving revision 1.19.2.12 retrieving revision 1.19.2.13 diff -C2 -d -r1.19.2.12 -r1.19.2.13 *** ipnat_y.y 13 Jul 2012 06:47:00 -0000 1.19.2.12 --- ipnat_y.y 20 Jul 2012 08:14:05 -0000 1.19.2.13 *************** *** 120,124 **** %token IPNY_TCP IPNY_UDP IPNY_TCPUDP IPNY_STICKY IPNY_MSSCLAMP IPNY_TAG %token IPNY_TLATE IPNY_POOL IPNY_HASH IPNY_NO IPNY_REWRITE IPNY_PROTO ! %token IPNY_ON IPNY_SRC IPNY_DST IPNY_IN IPNY_OUT IPNY_DIVERT IPNY_ENCAP %token IPNY_CONFIG IPNY_ALLOW IPNY_DENY IPNY_DNS IPNY_INET IPNY_INET6 %token IPNY_SEQUENTIAL IPNY_DSTLIST IPNY_PURGE --- 120,124 ---- %token IPNY_TCP IPNY_UDP IPNY_TCPUDP IPNY_STICKY IPNY_MSSCLAMP IPNY_TAG %token IPNY_TLATE IPNY_POOL IPNY_HASH IPNY_NO IPNY_REWRITE IPNY_PROTO ! %token IPNY_ON IPNY_SRC IPNY_DST IPNY_IN IPNY_OUT IPNY_DIVERT %token IPNY_CONFIG IPNY_ALLOW IPNY_DENY IPNY_DNS IPNY_INET IPNY_INET6 %token IPNY_SEQUENTIAL IPNY_DSTLIST IPNY_PURGE *************** *** 181,185 **** | rewrite ';' | divert ';' - | encap ';' ; --- 181,184 ---- *************** *** 195,200 **** --- 194,203 ---- if (nat->in_v[0] == 0 && $5.v != 0) nat->in_v[0] = $5.v; + else if (nat->in_v[0] == 0 && $3.v != 0) + nat->in_v[0] = $3.v; if (nat->in_v[1] == 0 && $5.v != 0) nat->in_v[1] = $5.v; + else if (nat->in_v[1] == 0 && $3.v != 0) + nat->in_v[1] = $3.v; nat->in_osrcatype = $3.t; bcopy(&$3.a, &nat->in_osrc.na_addr[0], *************** *** 216,221 **** --- 219,228 ---- if (nat->in_v[1] == 0 && $5.v != 0) nat->in_v[1] = $5.v; + else if (nat->in_v[0] == 0 && $3.v != 0) + nat->in_v[0] = $3.v; if (nat->in_v[0] == 0 && $5.v != 0) nat->in_v[0] = $5.v; + else if (nat->in_v[1] == 0 && $3.v != 0) + nat->in_v[1] = $3.v; nat->in_osrcatype = $3.t; bcopy(&$3.a, &nat->in_osrc.na_addr[0], *************** *** 248,253 **** --- 255,264 ---- if (nat->in_v[0] == 0 && $5.v != 0) nat->in_v[0] = $5.v; + else if (nat->in_v[0] == 0 && $3 != 0) + nat->in_v[0] = ftov($3); if (nat->in_v[1] == 0 && $5.v != 0) nat->in_v[1] = $5.v; + else if (nat->in_v[1] == 0 && $3 != 0) + nat->in_v[1] = ftov($3); nat->in_nsrcatype = $5.t; nat->in_nsrcafunc = $5.u; *************** *** 268,273 **** --- 279,288 ---- if (nat->in_v[0] == 0 && $5.v != 0) nat->in_v[0] = $5.v; + else if (nat->in_v[0] == 0 && $3 != 0) + nat->in_v[0] = ftov($3); if (nat->in_v[1] == 0 && $5.v != 0) nat->in_v[1] = $5.v; + else if (nat->in_v[1] == 0 && $3 != 0) + nat->in_v[1] = ftov($3); nat->in_nsrcatype = $5.t; nat->in_nsrcafunc = $5.u; *************** *** 287,292 **** --- 302,311 ---- if (nat->in_v[0] == 0 && $5.v != 0) nat->in_v[0] = $5.v; + else if (nat->in_v[0] == 0 && $3.v != 0) + nat->in_v[0] = $3.v; if (nat->in_v[1] == 0 && $5.v != 0) nat->in_v[1] = $5.v; + else if (nat->in_v[1] == 0 && $3.v != 0) + nat->in_v[1] = $3.v; nat->in_osrcatype = $3.t; bcopy(&$3.a, &nat->in_osrc.na_addr[0], *************** *** 390,407 **** ; - encap: IPNY_ENCAP oninout rwrproto mapfrom tlate encapdst newopts - { if (nat->in_v[0] == 0) - nat->in_v[0] = ftov($4); - if (nat->in_redir & NAT_MAP) { - setmapifnames(); - nat->in_pr[0] = IPPROTO_IPIP; - } else { - setrdrifnames(); - nat->in_pr[1] = IPPROTO_IPIP; - } - nat->in_flags &= ~IPN_TCPUDP; - } - ; - tlate: IPNY_TLATE { yyexpectaddr = 1; } ; --- 409,412 ---- *************** *** 483,495 **** ; - encapdst: - src addr dst addr { nat->in_nsrc.na_addr[0] = $2.a; - nat->in_nsrc.na_addr[1] = $2.m; - nat->in_ndst.na_addr[0] = $4.a; - nat->in_ndst.na_addr[1] = $4.m; - nat->in_redir |= NAT_ENCAP; - } - ; - src: IPNY_SRC { yyexpectaddr = 1; } ; --- 488,491 ---- *************** *** 1259,1263 **** { "dst", IPNY_DST }, { "dstlist", IPNY_DSTLIST }, - { "encap", IPNY_ENCAP }, { "frag", IPNY_FRAG }, { "from", IPNY_FROM }, --- 1255,1258 ---- |
From: Darren <dar...@us...> - 2012-08-25 14:14:10
|
Update of /cvsroot/ipfilter/ipfilter/tools In directory vz-cvs-4.sog:/tmp/cvs-serv20246/tools Modified Files: Tag: v5-1-RELEASE ipnat_y.y Log Message: 3561691 gethost never returns an ipv6 address Index: ipnat_y.y =================================================================== RCS file: /cvsroot/ipfilter/ipfilter/tools/ipnat_y.y,v retrieving revision 1.19.2.13 retrieving revision 1.19.2.14 diff -C2 -d -r1.19.2.13 -r1.19.2.14 *** ipnat_y.y 20 Jul 2012 08:14:05 -0000 1.19.2.13 --- ipnat_y.y 25 Aug 2012 14:14:08 -0000 1.19.2.14 *************** *** 870,876 **** free($2); if ($3.p1 < 0 || $3.p1 > 65535) ! yyerror("invalid ICMP Id number"); if ($3.p2 < 0 || $3.p2 > 65535) ! yyerror("invalid ICMP Id number"); if (strcmp($2, "ipv6-icmp") == 0) { nat->in_pr[0] = IPPROTO_ICMPV6; --- 870,876 ---- free($2); if ($3.p1 < 0 || $3.p1 > 65535) ! yyerror("invalid 1st ICMP Id number"); if ($3.p2 < 0 || $3.p2 > 65535) ! yyerror("invalid 2nd ICMP Id number"); if (strcmp($2, "ipv6-icmp") == 0) { nat->in_pr[0] = IPPROTO_ICMPV6; *************** *** 1163,1177 **** hostname: YY_STR { i6addr_t addr; bzero(&$$, sizeof($$)); ! if (gethost(AF_INET, $1, ! &addr) == 0) { ! $$.a = addr; ! $$.f = AF_INET; ! } else ! if (gethost(AF_INET6, $1, &addr) == 0) { $$.a = addr; - $$.f = AF_INET6; } else { FPRINTF(stderr, --- 1163,1179 ---- hostname: YY_STR { i6addr_t addr; + int family; + #ifdef USE_INET6 + if (nat->in_v[0] == 6) + family = AF_INET6; + else + #endif + family = AF_INET; bzero(&$$, sizeof($$)); ! $$.f = family; ! if (gethost(family, $1, &addr) == 0) { $$.a = addr; } else { FPRINTF(stderr, *************** *** 1426,1429 **** --- 1428,1434 ---- nat->in_flags &= ~IPN_TCP; break; + #ifdef USE_INET6 + case IPPROTO_ICMPV6 : + #endif case IPPROTO_ICMP : nat->in_flags &= ~IPN_TCPUDP; |
From: Darren <dar...@us...> - 2014-06-08 14:46:01
|
Update of /cvsroot/ipfilter/ipfilter/tools In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv17069/tools Modified Files: Tag: v5-1-RELEASE ipnat_y.y Log Message: #547 rule parsing puts junk at the end of ipf rules Index: ipnat_y.y =================================================================== RCS file: /cvsroot/ipfilter/ipfilter/tools/ipnat_y.y,v retrieving revision 1.19.2.14 retrieving revision 1.19.2.15 diff -C2 -d -r1.19.2.14 -r1.19.2.15 *** ipnat_y.y 25 Aug 2012 14:14:08 -0000 1.19.2.14 --- ipnat_y.y 8 Jun 2014 14:45:58 -0000 1.19.2.15 *************** *** 1766,1770 **** nlen = strlen(name) + 1; ! n = realloc(*np, (*np)->in_size + nlen); if (*np == nattop) nattop = n; --- 1766,1772 ---- nlen = strlen(name) + 1; ! n = calloc(1, (*np)->in_size + nlen); ! bcopy(*np, n, (*np)->in_size + nlen); ! free(*np); if (*np == nattop) nattop = n; |
From: Darren <dar...@us...> - 2014-06-09 15:51:30
|
Update of /cvsroot/ipfilter/ipfilter/tools In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv32058/tools Modified Files: Tag: v5-1-RELEASE ipnat_y.y Log Message: #547 rule parsing puts junk at the end of ipf rules Index: ipnat_y.y =================================================================== RCS file: /cvsroot/ipfilter/ipfilter/tools/ipnat_y.y,v retrieving revision 1.19.2.15 retrieving revision 1.19.2.16 diff -C2 -d -r1.19.2.15 -r1.19.2.16 *** ipnat_y.y 8 Jun 2014 14:45:58 -0000 1.19.2.15 --- ipnat_y.y 9 Jun 2014 15:51:27 -0000 1.19.2.16 *************** *** 1767,1771 **** nlen = strlen(name) + 1; n = calloc(1, (*np)->in_size + nlen); ! bcopy(*np, n, (*np)->in_size + nlen); free(*np); if (*np == nattop) --- 1767,1771 ---- nlen = strlen(name) + 1; n = calloc(1, (*np)->in_size + nlen); ! bcopy(*np, n, (*np)->in_size); free(*np); if (*np == nattop) |
From: Darren <dar...@us...> - 2014-06-17 11:53:47
|
Update of /cvsroot/ipfilter/ipfilter/tools In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv28471/tools Modified Files: Tag: v5-1-RELEASE ipnat_y.y Log Message: #552 destination port not zero after parsing nat rule Index: ipnat_y.y =================================================================== RCS file: /cvsroot/ipfilter/ipfilter/tools/ipnat_y.y,v retrieving revision 1.19.2.16 retrieving revision 1.19.2.17 diff -C2 -d -r1.19.2.16 -r1.19.2.17 *** ipnat_y.y 9 Jun 2014 15:51:27 -0000 1.19.2.16 --- ipnat_y.y 17 Jun 2014 11:53:44 -0000 1.19.2.17 *************** *** 1057,1061 **** portstuff: ! compare portspec { $$.pc = $1; $$.p1 = $2; } | portspec range portspec { $$.pc = $2; $$.p1 = $1; $$.p2 = $3; } ; --- 1057,1061 ---- portstuff: ! compare portspec { $$.pc = $1; $$.p1 = $2; $$.p2 = 0; } | portspec range portspec { $$.pc = $2; $$.p1 = $1; $$.p2 = $3; } ; *************** *** 1150,1154 **** free($1); if ($$ == -1) ! yyerror("unknwon protocol"); if ($$ != IPPROTO_TCP && $$ != IPPROTO_UDP) --- 1150,1154 ---- free($1); if ($$ == -1) ! yyerror("unknown protocol"); if ($$ != IPPROTO_TCP && $$ != IPPROTO_UDP) *************** *** 1172,1175 **** --- 1172,1176 ---- family = AF_INET; bzero(&$$, sizeof($$)); + bzero(&addr, sizeof(addr)); $$.f = family; if (gethost(family, $1, *************** *** 1510,1514 **** if (opts & OPT_DEBUG) ! binprint(ipn, sizeof(*ipn)); if ((opts & OPT_ZERORULEST) != 0) { --- 1511,1515 ---- if (opts & OPT_DEBUG) ! binprint(ipn, ipn->in_size); if ((opts & OPT_ZERORULEST) != 0) { |