Skip to content

Commit

Permalink
netdev-native-tnl: Fix alignment for erspan index.
Browse files Browse the repository at this point in the history
Flagged by clang.

CC: William Tu <[email protected]>
Fixes: 068794b ("erspan: Add flow-based erspan options")
Signed-off-by: Darrell Ball <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
Acked-by: William Tu <[email protected]>
darball1 authored and blp committed May 24, 2018
1 parent 82d5b33 commit 8af725e
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions lib/netdev-native-tnl.c
Original file line number Diff line number Diff line change
@@ -653,23 +653,16 @@ netdev_erspan_build_header(const struct netdev *netdev,
}

if (erspan_ver == 1) {
ovs_be32 *index;

greh->protocol = htons(ETH_TYPE_ERSPAN1);
greh->flags = htons(GRE_SEQ);
ersh->ver = 1;
set_sid(ersh, sid);

uint32_t erspan_idx = (tnl_cfg->erspan_idx_flow
? params->flow->tunnel.erspan_idx
: tnl_cfg->erspan_idx);
put_16aligned_be32(ALIGNED_CAST(ovs_16aligned_be32 *, ersh + 1),
htonl(tnl_cfg->erspan_idx));

index = (ovs_be32 *)(ersh + 1);

if (tnl_cfg->erspan_idx_flow) {
*index = htonl(params->flow->tunnel.erspan_idx);
} else {
*index = htonl(tnl_cfg->erspan_idx);
}
htonl(erspan_idx));

hlen = ERSPAN_GREHDR_LEN + sizeof *ersh + ERSPAN_V1_MDSIZE;
} else if (erspan_ver == 2) {

0 comments on commit 8af725e

Please sign in to comment.