Project

General

Profile

Bug #16928

RGW/civetweb no longer listens on IPv6: invalid port spec

Added by Robin Johnson almost 3 years ago. Updated almost 3 years ago.

Status:
Resolved
Priority:
Urgent
Assignee:
Target version:
-
Start date:
08/04/2016
Due date:
% Done:

0%

Source:
other
Tags:
Backport:
jewel
Regression:
Yes
Severity:
2 - major
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:

Description

civetweb: 0x7f507d36cbe0: set_ports_option: [::]:7480: invalid port spec. Expecting list of: [IP_ADDRESS:]PORT[s|r]

Both these inputs cause the same error of 'invalid port spec'.
rgw frontends = civetweb port=[::]:7480
rgw frontends = civetweb port=[2607:1234:1234:1234::7853]:7480

It comes from here:
https://github.com/ceph/civetweb/blob/8d271315a541218caada366f84a2690fdbd474a2/src/civetweb.c#L5979
https://github.com/ceph/civetweb/blob/8d271315a541218caada366f84a2690fdbd474a2/src/civetweb.c#L5916

The code itself does seem to be correct, the only way I can repeat the error, is to have USE_IPV6 be undefined.

RGW does work correctly in Hammer (0.94.7-1precise), but is broken as of 10.2.2-1trusty


Related issues

Copied to rgw - Backport #16945: jewel: RGW/civetweb no longer listens on IPv6: invalid port spec Resolved

History

#1 Updated by Robin Johnson almost 3 years ago

  • Status changed from New to Verified

Ok, I can prove the USE_IPV6 is not defined when src/civetweb/src/civetweb.c is compiled, and it seems that civetweb/include/civetweb_conf.h is not being included.

Add this at the top, just before or after '#define RGW 1':
#if !defined(USE_IPV6)
#error USE_IPV6 is not defined!
#endif

Now try to build it.
make3: Entering directory `/home/robjoh84/ceph/src'
./make_version -g ./.git_version
/bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -D__CEPH__ -D_FILE_OFFSET_BITS=64 -D_THREAD_SAFE -D__STDC_FORMAT_MACROS -D_GNU_SOURCE -DCEPH_LIBDIR=\"/usr/lib64\" -DCEPH_PKGLIBDIR=\"/usr/lib64/ceph\" -DGTEST_USE_OWN_TR1_TUPLE=0 -D_REENTRANT -I./civetweb/include --include ./civetweb/include/civetweb_conf.h -fPIC -DNO_SSL_DL -DUSE_IPV6=1 -DWITH_IPV6=1 -D_LARGEFILE64_SOURCE -march=native -O2 -pipe -frecord-gcc-switches -g -Wno-unused-parameter -Wextra -Wno-missing-field-initializers -Wno-missing-declarations -c -o civetweb/src/libcivetweb_la-civetweb.lo `test -f 'civetweb/src/civetweb.c' || echo './'`civetweb/src/civetweb.c
gcc -DHAVE_CONFIG_H -I. -D__CEPH__ -D_FILE_OFFSET_BITS=64 -D_THREAD_SAFE -D__STDC_FORMAT_MACROS -D_GNU_SOURCE -DCEPH_LIBDIR=\"/usr/lib64\" -DCEPH_PKGLIBDIR=\"/usr/lib64/ceph\" -DGTEST_USE_OWN_TR1_TUPLE=0 -D_REENTRANT -I./civetweb/include -fPIC -I./xxHash -D_LARGEFILE64_SOURCE -march=native -O2 -pipe -frecord-gcc-switches -g -Wno-unused-parameter -Wextra -Wno-missing-field-initializers -Wno-missing-declarations -c -o civetweb/src/radosgw-civetweb.o `test -f 'civetweb/src/civetweb.c' || echo './'`civetweb/src/civetweb.c
libtool: compile: gcc -DHAVE_CONFIG_H -I. -D__CEPH__ -D_FILE_OFFSET_BITS=64 -D_THREAD_SAFE -D__STDC_FORMAT_MACROS -D_GNU_SOURCE -DCEPH_LIBDIR=\"/usr/lib64\" -DCEPH_PKGLIBDIR=\"/usr/lib64/ceph\" -DGTEST_USE_OWN_TR1_TUPLE=0 -D_REENTRANT -I./civetweb/include --include ./civetweb/include/civetweb_conf.h -fPIC -DNO_SSL_DL -D_LARGEFILE64_SOURCE -march=native -O2 -pipe -frecord-gcc-switches -g -Wno-unused-parameter -Wextra -Wno-missing-field-initializers -Wno-missing-declarations -c civetweb/src/civetweb.c -fPIC -DPIC -o civetweb/src/.libs/libcivetweb_la-civetweb.o
civetweb/src/civetweb.c:25:2: error: #error USE_IPV6 is not defined!
#error USE_IPV6 is not defined!
^

#2 Updated by Robin Johnson almost 3 years ago

civetweb.c is included twice for compiling, but only the libcivetweb.la output passes "--include ./civetweb/include/civetweb_conf.h" during compile.

This was a breakage introduced by c38e3cbb6f7c6221209f2b512cba18c564c895a4

#4 Updated by Marcus Watts almost 3 years ago

should be a line like this,
src/CMakeLists.txt: set_property(TARGET civetweb_common_objs
src/CMakeLists.txt: APPEND PROPERTY COMPILE_DEFINITIONS USE_IPV6=1)

also if we care about automake,
src/rgw/Makefile.am:CIVETWEB_DEFINES = -DNO_SSL_DL -DUSE_IPV6
(but the -DNO_SSL_DL there should be variable.)

In src/rgw/Makefile.am there used to be this:
CIVETWEB_INCLUDE = --include $(srcdir)/civetweb/include/civetweb_conf.h
which included that define. I recommend not reproducing that.

#5 Updated by Nathan Cutler almost 3 years ago

  • Tags deleted (jewel)
  • Backport set to jewel

#6 Updated by Robin Johnson almost 3 years ago

Marcus Watts wrote:

should be a line like this,
src/CMakeLists.txt: set_property(TARGET civetweb_common_objs
src/CMakeLists.txt: APPEND PROPERTY COMPILE_DEFINITIONS USE_IPV6=1)

also if we care about automake,
src/rgw/Makefile.am:CIVETWEB_DEFINES = -DNO_SSL_DL -DUSE_IPV6
(but the -DNO_SSL_DL there should be variable.)

In src/rgw/Makefile.am there used to be this:
CIVETWEB_INCLUDE = --include $(srcdir)/civetweb/include/civetweb_conf.h
which included that define. I recommend not reproducing that.

I agree that ditching civetweb_conf.h entirely would be an improvement, but I picked the minimal fix to get it merged quickly into Jewel, in time for the next release.

#7 Updated by Marcus Watts almost 3 years ago

Um, wherever you can put in --include foo.h you can put in -DFOO. So I'm not sure why you think --include is minimal. But, whatever, as long as it's gone for good in kraken!

#8 Updated by Nathan Cutler almost 3 years ago

  • Status changed from Verified to Pending Backport

#9 Updated by Nathan Cutler almost 3 years ago

  • Copied to Backport #16945: jewel: RGW/civetweb no longer listens on IPv6: invalid port spec added

#10 Updated by Nathan Cutler almost 3 years ago

  • Assignee set to Robin Johnson

#11 Updated by Loic Dachary almost 3 years ago

  • Status changed from Pending Backport to Resolved

Also available in: Atom PDF