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

全部博文(64)

文章存档

2013年(1)

2011年(19)

2010年(42)

2009年(2)

分类: LINUX

2010-04-17 12:34:49

.第三个包established

(1)到达G_W

      ct->tuplehash[IP_CT_DIR_ORIGNAL].tuple=

                                     src:C_W:xx

    661         if ((h) == ) {

    662                 *ctinfo = + ;

    663                 /* Please set reply bit if this packet OK */

    664                 * = 1;

    665         } else {

    666                 /* Once we've had two way comms, always ESTABLISHED. */

    667                 if ((, &ct->)) {

    668                         ("nf_conntrack_in: normal packet for %p\n", ct);

    669                         *ctinfo = ;

    670                 } else if ((, &ct->)) {

    671                         ("nf_conntrack_in: related packet for %p\n",

    672                                  ct);

    673                         *ctinfo = ;

    674                 } else {

    675                         ("nf_conntrack_in: new packet for %p\n", ct);

    676                         *ctinfo = ;

    677                 }

    678                 * = 0;

    679         }

    680         -> = &ct->;

    681         -> = *ctinfo;

(, &ct->)成立,所以,ctinfo=

 - - ->

 所以,dir=IP_CT_DIR_ORIGNAL;

 

    396         enum = ();

PREROUTINGmtype=

于是:

    401                 statusbit = ;

由于之前建立连接时ct->status设置成了DNAT;所以,

/* Non-atomic: these bits don't change. */

    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[reply].tuple)=

                                     src:C_W:xx

                                     dst:S_L:80

 

else {

    382                 (&->, ->, target->..);

    383                 -> = target->..;

    384         }

于是,数据包成为:

          src:C_W:xx

          dst:S_L:80

 

 

(2)G_L

路由之后,来到POSTROUTING

 

    399                 statusbit = ;

 

    408         if (ct-> & statusbit) 则为假。

执行完毕;

ipv4_confirm

没有可confirmed;


 

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