[master] 105be6a64 VSA_Build: Assign (struct sockaddr).sa_len where present

Nils Goroll nils.goroll at uplex.de
Wed Apr 1 18:30:11 UTC 2020


commit 105be6a644d7dee09184040f056248214ffebe3f
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Wed Apr 1 20:27:42 2020 +0200

    VSA_Build: Assign (struct sockaddr).sa_len where present
    
    In #3154 we said we would add this to the upcoming VSA_BuildFAP(),
    but actually VSA_Build() is the right place.

diff --git a/lib/libvarnish/vsa.c b/lib/libvarnish/vsa.c
index 2d79f571c..3ade79e14 100644
--- a/lib/libvarnish/vsa.c
+++ b/lib/libvarnish/vsa.c
@@ -282,6 +282,9 @@ VSA_Build(void *d, const void *s, unsigned sal)
 
 	INIT_OBJ(sua, SUCKADDR_MAGIC);
 	memcpy(&sua->sa, s, l);
+#ifdef HAVE_STRUCT_SOCKADDR_SA_LEN
+	sua->sa.sa_len = (unsigned char)l;
+#endif
 	return (sua);
 }
 


More information about the varnish-commit mailing list