Index: sys/netinet/tcp_input.c =================================================================== RCS file: /cvsroot/src/sys/netinet/tcp_input.c,v retrieving revision 1.413 diff -u -r1.413 tcp_input.c --- sys/netinet/tcp_input.c 8 Nov 2018 06:43:52 -0000 1.413 +++ sys/netinet/tcp_input.c 27 May 2019 15:16:43 -0000 @@ -271,6 +271,16 @@ } #endif +static inline uint32_t +get_u32(void *p) +{ + uint32_t u; + + memcpy(&u, p, sizeof(u)); + + return u; +} + /* * Compute ACK transmission behavior. Delay the ACK unless * we have already delayed an ACK (must send an ACK every two segments). @@ -1350,11 +1360,11 @@ if ((optlen == TCPOLEN_TSTAMP_APPA || (optlen > TCPOLEN_TSTAMP_APPA && optp[TCPOLEN_TSTAMP_APPA] == TCPOPT_EOL)) && - *(u_int32_t *)optp == htonl(TCPOPT_TSTAMP_HDR) && + get_u32(optp) == htonl(TCPOPT_TSTAMP_HDR) && (th->th_flags & TH_SYN) == 0) { opti.ts_present = 1; - opti.ts_val = ntohl(*(u_int32_t *)(optp + 4)); - opti.ts_ecr = ntohl(*(u_int32_t *)(optp + 8)); + opti.ts_val = ntohl(get_u32(optp + 4)); + opti.ts_ecr = ntohl(get_u32(optp + 8)); optp = NULL; /* we've parsed the options */ } }