Since SA_SETLEN() is used only for sockaddr_in, convert it to SIN_SETLEN()

to avoid compiler whining on breaking strict aliasing rules.
This commit is contained in:
pooka 2012-11-26 16:30:14 +00:00
parent 9d483431fd
commit 2f56710909
2 changed files with 5 additions and 5 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: rumpuser_port.h,v 1.6 2012/11/22 21:23:08 pooka Exp $ */
/* $NetBSD: rumpuser_port.h,v 1.7 2012/11/26 16:30:14 pooka Exp $ */
/*
* Portability header for non-NetBSD platforms.
@ -102,9 +102,9 @@ posix_memalign(void **ptr, size_t align, size_t size)
#endif
#if defined(__linux__) || defined(__sun__)
#define SA_SETLEN(a,b)
#define SIN_SETLEN(a,b)
#else /* BSD */
#define SA_SETLEN(_sa_, _len_) ((struct sockaddr *)_sa_)->sa_len = _len_
#define SIN_SETLEN(_sin_, _len_) _sin_.sin_len = _len_
#endif
#ifndef __predict_true

View File

@ -1,4 +1,4 @@
/* $NetBSD: sp_common.c,v 1.34 2012/11/18 19:29:40 pooka Exp $ */
/* $NetBSD: sp_common.c,v 1.35 2012/11/26 16:30:14 pooka Exp $ */
/*
* Copyright (c) 2010, 2011 Antti Kantee. All Rights Reserved.
@ -546,7 +546,7 @@ tcp_parse(const char *addr, struct sockaddr **sa, int allow_wildcard)
int port;
memset(&sin, 0, sizeof(sin));
SA_SETLEN(&sin, sizeof(sin));
SIN_SETLEN(sin, sizeof(sin));
sin.sin_family = AF_INET;
p = strchr(addr, ':');