Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Jun 2004 03:27:19 GMT
From:      Kensaku MASUDA <greg@greg.jp>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/67780: Can not communicate between IGD and mapped host
Message-ID:  <200406100327.i5A3RJYI006662@www.freebsd.org>
Resent-Message-ID: <200406100330.i5A3URSu095452@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         67780
>Category:       ports
>Synopsis:       Can not communicate between IGD and mapped host
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jun 10 03:30:26 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator:     Kensaku MASUDA
>Release:        
>Organization:
>Environment:
FreeBSD apollon.greg.rim.or.jp 4.10-PRERELEASE FreeBSD 4.10-PRERELEASE #2: Wed May 19 18:22:46 JST 2004     greg@apollon.greg.rim.or.jp:/a/uzume/export/src/system-4-stable/src/sys/compile/apollon.greg.rim.or.jp  i386

>Description:
      Linux IGD work fine on my gateway. Look no problem with Windows Messenger on XP.
And install SER(SIP Express Router) for SIP client(Using Windows Messenger).
By the way, My gateway host has two ethernet interface ep0 and fxp0. ep0 is outer interface that have global IP4 address, fxp0 is internal interface that have private IP4 address and global IPV6 prefix. Windows box in internal segment.
      At this situation, Messenger request into IGD(FreeBSD box) for global from private(UDP & TCP ports). Port mapping was successed at that time.
Next, Windows Messenger regist self to SER using mapped information. SER will sent reply message into mapped address(result may be change SER settings, but working setting is only this pattern). But register can not recieve reply message.
The reply message's destination is outer IGD address/port. But, reciever dose not exist on FeeeBSD box, and Do not rewrite reply packet, because it passes through lo0.
      I think it was no problem, if rewriting on lo0. And Try it. a problem look solved with method.

>How-To-Repeat:
      Install linux-igd and SER on gateway box, and SIP user agent run on internal windows box.
SIP client regist myself into SER. 
>Fix:
      Here is patch for linux-idg ports.
Point of solution, Mapped information need outer interface and loop back interface.

--- files/patch-pmlist.cpp.orig      Thu Jan 23 14:28:57 2003
+++ files/patch-pmlist.cpp Wed May 26 23:56:30 2004
@@ -1,5 +1,5 @@
---- pmlist.cpp.orig    Fri Jan  3 03:14:24 2003
-+++ pmlist.cpp Mon Jan 20 20:38:16 2003
+--- linux-igd/pmlist.cpp.orig  Fri Jan  3 04:14:24 2003
++++ linux-igd/pmlist.cpp       Wed May 26 10:37:36 2004
 @@ -31,6 +31,8 @@
  #include <unistd.h>
  #include <iostream>
@@ -9,7 +9,7 @@
  PortMapList::PortMapList()
  {
  
-@@ -182,8 +184,13 @@
+@@ -182,8 +184,16 @@
  {
        char command[255];
  
@@ -18,22 +18,28 @@
 +      FILE *ipnat = popen("/sbin/ipnat -f -", "w");
 +      if (ipnat == NULL)
 +              return 0;
-+      sprintf(command, "rdr %s %s/32 port %d -> %s port %d %s",
++      sprintf(command, "rdr %s %s/32 port %d -> %s port %d %s\n",
 +              ExtIf, ExtIP, ExtPort, IntIP, IntPort, Proto);
 +      fprintf(ipnat, command);
++      sprintf(command, "rdr lo0 %s/32 port %d -> %s port %d %s\n",
++              ExtIP, ExtPort, IntIP, IntPort, Proto);
++      fprintf(ipnat, command);
 +      pclose(ipnat);
  
        return (1);
  }
-@@ -218,9 +225,14 @@
+@@ -218,9 +228,17 @@
  {
        char command[255];
  
 +      FILE *ipnat = popen("/sbin/ipnat -rf -", "w");
 +      if (ipnat == NULL)
 +              return 0;
-+      sprintf(command, "rdr %s %s/32 port %d -> %s port %d %s",
++      sprintf(command, "rdr %s %s/32 port %d -> %s port %d %s\n",
 +              ExtIf, ExtIP, ExtPort, IntIP, IntPort, Proto);
++      fprintf(ipnat, command);
++      sprintf(command, "rdr lo0 %s/32 port %d -> %s port %d %s\n",
++              ExtIP, ExtPort, IntIP, IntPort, Proto);
 +      fprintf(ipnat, command);
 +      pclose(ipnat);

And replacable patch-pmlist.cpp was here.
begin 664 patch-pmlist.cpp.gz
M'XL("!ZPM$`"`W!A=&-H+7!M;&ES="YC<'``[9-=;],P%(:ODU_Q*BA2NL1M
M/KJNI&SJI'6HJ"O5M(D+X")KDLTH<2S'$9T0_QW;M*B":H!`7'%CZWSY/*^/
M30A!15FW(?0^'_"ZHJWLKSGO-X+>6Y>"XE7&@`3A,(V&:3Q$'(:)[?O^P3+K
M39'C*GM$/$(4ILE)FHQTQ=">3D&2*!C!5^L8TZF-9Y2MJRXO\*)CJC[O/YSM
M.VG32E%DM7+:?K&1A6!8/V0"1[.-G)<3V[>Q:H2\ROA"E:?IGN'U;'Q2=;IK
M-(Y50S\:#X-H9!JKB&5.6C=UG;'\;7Q\_'ZBTHG5<D&9++UM)'`&72L&[1UE
M`\IE=E<5+8@$RR3(.5;7L^O7MS?SY4L0#E>%<K.2G"L6N#G(!UPLSV^42S8J
ME+JY$V`E&MD$T#)69M/D`>;,V&K3=F^B<1Y;6=0[&N7RK<OY8H8CRC7"*7C#
M"^8Y.T+#58*H)LY'Q^33$MXV^Q3+V\6BIYR6*&2G[C/4&=]KAB-RH76X[2")
M\4W*F?;M++=]QYQ`'V6F\3,U6]&&J-SV,U0!]L4=1JF:\#=8_AB"KZNF+;Y&
M>OI98'==7J3MS^99Q=$X>`X_CL=!=/+DL[)^:6KB_]C^\MC(`:XGOO/%O__.
.UH]/"_87A#-&HI,%````
`
end

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200406100327.i5A3RJYI006662>