Module Name: src Committed By: pooka Date: Mon Nov 26 16:30:14 UTC 2012
Modified Files: src/lib/librumpuser: rumpuser_port.h sp_common.c Log Message: Since SA_SETLEN() is used only for sockaddr_in, convert it to SIN_SETLEN() to avoid compiler whining on breaking strict aliasing rules. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/lib/librumpuser/rumpuser_port.h cvs rdiff -u -r1.34 -r1.35 src/lib/librumpuser/sp_common.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/lib/librumpuser/rumpuser_port.h diff -u src/lib/librumpuser/rumpuser_port.h:1.6 src/lib/librumpuser/rumpuser_port.h:1.7 --- src/lib/librumpuser/rumpuser_port.h:1.6 Thu Nov 22 21:23:08 2012 +++ src/lib/librumpuser/rumpuser_port.h Mon Nov 26 16:30:14 2012 @@ -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, #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 Index: src/lib/librumpuser/sp_common.c diff -u src/lib/librumpuser/sp_common.c:1.34 src/lib/librumpuser/sp_common.c:1.35 --- src/lib/librumpuser/sp_common.c:1.34 Sun Nov 18 19:29:40 2012 +++ src/lib/librumpuser/sp_common.c Mon Nov 26 16:30:14 2012 @@ -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 socka 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, ':');