<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:Batang;
        panose-1:2 3 6 0 0 1 1 1 1 1;}
@font-face
        {font-family:Gulim;
        panose-1:2 11 6 0 0 1 1 1 1 1;}
@font-face
        {font-family:GulimChe;
        panose-1:2 11 6 9 0 1 1 1 1 1;}
@font-face
        {font-family:Gulim;
        panose-1:2 11 6 0 0 1 1 1 1 1;}
@font-face
        {font-family:Batang;
        panose-1:2 3 6 0 0 1 1 1 1 1;}
@font-face
        {font-family:GulimChe;
        panose-1:2 11 6 9 0 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        text-align:justify;
        text-justify:inter-ideograph;
        text-autospace:none;
        word-break:break-hangul;
        font-size:10.0pt;
        font-family:Batang;}
h4
        {margin:0cm;
        margin-bottom:.0001pt;
        page-break-after:avoid;
        text-autospace:none;
        word-break:break-hangul;
        font-size:10.0pt;
        font-family:GulimChe;}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:Gulim;
        color:windowtext;}
/* Page Definitions */
@page Section1
        {size:595.3pt 841.9pt;
        margin:99.25pt 3.0cm 3.0cm 3.0cm;
        layout-grid:18.0pt;}
div.Section1
        {page:Section1;}
-->
</style>
</head>
<body lang=KO link=blue vlink=purple>
<div class=Section1 style='layout-grid:18.0pt'>
<p class=MsoNormal><font size=2 face=굴림><span lang=EN-US
style='font-size:10.0pt;font-family:Gulim'>Hi.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=굴림><span lang=EN-US
style='font-size:10.0pt;font-family:Gulim'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=굴림><span lang=EN-US
style='font-size:10.0pt;font-family:Gulim'>In special network condition, I
found that TPROXY didn</span></font><font face=Arial><span lang=EN-US
style='font-family:Arial'>’</span></font><font face=굴림><span
lang=EN-US style='font-family:Gulim'>t work. <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=굴림><span lang=EN-US
style='font-size:10.0pt;font-family:Gulim'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=굴림><span lang=EN-US
style='font-size:10.0pt;font-family:Gulim'>I tried to change source ip to
another using below code.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=굴림><span lang=EN-US
style='font-size:10.0pt;font-family:Gulim'>==================== CODE START ========================<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=굴림><span lang=EN-US
style='font-size:10.0pt;font-family:Gulim'>itp.op
= TPROXY_ASSIGN;<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=굴림><span lang=EN-US
style='font-size:10.0pt;font-family:Gulim'>itp.v.addr.faddr = (another);<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=굴림><span lang=EN-US
style='font-size:10.0pt;font-family:Gulim'>itp.v.addr.fport = htons(0);<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=굴림><span lang=EN-US
style='font-size:10.0pt;font-family:Gulim'>setsockopt(s, SOL_IP, IP_TPROXY,
&itp, sizeof(itp));<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=굴림><span lang=EN-US
style='font-size:10.0pt;font-family:Gulim'>itp.op
= TPROXY_FLAGS;<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=굴림><span lang=EN-US
style='font-size:10.0pt;font-family:Gulim'>itp.v.flags = ITP_CONNECT;<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=바탕><span lang=EN-US
style='font-size:10.0pt'>setsockopt(s, SOL_IP, IP_TPROXY, &itp, sizeof(itp));<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=굴림><span lang=EN-US
style='font-size:10.0pt;font-family:Gulim'>==================== CODE END ==========================<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=바탕><span lang=EN-US
style='font-size:10.0pt'>It goes well when general TCP/IP state.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=바탕><span lang=EN-US
style='font-size:10.0pt'>But in case tcp sequence number of received packet is something
wierd, <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=바탕><span lang=EN-US
style='font-size:10.0pt'>LINUX tcp/ip stack make be zero sequence number and
ack number.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=바탕><span lang=EN-US
style='font-size:10.0pt'>And source ip address is not changed !!!<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=바탕><span lang=EN-US
style='font-size:10.0pt'>Of cource other sessions</span></font><font
face="Times New Roman"><span lang=EN-US style='font-family:"Times New Roman"'>’</span></font><span
lang=EN-US>s source ip address is changed very well.<o:p></o:p></span></p>
<p class=MsoNormal><font size=2 face=바탕><span lang=EN-US><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=바탕><span lang=EN-US
style='font-size:10.0pt'>Especially only if I connect to windows system, this
is occurred. <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=바탕><span lang=EN-US><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=바탕><span lang=EN-US
style='font-size:10.0pt'>My System Info:<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=바탕><span lang=EN-US
style='font-size:10.0pt'>O S : linux-2.6.9<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=바탕><span lang=EN-US
style='font-size:10.0pt'>TRPOXY verserion : 2.0.1<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=바탕><span lang=EN-US
style='font-size:10.0pt'>ETC. : Using Bridge network<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=바탕><span lang=EN-US><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=바탕><span lang=EN-US
style='font-size:10.0pt'>Now, I am studying TCP/IP kernel stack. And My eyes
and my head is very dizzy.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=바탕><span lang=EN-US><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=바탕><span lang=EN-US
style='font-size:10.0pt'>Thanks.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=바탕><span lang=EN-US><o:p> </o:p></span></font></p>
</div>
</body>
</html>