[ipfilter-cvs] ipfilter/tools ipnat_y.y,v5-1-RELEASE
Brought to you by:
darren_r
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; |