case IPOPT_LSRR:
if (len < 7)
break;
- memcpy(&retval, cp + len - 4, 4);
+ unaligned_memcpy(&retval, cp + len - 4, 4);
return retval;
}
}
trunc:
- memcpy(&retval, &ip->ip_dst.s_addr, sizeof(u_int32_t));
+ unaligned_memcpy(&retval, &ip->ip_dst.s_addr, sizeof(u_int32_t));
return retval;
}
ph.len = htons((u_int16_t)len);
ph.mbz = 0;
ph.proto = next_proto;
- memcpy(&ph.src, &ip->ip_src.s_addr, sizeof(u_int32_t));
+ unaligned_memcpy(&ph.src, &ip->ip_src.s_addr, sizeof(u_int32_t));
if (IP_HL(ip) == 5)
- memcpy(&ph.dst, &ip->ip_dst.s_addr, sizeof(u_int32_t));
+ unaligned_memcpy(&ph.dst, &ip->ip_dst.s_addr, sizeof(u_int32_t));
else
ph.dst = ip_finddst(ip);
/* pseudo-header */
memset(&ph, 0, sizeof(ph));
- ph.ph_src = ip6->ip6_src;
- ph.ph_dst = ip6->ip6_dst;
+ unaligned_memcpy(&ph.ph_src, &ip6->ip6_src, sizeof (struct in6_addr));
+ unaligned_memcpy(&ph.ph_dst, &ip6->ip6_dst, sizeof (struct in6_addr));
ph.ph_len = htonl(len);
ph.ph_nxt = next_proto;