mirror of
https://github.com/openvswitch/ovs
synced 2025-09-02 07:15:17 +00:00
flow: Fix misaligned access.
The testsuite for the flow extractor triggered this. With this commit, "make check" passes on SPARC.
This commit is contained in:
@@ -27,6 +27,7 @@
|
|||||||
#include "openflow/openflow.h"
|
#include "openflow/openflow.h"
|
||||||
#include "openvswitch/datapath-protocol.h"
|
#include "openvswitch/datapath-protocol.h"
|
||||||
#include "packets.h"
|
#include "packets.h"
|
||||||
|
#include "unaligned.h"
|
||||||
#include "xtoxll.h"
|
#include "xtoxll.h"
|
||||||
|
|
||||||
#include "vlog.h"
|
#include "vlog.h"
|
||||||
@@ -154,8 +155,8 @@ flow_extract(struct ofpbuf *packet, uint32_t tun_id, uint16_t in_port,
|
|||||||
if (flow->dl_type == htons(ETH_TYPE_IP)) {
|
if (flow->dl_type == htons(ETH_TYPE_IP)) {
|
||||||
const struct ip_header *nh = pull_ip(&b);
|
const struct ip_header *nh = pull_ip(&b);
|
||||||
if (nh) {
|
if (nh) {
|
||||||
flow->nw_src = nh->ip_src;
|
flow->nw_src = get_unaligned_u32(&nh->ip_src);
|
||||||
flow->nw_dst = nh->ip_dst;
|
flow->nw_dst = get_unaligned_u32(&nh->ip_dst);
|
||||||
flow->nw_tos = nh->ip_tos & IP_DSCP_MASK;
|
flow->nw_tos = nh->ip_tos & IP_DSCP_MASK;
|
||||||
flow->nw_proto = nh->ip_proto;
|
flow->nw_proto = nh->ip_proto;
|
||||||
packet->l4 = b.data;
|
packet->l4 = b.data;
|
||||||
|
Reference in New Issue
Block a user