[master] 4a69e1ae8 another concession to flexelint

Nils Goroll nils.goroll at uplex.de
Sat Apr 4 12:40:07 UTC 2020


commit 4a69e1ae81702a5c07af93c31ce6377d874214f2
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Sat Apr 4 14:19:57 2020 +0200

    another concession to flexelint
    
    I would have preferred avoiding the duplication of the suckaddr member
    types, but flexelint spits "Warning 550: Symbol 'sua' (line 229) not
    accessed"

diff --git a/lib/libvarnish/vsa.c b/lib/libvarnish/vsa.c
index 2c7be641c..edad67d6d 100644
--- a/lib/libvarnish/vsa.c
+++ b/lib/libvarnish/vsa.c
@@ -226,13 +226,11 @@ VSA_GetPtr(const struct suckaddr *sua, const unsigned char ** dst)
 static inline
 socklen_t sua_len(const struct sockaddr *sa)
 {
-	struct suckaddr *sua;
-
 	switch (sa->sa_family) {
 	case PF_INET:
-		return (sizeof sua->sa4);
+		return (sizeof(struct sockaddr_in));
 	case PF_INET6:
-		return (sizeof sua->sa6);
+		return (sizeof(struct sockaddr_in6));
 	default:
 		return (0);
 	}


More information about the varnish-commit mailing list