[ipfilter-cvs] ipfilter/tools ipnat_y.y,
Brought to you by:
darren_r
From: Darren <dar...@us...> - 2012-07-20 08:13:43
|
Update of /cvsroot/ipfilter/ipfilter/tools In directory vz-cvs-4.sog:/tmp/cvs-serv29861/tools Modified Files: 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.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** ipnat_y.y 13 Jul 2012 06:46:45 -0000 1.31 --- ipnat_y.y 20 Jul 2012 08:13:41 -0000 1.32 *************** *** 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 ---- |