Главная страница


ru.unix.bsd

 
 - RU.UNIX.BSD ------------------------------------------------------------------
 From : Dmitry Pryanishnikov                 2:464/36       14 Apr 2003  19:35:53
 To : All
 Subject : =?koi8-r?Q?Re=3A_natd_=C9_ipfw_dynamic_rules_=D6=C9=D7=D5=D4?=
 -------------------------------------------------------------------------------- 
 
 .MSGID: atlantis.atlantis.dp.ua 01ca4f5b
 .REPLY: bspu.secna.ru d87ab284
 .REPLYADDR: dmitry@atlantis.dp.ua
 .REPLYTO: 2:464/36@fidonet UUCP
 .RFC-Message-ID: <20030414191841.U19277-100000@atlantis.atlantis.dp.ua>
 .RFC-References: <1050083089@p48.f1489.n5030.z2> <b78uq2$18tj$1@bspu.secna.ru>
 From: Dmitry Pryanishnikov <dmitry@atlantis.dp.ua>
 Subject: =?koi8-r?Q?Re=3A_natd_=C9_ipfw_dynamic_rules_=D6=C9=D7=D5=D4?=
  =?koi8-r?Q?_=D7=CD=C5=D3=D4=C5=3F?=
 Привет!
 
 On Sat, 12 Apr 2003, mitrohin a.s. wrote:
 
 > ps  ipfw(8)
 > BUGS
 >      Packets diverted to userland, and then reinserted by a userland process
 >      (such as natd(8)) will lose various packet attributes, including their
 >      source interface.  If a packet is reinserted in this manner, later rules
 >      may be incorrectly applied, making the order of divert rules in the rule
 >      sequence very important.
 >
 > так что после диверта конструкция out xmit X recv Y может и не работать ;)
 
  Тем не менее, на практике работает. В man 4 divert написано следующее:
 
      (if the packet was outgoing). In the case of an incoming packet the
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      interface name will also be placed in the 8 bytes following the address,
      (assuming it fits).
 
 Однако, подчеркнутое не стыкуется с исходником /sys/netinet/ip_divert.c:
 
        /*
          * Record the incoming interface name whenever we have one.
          */
         bzero(&divsrc.sin_zero, sizeof(divsrc.sin_zero));
         if (m->m_pkthdr.rcvif) {
                 /*
                  * Hide the actual interface name in there in the
                  * sin_zero array. XXX This needs to be moved to a
                  * different sockaddr type for divert, e.g.
                  * sockaddr_div with multiple fields like
                  * sockaddr_dl. Presently we have only 7 bytes
                  * but that will do for now as most interfaces
                  * are 4 or less + 2 or less bytes for unit.
 
 То есть, на самом деле имя входного интерфейса сохраняется после обработки,
 к примеру, natd, если только оно не длиннее 7 байт.
 
 Sincerely, Dmitry
 -- 
 Atlantis ISP, System Administrator
 e-mail:  dmitry@atlantis.dp.ua
 nic-hdl: LYNX-RIPE
 
 --- ifmail v.2.14.os-p7
  * Origin: Atlantis ISP (2:464/36@fidonet)
 
 

Вернуться к списку тем, сортированных по: возрастание даты  уменьшение даты  тема  автор 

 Тема:    Автор:    Дата:  
 =?koi8-r?Q?Re=3A_natd_=C9_ipfw_dynamic_rules_=D6=C9=D7=D5=D4?=   Dmitry Pryanishnikov   14 Apr 2003 19:35:53 
Архивное /ru.unix.bsd/1265020699.html, оценка 2 из 5, голосов 10
Яндекс.Метрика
Valid HTML 4.01 Transitional