分类: LINUX
2010-04-17 12:35:51
数据包如下:
src:S_L:80
dst:C_W:xx
662 *ctinfo = + ;
399 statusbit = ;
400
else
401 statusbit = ;
402
403 /* Invert if this is
reply dir. */
404 if
(dir == )
405 statusbit ^= ;
406
所以statusbit=
路由之后,来到POSTROUTING
-
> - - - >nf_nat_packet
399 statusbit = ;
402
403 /* Invert if this is
reply dir. */
404 if
(dir == )
得到statusbit=
408 if
(ct-> & statusbit) {
409 struct ;
410
411 /* We are aiming to
look like inverse of other direction. */
412 (&target, &ct->[!dir].);
413
414 if (!(target.., , 0, &target, ))
415 return ;
416 }
target=invert(ct->tuplehash[orig].tuple);
src:G_W:80
dst:C_W:xx
进入manip_pkt;
378 if
( == ) {
379 (&->, ->, target->..);
380 -> = target->..;
381 } else
{
于是ip数据包变成:
src:G_W:80
dst:C_W:xx
Over!