static int
parse_ipv6(struct ofpbuf *packet, struct flow *flow)
{
- const struct ip6_hdr *nh;
+ const struct ovs_16aligned_ip6_hdr *nh;
ovs_be32 tc_flow;
int nexthdr;
nexthdr = nh->ip6_nxt;
- flow->ipv6_src = nh->ip6_src;
- flow->ipv6_dst = nh->ip6_dst;
+ memcpy(&flow->ipv6_src, &nh->ip6_src, sizeof flow->ipv6_src);
+ memcpy(&flow->ipv6_dst, &nh->ip6_dst, sizeof flow->ipv6_dst);
- tc_flow = get_unaligned_be32(&nh->ip6_flow);
+ tc_flow = get_16aligned_be32(&nh->ip6_flow);
flow->nw_tos = ntohl(tc_flow) >> 20;
flow->ipv6_label = tc_flow & htonl(IPV6_LABEL_MASK);
flow->nw_ttl = nh->ip6_hlim;
return EINVAL;
}
} else if (nexthdr == IPPROTO_FRAGMENT) {
- const struct ip6_frag *frag_hdr = packet->data;
+ const struct ovs_16aligned_ip6_frag *frag_hdr = packet->data;
nexthdr = frag_hdr->ip6f_nxt;
if (!ofpbuf_try_pull(packet, sizeof *frag_hdr)) {
void
miniflow_move(struct miniflow *dst, struct miniflow *src)
{
- int n = miniflow_n_values(src);
- if (n <= MINI_N_INLINE) {
+ if (src->values == src->inline_values) {
dst->values = dst->inline_values;
- memcpy(dst->values, src->values, n * sizeof *dst->values);
+ memcpy(dst->values, src->values,
+ miniflow_n_values(src) * sizeof *dst->values);
} else {
dst->values = src->values;
}
void
minimask_move(struct minimask *dst, struct minimask *src)
{
- miniflow_clone(&dst->masks, &src->masks);
+ miniflow_move(&dst->masks, &src->masks);
}
/* Initializes 'dst_' as the bit-wise "and" of 'a_' and 'b_'.