~ubuntu-cloud-archive/ubuntu/precise/openvswitch/icehouse

« back to all changes in this revision

Viewing changes to lib/odp-util.c

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2013-12-05 10:08:20 UTC
  • mfrom: (1.1.22)
  • Revision ID: package-import@ubuntu.com-20131205100820-ykbxbjs697icgsod
Tags: 2.0.0+git20131203-0ubuntu1
* New upstream snapshot.
* d/rules: Switch snapshot branch to branch-2.0.
* Rework checks for -latomic:
  - d/p/0001-Add-check-for-latomic.patch: Add autoconf checks to see
    if -latomic is required when linking test-atomic.
  - d/p/atomic-test.patch: Dropped in preference to new patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
316
316
                              cookie.flow_sample.collector_set_id,
317
317
                              cookie.flow_sample.obs_domain_id,
318
318
                              cookie.flow_sample.obs_point_id);
319
 
            } else if (userdata_len == sizeof cookie.ipfix
 
319
            } else if (userdata_len >= sizeof cookie.ipfix
320
320
                       && cookie.type == USER_ACTION_COOKIE_IPFIX) {
321
321
                ds_put_format(ds, ",ipfix");
322
322
            } else {
2927
2927
            flow->tp_dst = udp_key->udp_dst;
2928
2928
            expected_bit = OVS_KEY_ATTR_UDP;
2929
2929
        }
2930
 
    } else if (flow->nw_proto == IPPROTO_SCTP
2931
 
               && (flow->dl_type == htons(ETH_TYPE_IP) ||
2932
 
                   flow->dl_type == htons(ETH_TYPE_IPV6))
2933
 
               && !(flow->nw_frag & FLOW_NW_FRAG_LATER)) {
 
2930
    } else if (src_flow->nw_proto == IPPROTO_SCTP
 
2931
               && (src_flow->dl_type == htons(ETH_TYPE_IP) ||
 
2932
                   src_flow->dl_type == htons(ETH_TYPE_IPV6))
 
2933
               && !(src_flow->nw_frag & FLOW_NW_FRAG_LATER)) {
2934
2934
        if (!is_mask) {
2935
2935
            expected_attrs |= UINT64_C(1) << OVS_KEY_ATTR_SCTP;
2936
2936
        }
3242
3242
    nl_msg_put_u32(odp_actions, OVS_USERSPACE_ATTR_PID, pid);
3243
3243
    if (userdata) {
3244
3244
        userdata_ofs = odp_actions->size + NLA_HDRLEN;
3245
 
        nl_msg_put_unspec(odp_actions, OVS_USERSPACE_ATTR_USERDATA,
3246
 
                          userdata, userdata_size);
 
3245
 
 
3246
        /* The OVS kernel module before OVS 1.11 and the upstream Linux kernel
 
3247
         * module before Linux 3.10 required the userdata to be exactly 8 bytes
 
3248
         * long:
 
3249
         *
 
3250
         *   - The kernel rejected shorter userdata with -ERANGE.
 
3251
         *
 
3252
         *   - The kernel silently dropped userdata beyond the first 8 bytes.
 
3253
         *
 
3254
         * Thus, for maximum compatibility, always put at least 8 bytes.  (We
 
3255
         * separately disable features that required more than 8 bytes.) */
 
3256
        memcpy(nl_msg_put_unspec_zero(odp_actions, OVS_USERSPACE_ATTR_USERDATA,
 
3257
                                      MAX(8, userdata_size)),
 
3258
               userdata, userdata_size);
3247
3259
    } else {
3248
3260
        userdata_ofs = 0;
3249
3261
    }