View unanswered posts | View active topics It is currently Thu Aug 16, 2018 4:56 am



Post new topic Reply to topic  [ 9 posts ] 
 options inet6 in resolv.conf will kill xplico 
Author Message

Joined: Tue Jul 12, 2011 8:04 pm
Posts: 5
Reply with quote
Post options inet6 in resolv.conf will kill xplico
Hello,

I'm trying xplico and i found a way to prevent it from working.
More seriously, since I have an ipv6 prefix, i want to use ipv6 so put "options inet6" in my resolv.conf.
If I don't comment the it, xplico refuse to start and died with a sigpipe.

here the strace log :

Code:
open("/etc/resolv.conf", O_RDONLY)      = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=169, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f7625f03000
read(3, "domain "..., 4096) = 169
read(3, "", 4096)                       = 0
close(3)                                = 0
munmap(0x7f7625f03000, 4096)            = 0
socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 3
connect(3, {sa_family=AF_INET6, sin6_port=htons(23457), inet_pton(AF_INET6, "0:0:0:ffff::", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0}, 16) = -1 EAFNOSUPPORT (Address family not supported by protocol)
nanosleep({0, 500000000}, 0x7fffdd373570) = 0
connect(3, {sa_family=AF_INET6, sin6_port=htons(23457), inet_pton(AF_INET6, "0:0:0:ffff::", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0}, 16) = -1 EAFNOSUPPORT (Address family not supported by protocol)
nanosleep({1, 500000000}, 0x7fffdd373570) = 0
connect(3, {sa_family=AF_INET6, sin6_port=htons(23457), inet_pton(AF_INET6, "0:0:0:ffff::", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0}, 16) = -1 EAFNOSUPPORT (Address family not supported by protocol)
nanosleep({2, 500000000}, 0x7fffdd373570) = 0
connect(3, {sa_family=AF_INET6, sin6_port=htons(23457), inet_pton(AF_INET6, "0:0:0:ffff::", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0}, 16) = -1 EAFNOSUPPORT (Address family not supported by protocol)
nanosleep({3, 500000000}, 0x7fffdd373570) = 0
connect(3, {sa_family=AF_INET6, sin6_port=htons(23457), inet_pton(AF_INET6, "0:0:0:ffff::", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0}, 16) = -1 EAFNOSUPPORT (Address family not supported by protocol)
nanosleep({4, 500000000}, 0x7fffdd373570) = 0
connect(3, {sa_family=AF_INET6, sin6_port=htons(23457), inet_pton(AF_INET6, "0:0:0:ffff::", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0}, 16) = -1 EAFNOSUPPORT (Address family not supported by protocol)
nanosleep({5, 500000000}, 0x7fffdd373570) = 0
write(3, "\25\0\0\0", 4)                = -1 EPIPE (Broken pipe)
--- SIGPIPE (Broken pipe) @ 0 (0) ---
+++ killed by SIGPIPE +++


The use of options inet seems to block xplico to connect to the mwmail program (what is this program ???) : it doesn't use the ipv6 loopback address (::1) but a particular address which I don't know where it come from (0:0:0:ffff::)

Did someone have an idea ?
I've done a little grep 127.0.0.1 on the directory, and there are a lot of answer. Could we just change all the 127.0.0.1 to localhost, which will resolve in an ipv4 or an ipv6 environnement?

If you need more logs or more tests/ code source modification, just ask them ;).

Cordially


Wed Jul 13, 2011 5:29 pm
Profile
Site Admin

Joined: Wed Sep 16, 2009 10:09 pm
Posts: 394
Reply with quote
Post Re: options inet6 in resolv.conf will kill xplico
Quote:
what is this program ???

The mwmail is the WebMail Manipulator. Xplico (as decoder) connects with the Manipulators through a AF_INET socket (on localhost => 127.0.0.1).

Quote:
Could we just change all the 127.0.0.1 to localhost, which will resolve in an ipv4 or an ipv6 environnement?

We are very busy an we can not resolve the problem quickly. Can you try to chance the define DM_XPLICO_MANIP in dema.h (system/dema/include/) from
Code:
#define DM_XPLICO_MANIP          "MANIP=%s   MPHOST=127.0.0.1  MPPORT=%s"

to
Code:
#define DM_XPLICO_MANIP          "MANIP=%s   MPHOST=localhost  MPPORT=%s"


But, if your localhost is only IPv6 and we use AF_INET instead AF_INET6 I think it will not work.



Ciao
Gianluca


Thu Jul 14, 2011 7:11 am
Profile WWW

Joined: Tue Jul 12, 2011 8:04 pm
Posts: 5
Reply with quote
Post Re: options inet6 in resolv.conf will kill xplico
Quote:
We are very busy an we can not resolve the problem quickly.

I didn't expect you do.
It was a mere bug reports. If i need to use xplico, i just comment the line on my system ;)

Quote:
Can you try to chance the define DM_XPLICO_MANIP in dema.h (system/dema/include/) from
Code:
#define DM_XPLICO_MANIP          "MANIP=%s   MPHOST=127.0.0.1  MPPORT=%s"

to
Code:
#define DM_XPLICO_MANIP          "MANIP=%s   MPHOST=localhost  MPPORT=%s"


But, if your localhost is only IPv6 and we use AF_INET instead AF_INET6 I think it will not work.


I've done it, but there are no change.
I've also tried with "::1", without success.

What is weird: sa_family is "AF_INET6" in the strace, and not AF_INET (my computer is dual stack, so it can use IPv4 as well).

Cordially


Thu Jul 14, 2011 8:11 pm
Profile
Site Admin

Joined: Wed Sep 16, 2009 10:09 pm
Posts: 394
Reply with quote
Post Re: options inet6 in resolv.conf will kill xplico
Your test results come from XI (= web xplico interface) or from CLI?


Fri Jul 15, 2011 1:21 pm
Profile WWW

Joined: Tue Jul 12, 2011 8:04 pm
Posts: 5
Reply with quote
Post Re: options inet6 in resolv.conf will kill xplico
gianluca.costa wrote:
Your test results come from XI (= web xplico interface) or from CLI?

Sorry to not have specified this point.
All my test wre done from the CLI.


Fri Jul 15, 2011 5:26 pm
Profile
Site Admin

Joined: Wed Sep 16, 2009 10:09 pm
Posts: 394
Reply with quote
Post Re: options inet6 in resolv.conf will kill xplico
Well,
then you can try to change the file xplico-0.6.3/dispatch/disp_manipula.c at the line 169:
Code:
 strcpy(con->host, "127.0.0.1");

in
Code:
 strcpy(con->host, "localhost");

Can you send me (or post) the log file tmp/xplico.log ?


Sat Jul 16, 2011 9:04 am
Profile WWW

Joined: Tue Jul 12, 2011 8:04 pm
Posts: 5
Reply with quote
Post Re: options inet6 in resolv.conf will kill xplico
Hello,

I've done the test with
- localhost -> same trouble
- ip6-localhost -> same trouble
- ::1 -> I've got an error message "dispatch to manipulator initialization error" (and it's not trying to open a socket)


Then I follow the con variable, and modify the gethostbyname line 196 by
Code:
196     host = gethostbyname2(con->host,AF_INET);


In this way it's work a little* (but it's not ipv6 compliant).
I've seen that line 205, the socket is create with AF_INET, so perhaps gethostbyname will return the ipv6 address first, and system doesn't understand what to do with theses complicated 16 bytes address ?


* : gehtostbyname2 works well with "localhost", but if I use 127.0.0.1, then we get exactly the same trouble that with gethostbyname.


Cordially

Ps : perhaps getaddrinfo will help ? It's been so long that I've touch C code i can't be sure, but i remember something like this.


Attachments:
File comment: xplico log when modifying "gethostbyname" with gethostbyname2
xplico_localhost+gethostbyname2.log [9.09 KiB]
Downloaded 575 times
File comment: xplico log when using "localhost"
xplico_localhost.log [8.87 KiB]
Downloaded 586 times
Sat Jul 16, 2011 12:54 pm
Profile
Site Admin

Joined: Wed Sep 16, 2009 10:09 pm
Posts: 394
Reply with quote
Post Re: options inet6 in resolv.conf will kill xplico
Can you try with this code?

Thanks.
Gianluca


Attachments:
File comment: Manipulators with IPv6 and IPv4 sockets
xpatch.tgz [6.74 KiB]
Downloaded 587 times
Sat Jul 16, 2011 4:57 pm
Profile WWW

Joined: Tue Jul 12, 2011 8:04 pm
Posts: 5
Reply with quote
Post Re: options inet6 in resolv.conf will kill xplico
Hello,

I test the patch and it works well.
Very well I must say, since I've also try to change "localhost" (line 172) to value such as "127.0.0.1", "ip6-localhost" and "::1" , and all theses values also works ^^.
I've also tried some dns resolution which have an A record and an AAAA record on localhost, and it's also works like a charm.

Thanks a lot.

Cordially


Sun Jul 17, 2011 9:49 am
Profile
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by Vjacheslav Trushkin for Free Forums/DivisionCore.