2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-21 14:49:41 +00:00

Implement set-field for IPv6 ND fields (nd_target, nd_sll, and nd_tll).

This patch adds set-field operations for nd_target, nd_sll, and nd_tll
fields, with and without masks, using Nicira extensions and OpenFlow 1.2
protocol.

Signed-off-by: Randall A Sharo <randall.sharo at navy.mil>
Signed-off-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
Sharo, Randall A CIV SPAWARSYSCEN-ATLANTIC, 55200
2014-12-23 23:42:05 +00:00
committed by Ben Pfaff
parent ed5c51108c
commit e60e935b1f
14 changed files with 293 additions and 11 deletions

View File

@@ -112,6 +112,26 @@ recalc_csum32(ovs_be16 old_csum, ovs_be32 old_u32, ovs_be32 new_u32)
old_u32 >> 16, new_u32 >> 16);
}
/* Returns the new checksum for a packet in which the checksum field previously
* contained 'old_csum' and in which a field that contained the 6 bytes at
* 'old_bytes' was changed to contain the 6 bytes at 'new_bytes'. */
ovs_be16
recalc_csum48(ovs_be16 old_csum, const void *old_bytes,
const void *new_bytes)
{
ovs_be16 new_csum = old_csum;
const uint16_t *p16_old = old_bytes,
*p16_new = new_bytes;
int i;
for (i = 0; i < 3; ++i) {
new_csum = recalc_csum16(new_csum, get_unaligned_be16(&p16_old[i]),
get_unaligned_be16(&p16_new[i]));
}
return new_csum;
}
/* Returns the new checksum for a packet in which the checksum field previously
* contained 'old_csum' and in which a field that contained 'old_u32[4]' was
* changed to contain 'new_u32[4]'. */