greh = push_ip_header(packet, header, size, &ip_tot_size);
if (greh->flags & htons(GRE_CSUM)) {
- ovs_16aligned_be32 *options = (ovs_16aligned_be32 *) (greh + 1);
-
- put_16aligned_be32(options,
- (OVS_FORCE ovs_be32) csum(greh, ip_tot_size - sizeof (struct ip_header)));
+ ovs_be16 *csum_opt = (ovs_be16 *) (greh + 1);
+ *csum_opt = csum(greh, ip_tot_size - sizeof (struct ip_header));
}
}
greh->flags, ntohs(greh->protocol));
options = (ovs_16aligned_be32 *)(greh + 1);
if (greh->flags & htons(GRE_CSUM)) {
- ds_put_format(ds, ",csum=0x%"PRIx32, ntohl(get_16aligned_be32(options)));
+ ds_put_format(ds, ",csum=0x%"PRIx16, ntohs(*((ovs_be16 *)options)));
options++;
}
if (greh->flags & htons(GRE_KEY)) {
ovs_16aligned_be32 *options = (ovs_16aligned_be32 *) (greh + 1);
if (greh->flags & htons(GRE_CSUM)) {
- uint32_t csum;
+ uint16_t csum;
- if (!ovs_scan_len(s, &n, ",csum=0x%"SCNx32, &csum)) {
+ if (!ovs_scan_len(s, &n, ",csum=0x%"SCNx16, &csum)) {
return -EINVAL;
}
- put_16aligned_be32(options, htonl(csum));
+
+ memset(options, 0, sizeof *options);
+ *((ovs_be16 *)options) = htons(csum);
options++;
}
if (greh->flags & htons(GRE_KEY)) {