Uploaded image for project: 'Red Hat 3scale API Management'
  1. Red Hat 3scale API Management
  2. THREESCALE-8955

Add support for IPv6 link-local addresses with zone IDs

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 2.12.1 GA
    • Backend
    • None
    • False
    • Hide

      None

      Show
      None
    • False
    • Not Started
    • Not Started
    • Not Started
    • Not Started
    • Not Started
    • Not Started

      On podman containers, /etc/resolv.conf file is generated based on the host configuration. In my system, I must have some IPv6 config enabled, and that leads podman to generate this /etc/resolv.conf in the apicast container:

      nameserver 10.0.2.3
      nameserver 192.168.100.1
      nameserver fe80::1%2

      Note that the last line is a link-local IPv6 address in zone-id format (learn more). Other examples of such addresses are fe80::1%eth0 or fe80::1%enp0s20f0u1.

      Trying to run an apicast container which such type of IPs in the resolver fails with the error:

      nginx: [emerg] invalid IPv6 address in resolver "[fe80::1%2]:53" in /tmp/lua_l9C4j9:52

      In Fedora 37, this can be reproduced by running:

      podman run --name apicast --rm -p 8080:8080 --add-host=host.docker.internal:10.0.2.2 --net slirp4netns:allow_host_loopback=true -e THREESCALE_PORTAL_ENDPOINT="http://apicastsecret@10.0.2.2:3008/master/api/proxy/configs" -e THREESCALE_DEPLOYMENT_ENV=staging -e BACKEND_ENDPOINT_OVERRIDE="http://10.0.2.2:3001" quay.io/3scale/apicast:latest

      I'm not sure of this, but I suspect that some regular expressions in the apicast code could be the cause. A regular expression like the next one could be more appropriate:

      [a-f\d:]+(%.+)?
      

      I'm having to disable IPv6 via podman parameter in order to get apicast working in my machine.

      I'm not sure how to test this in my machine, so, could anybody take a look?

      UPDATE
      I attached the content of the lua_l9C4j9 file, which seems to be a NGINX configuration file, which line 52 looks like this:

      resolver 10.0.2.3:53 192.168.100.1:53 [fe80::1%2]:53;

      Is this file generated by our code? it seems the format is incorrect

              Unassigned Unassigned
              rh-ee-jlledo Joan Lledo
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: