1. 09 Jan, 2021 5 commits
    • Nils Goroll's avatar
      vtc: Make tests compatible with IPv6 only · 06931134
      Nils Goroll authored
      For 127.0.0.1, use "None", "${localhost}" or "${bind_addr}" as appropriate.
      
      Instead of ${Xaddr}:${Xport}, use ${Xsock}
      
      For some tests, we need to add a Host header to make them stable for
      differing server addresses.
      
      Ref #3490
      06931134
    • Nils Goroll's avatar
      vtest: Untie vtest from 127.0.0.1 and support IPv6 only setups · 1c19f3fe
      Nils Goroll authored
      to support IPv6 only hosts, we try to resolve "localhost" if resolving
      "127.0.0.1" fails.
      
      Whatever address we determine is stored in the ${localhost}
      macro. Because of the different address:port vs. [address]:port
      formats for IPv4 vs. IPv6, we store "${localhost}:0" /
      "[${localhost}]:0" in the ${listen_addr} macro.
      
      Likewise we unify the *_sock macros to ${Xaddr}:${Xport} (the colon
      used to be missing) for IPv4 and [${Xaddr}]:${Xport} for IPv6.
      
      We also save ${listen_addr} in default_listen_addr for use from within
      the vtest code whenever we want to bind to or listen on an emphemeral
      port.
      
      Ref #3490
      1c19f3fe
    • Nils Goroll's avatar
      varnishd: Fix debug.listen_address for full length IPv6 · 2aa9a8b0
      Nils Goroll authored
      32 bytes are not enough to hold the colons of a full length IPv6
      address.
      2aa9a8b0
    • Nils Goroll's avatar
      vtcp: make vtcp_sa_to_ascii error output more helpful · 0376b7f4
      Nils Goroll authored
      - write to stderr
      - output errno for EAI_SYSTEM
      0376b7f4
    • Nils Goroll's avatar
      varnishd: Support "-b None" argument · 889b9e0b
      Nils Goroll authored
      for "backend default none;"
      
      Ref #3067
      889b9e0b
  2. 08 Jan, 2021 9 commits
    • Poul-Henning Kamp's avatar
      The vtester running in a IPv6 enabled jail, attempting u000000 says: · 75d56fe1
      Poul-Henning Kamp authored
      	Connection failed (fec0:: 19925): (null)
      
      The's not an IPv6 address.
      
      *This* is an IPv6 address:
      
      	fec0::205
      75d56fe1
    • Nils Goroll's avatar
      Fix VTCP_my_suckaddr() refactor · 4d11c072
      Nils Goroll authored
      Before c1352b0b, the function asserted
      that getsockname() succeed. We now restore this behaviour in a way which
      Flexelint understands (we are returning the memory which we allocated).
      4d11c072
    • Nils Goroll's avatar
      Additional size checking for session attributes · 33736b20
      Nils Goroll authored
      When we reserve a session attribute, we now check that the reserved
      space is of the expected size.
      33736b20
    • Nils Goroll's avatar
      bee05dae
    • Nils Goroll's avatar
      9cfd2066
    • Nils Goroll's avatar
      Use VSA_getsockname() - avoid sockaddr_storage · c1352b0b
      Nils Goroll authored
      avoids an second getsockname() in vbp_write_proxy_v1()
      avoids a memcpy() in VTCP_my_suckaddr()
      c1352b0b
    • Dridi Boukelmoune's avatar
      vtc: Flip the feature check in v4 · 32ea9c59
      Dridi Boukelmoune authored
      In order to run the test we want to NOT be using gcov, so we should test
      that the environment variable is empty. In theory that should mean that
      GCOV runs should currently fail since the feature check is currently
      backwards so I may revert this change if that suddenly happens.
      
      I find `test -z ...` more readable than `[ -z ... ]` in this context, so
      if it comes to a revert, I will keep the test(1) syntax.
      32ea9c59
    • Nils Goroll's avatar
      Add VSA_getsockname() · 2b63ee2d
      Nils Goroll authored
      Flexelint on Linux exhibits exactly the problem described by phk in
      his rant at the top of vsa.c, quote:
      
      	Do I need to tell you that static code analysis tools have a
      	really hard time coping with (struct suckaddr_storage), and
      	that they give a lot of false negatives which confuse people ?
      
      One instance of this issue:
      
      --- Module:   cache/cache_acceptor.c (C)
                                                     _
       #... _assert(!!((getsockname(sp->fd, (void*)&ss, &sl)) == 0)) /*lint -restore *
       #... getsockname(sp->fd, (void*)&ss, &sl)) == 0); } while (0)
      	AZ(getsockname(sp->fd, (void*)&ss, &sl));
      cache/cache_acceptor.c  330  Error 64: Type mismatch (arg. no. 2) (union
          __SOCKADDR_ARG = void *)
                                       _
       #... SA_Build(sa, &ss, sl)) != 0); } while (0)
      	AN(VSA_Build(sa, &ss, sl));
      cache/cache_acceptor.c  332  Warning 603: Symbol 'ss' (line 318) not
          initialized
      cache/cache_acceptor.c  318  Info 830: Location cited in prior message
                                                                        _
      			i = accept(ls->sock, (void*)&wa.acceptaddr,
      cache/cache_acceptor.c  458  Error 64: Type mismatch (arg. no. 2) (union
          __SOCKADDR_ARG = void *)
      
      There is one more in cache/cache_backend_probe.c
      
      As the purpose of VSA is to avoid exactly this kind of trouble, we
      provide a VSA-wrapper for getsockname.
      2b63ee2d
    • Nils Goroll's avatar
      remove accidental leftover · 2e663f90
      Nils Goroll authored
      2e663f90
  3. 07 Jan, 2021 26 commits