Menu

#393 Poor behavior on kernel without IPv6 support when compiled with USE_IPV6

New
nobody
None
Medium
Defect
2013-01-23
2013-01-23
Anonymous
No

Originally created by: pas.n... (code.google.com)@gmail.com

What steps will reproduce the problem?
1. Compile mongoose with USE_IPV6
2. Compile linux kernel without IPv6 support
3. Run mongoose under this kernel

Right now, application fails to start with
'set_ports_option: cannot bind to <PORT>: Bad File Number.

'Bad file number' is due to closesocket(-1), which should be moved after cry(), since it modifies errno.

In this environment, mongoose should try to fall back to IPv4.

For example, when 'sock = socket(so.lsa.sa.sa_family, SOCK_STREAM, 6)' fails, call should be retried with
  so.lsa.sa.sa_family = AF_INET;
  so.lsa.sin.sin_port = so.lsa.sin6.sin6_port;

What version of the product are you using? On what operating system?
mongoose from git trunk, Linux kernel 2.6.29 without IPv6 support.

Impact: Android 2.x kernels are compiled without IPv6 support. Making universal binary which runs on every platform and optionally uses IPv6 is impossible right now.

Mentioned code is located near mongoose.c:4396.

Discussion


Log in to post a comment.

MongoDB Logo MongoDB