Chinaunix首页 | 论坛 | 博客
  • 博客访问: 451052
  • 博文数量: 64
  • 博客积分: 3271
  • 博客等级: 中校
  • 技术积分: 727
  • 用 户 组: 普通用户
  • 注册时间: 2009-07-30 18:42
文章分类

全部博文(64)

文章存档

2013年(1)

2011年(19)

2010年(42)

2009年(2)

分类: LINUX

2010-04-17 12:35:51

.再次REPLY

数据包如下:

      src:S_L:80

      dst:C_W:xx

(1)到达G_L

    662                 *ctinfo = + ;

    399                 statusbit = ;

    400         else

    401                 statusbit = ;

    402

    403         /* Invert if this is reply dir. */

    404         if (dir == )

    405                 statusbit ^= ;

    406

所以statusbit=

 

(2)G_W

路由之后,来到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);

     srcG_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!

 

 

阅读(880) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~