1. 01 Apr, 2020 26 commits
    • Nils Goroll's avatar
      Warn about ACL entries with non-zero host bits · b9756475
      Nils Goroll authored
      Summary:
      
      ACL entries with netmasks shorter than the maximum for the respective
      protocol represent network addresses and as such, by convention,
      should be written with all zero bits in the host part to avoid
      confusion.
      
      This patch adds VCL compile warnings and improved logging if they are
      not.
      
      Discussion:
      
      For example, while 1.2.3.0/24 and 1.2.3.255/24, in CIDR notation, both
      specify all addresses with the first three octets matching 1, 2 and 3,
      using the latter can be a source of subtle confusion.
      
      This becomes particularly apparent with netmasks outside byte
      boundaries: 1.2.6.0/22 specifies addresses 1.2.4.0 - 1.2.7.255, but
      not so experienced administrators might be tempted to think that it
      specified 1.2.6.0 - 1.2.9.255.
      
      To summarize, denoting network addresses in non-canonical form is
      confusing, a possible source of error and additionally complicates
      analyses.
      
      This patch makes sure that such mishaps do not remain unnoticed by
      
      - issuing warnings during VCL compilation about non-canonical network
        addresses
      
      - Logging ACL matches together with the canonical address
      
      The actual matching code is not touched, but a minor simplification
      can be applied later.
      b9756475
    • Nils Goroll's avatar
      4e5fcfeb
    • Nils Goroll's avatar
      VSA_BuildFAP: Build a suckaddr from Family, Address and Port · 358f7331
      Nils Goroll authored
      Follow the spirit of the vsa.c top level rant and spare callers the
      hassle of creating sockaddrs specific to ip4/ip6 just to build a VSA,
      which is intended to avoid having to special-case the protocols in the
      first place.
      358f7331
    • Nils Goroll's avatar
      Appease Solaris gcc 64bit · 544f62bd
      Nils Goroll authored
      544f62bd
    • Nils Goroll's avatar
      VSA_Build: Assign (struct sockaddr).sa_len where present · 105be6a6
      Nils Goroll authored
      In #3154 we said we would add this to the upcoming VSA_BuildFAP(),
      but actually VSA_Build() is the right place.
      105be6a6
    • Nils Goroll's avatar
      Deflate VSA_* code a bit · 50970bc9
      Nils Goroll authored
      - Centralize duplicated code in sua_len()
      - Have VSA_Malloc call VSA_Build
      - Use INIT_OBJ instead of memset + magic assignment
      
      April sales extra exclusively to customers in Paris: Now with free
      capitalized letters!
      50970bc9
    • Dridi Boukelmoune's avatar
      New HAVE_STRUCT_SOCKADDR_SA_LEN macro · 98b38e9f
      Dridi Boukelmoune authored
      Only present if struct sockaddr.sa_len exists, to be checked with
      preprocessor's #ifdef.
      
      Refs #3154
      98b38e9f
    • Dridi Boukelmoune's avatar
      9d53b1f6
    • Guillaume Quintard's avatar
      add test · 5aede725
      Guillaume Quintard authored
      5aede725
    • Guillaume Quintard's avatar
      [vstat] new json schema · 4b4411d2
      Guillaume Quintard authored
      4b4411d2
    • Guillaume Quintard's avatar
      [vstat] save a pair of lines · ff8caf99
      Guillaume Quintard authored
      ff8caf99
    • Guillaume Quintard's avatar
      [vstat] remove useless if · d1c87cc1
      Guillaume Quintard authored
      d1c87cc1
    • Nils Goroll's avatar
      Error handling for out-of-workspace VDP_Push during ESI processing · f1392d0f
      Nils Goroll authored
      As with any other out-of-workspace condition during ESI processing, we
      do not have any better way than to deliver an incomplete response
      (missing ESI include).
      
      Or do we?
      
      Fixes #3241
      f1392d0f
    • Nils Goroll's avatar
      add pthread_self() to panic output · 410354f1
      Nils Goroll authored
      This should help locating the panicking thread in a core dump when when
      the principle thread as determined by the debugger is a different one.
      410354f1
    • Nils Goroll's avatar
      9427a610
    • Nils Goroll's avatar
      support concurrent access to PRIV_TOP · 27349a30
      Nils Goroll authored
      in varnish-cache, access to all ESI sub-requests happens in a single
      thread, but vmods (VDPs) may add concurrency.
      
      We thus protect access to PRIV_TOP with the session mutex.
      
      Any vmods using this facility will likely need to add additional locking for
      the actual data structures referenced through the PRIV_TOP and any other
      access to the top request.
      
      For alternatives previously considered, see #3139
      27349a30
    • Nils Goroll's avatar
      assert for VGZ_NewGzip() failures · d1bd80e8
      Nils Goroll authored
      VGZ_NewGzip will either assert or succeed.
      d1bd80e8
    • Nils Goroll's avatar
      Handle workspace allocation errors in VEP_Init() · 0f3af407
      Nils Goroll authored
      Turn assertion into VFP error
      
      The vtc is based upon r02645.vtc and reliably reproduces the panic
      without the patch by sweeping through possible amounts of free workspace
      ranging from 4 to 400 bytes.
      
      Fixes #3253
      0f3af407
    • Dridi Boukelmoune's avatar
      Defer the illegal write check a bit · ed36b638
      Dridi Boukelmoune authored
      After the initial discussion from #3163, and looking more closely at how
      variable access is handled in subroutines I noticed a discrepancy.
      
      Setting a read only variable like obj.ttl in vcl_recv would result in
      a misleading error message explaining that it is read only, instead of
      simply not available.
      
      This change defers the illegal write check, registering unconditionally
      that the symbol was used in a set action. As a result we always get the
      correct error message but depending on whether this is happening in a
      vcl_ or custom subroutine we may either get "in subroutine" or "from
      subroutine" in the error message. A minor discrepancy probably worth
      getting rid of the prior inconsistency.
      
      This is covered by the v21 test case.
      ed36b638
    • Dridi Boukelmoune's avatar
      Manage symbol references with higher-level types · df4804b9
      Dridi Boukelmoune authored
      That would be the symbol itself instead of only the relevant mask, and a
      XREF constants wrapping the error message as well. The `struct xrefuse`
      pun was definitely intended.
      df4804b9
    • Dridi Boukelmoune's avatar
      Start interactive varnishstat with relevant verbosity · 3399615a
      Dridi Boukelmoune authored
      Where relevant means the highest verbosity when fields are filtered with
      -f on the command line. There is still a caveat that this only applies
      for the first iteration, and some parameters may conditionally appear
      and not be visible when that event occurs (for example, when the child
      process starts).
      
      The rebuild variable was used as a bitmap but did not make use of
      individual bits. This is now the case, but only for the two actionable
      rebuild conditions.
      
      Closes #2990
      3399615a
    • Dridi Boukelmoune's avatar
      Draw the varnishstat help screen · f4d726d9
      Dridi Boukelmoune authored
      Refs #2990
      f4d726d9
    • Dridi Boukelmoune's avatar
      Generate an array of lines for the varnishstat help · f6cae5a7
      Dridi Boukelmoune authored
      Refs #2990
      f6cae5a7
    • Dridi Boukelmoune's avatar
      Remove unused variables · 5d145c1d
      Dridi Boukelmoune authored
      5d145c1d
    • Dridi Boukelmoune's avatar
      Introduce a blank help screen in varnishstat · ec8eb15f
      Dridi Boukelmoune authored
      The plan is to reuse the points window and keep the status window going.
      
      Refs #2990
      ec8eb15f
    • Dridi Boukelmoune's avatar
      Polish · 4807f6a5
      Dridi Boukelmoune authored
      4807f6a5
  2. 30 Mar, 2020 1 commit
  3. 22 Mar, 2020 1 commit
  4. 20 Mar, 2020 1 commit
  5. 17 Mar, 2020 4 commits
  6. 16 Mar, 2020 3 commits
  7. 15 Mar, 2020 2 commits
  8. 13 Mar, 2020 2 commits