From 34c21f7445bcf7cc87e61515e75776a02274c460 Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Fri, 28 May 2010 08:32:42 +0000 Subject: Make sure the temporary buffer used to generate tcp options is properly aligned, otherwise we lose on strict alignment architecture. Should fix problems with gcc4 compiled bsd.rd's that people see on sparc64. ok millert@, beck@, jsing@ --- sys/netinet/tcp_output.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c index d4da8619528..036c54176cd 100644 --- a/sys/netinet/tcp_output.c +++ b/sys/netinet/tcp_output.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_output.c,v 1.87 2009/06/05 00:05:22 claudio Exp $ */ +/* $OpenBSD: tcp_output.c,v 1.88 2010/05/28 08:32:41 kettenis Exp $ */ /* $NetBSD: tcp_output.c,v 1.16 1997/06/03 16:17:09 kml Exp $ */ /* @@ -212,7 +212,8 @@ tcp_output(struct tcpcb *tp) int off, flags, error; struct mbuf *m; struct tcphdr *th; - u_char opt[MAX_TCPOPTLEN]; + u_int32_t optbuf[howmany(MAX_TCPOPTLEN, sizeof(u_int32_t))]; + u_char *opt = (u_char *)optbuf; unsigned int optlen, hdrlen, packetlen; int idle, sendalot = 0; #ifdef TCP_SACK -- cgit v1.2.3