[master] d396134 Delete unused fields from the TLV structs.

Dridi Boukelmoune dridi at varni.sh
Wed Mar 14 17:58:11 UTC 2018


On Wed, Mar 14, 2018 at 5:50 PM, Geoff Simmons <geoff at uplex.de> wrote:
>
> commit d3961346254153341c9d38acb29fe808752f8e00
> Author: Geoff Simmons <geoff at uplex.de>
> Date:   Wed Mar 14 17:49:36 2018 +0100
>
>     Delete unused fields from the TLV structs.
>
> diff --git a/bin/varnishd/proxy/cache_proxy_proto.c b/bin/varnishd/proxy/cache_proxy_proto.c
> index 1f9410f..8aea3c7 100644
> --- a/bin/varnishd/proxy/cache_proxy_proto.c
> +++ b/bin/varnishd/proxy/cache_proxy_proto.c
> @@ -160,13 +160,11 @@ struct pp2_tlv {
>         uint8_t type;
>         uint8_t length_hi;
>         uint8_t length_lo;
> -       uint8_t value[0];
>  }__attribute__((packed));
>
>  struct pp2_tlv_ssl {
>         uint8_t  client;
>         uint32_t verify;
> -       struct pp2_tlv sub_tlv[0];
>  }__attribute__((packed));
>
>  static const char vpx2_sig[] = {

I said I would review the vmod-proxy patch set but also said you
shouldn't wait for me, so to be clear I'm not complaining as I'm
discovering this after the facts.

My understanding is that PHK reviewed and OK'd this change, but this
is also the first occurrence of packed structs in the code base to my
knowledge. Since they are usually meant to ease [de]serialization of
data (one read(2) and you're done) we may need to keep the fields even
if they aren't used.

I have yet to look at the patch set.

Dridi


More information about the varnish-commit mailing list