From: Wouter Wijngaards Date: Tue, 13 Sep 2016 11:35:33 +0000 (+0000) Subject: - Fix for new splint on FreeBSD. Fix cast for sockaddr_un.sun_len. X-Git-Tag: release-1.5.10~11 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9d4eb4cac5ef0c05366dca30df29c7536f5e7130;p=thirdparty%2Funbound.git - Fix for new splint on FreeBSD. Fix cast for sockaddr_un.sun_len. git-svn-id: file:///svn/unbound/trunk@3854 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/doc/Changelog b/doc/Changelog index b81828334..f6abd9e77 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,6 +1,7 @@ 13 September 2016: Wouter - Silenced flex-generated sign-unsigned warning print with gcc diagnostic pragma. + - Fix for new splint on FreeBSD. Fix cast for sockaddr_un.sun_len. 9 September 2016: Wouter - Fix #831: workaround for spurious fread_chk warning against petal.c diff --git a/services/listen_dnsport.c b/services/listen_dnsport.c index 88b8bdfab..929fee18b 100644 --- a/services/listen_dnsport.c +++ b/services/listen_dnsport.c @@ -704,7 +704,7 @@ create_local_accept_sock(const char *path, int* noproto) verbose(VERB_ALGO, "creating unix socket %s", path); #ifdef HAVE_STRUCT_SOCKADDR_UN_SUN_LEN /* this member exists on BSDs, not Linux */ - usock.sun_len = (socklen_t)sizeof(usock); + usock.sun_len = (unsigned char)sizeof(usock); #endif usock.sun_family = AF_LOCAL; /* length is 92-108, 104 on FreeBSD */ diff --git a/smallapp/unbound-control.c b/smallapp/unbound-control.c index e054da3cf..a5b71be35 100644 --- a/smallapp/unbound-control.c +++ b/smallapp/unbound-control.c @@ -212,7 +212,7 @@ contact_server(const char* svr, struct config_file* cfg, int statuscmd) struct sockaddr_un* usock = (struct sockaddr_un *) &addr; usock->sun_family = AF_LOCAL; #ifdef HAVE_STRUCT_SOCKADDR_UN_SUN_LEN - usock->sun_len = (socklen_t)sizeof(usock); + usock->sun_len = (unsigned char)sizeof(usock); #endif (void)strlcpy(usock->sun_path, svr, sizeof(usock->sun_path)); addrlen = (socklen_t)sizeof(struct sockaddr_un);