X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fnx-match.c;h=8444ab759f04afdb5e17906df8af23665fb5f193;hb=b2f2acd543f159ba984a00059892917933612a10;hp=09f7f548b77993ba00fd6e22ff0fa734c632f7dc;hpb=fa04edcedfe5285fd8ad3a4d70fecb38df18293d;p=sliver-openvswitch.git diff --git a/lib/nx-match.c b/lib/nx-match.c index 09f7f548b..8444ab759 100644 --- a/lib/nx-match.c +++ b/lib/nx-match.c @@ -183,7 +183,7 @@ nx_pull_raw(const uint8_t *p, unsigned int match_len, bool strict, if (NXM_HASMASK(header)) { memcpy(cookie_mask, p + 4 + width, width); } else { - *cookie_mask = htonll(UINT64_MAX); + *cookie_mask = OVS_BE64_MAX; } error = 0; } @@ -361,7 +361,7 @@ nxm_put_16m(struct ofpbuf *b, uint32_t header, ovs_be16 value, ovs_be16 mask) case 0: break; - case CONSTANT_HTONS(UINT16_MAX): + case OVS_BE16_MAX: nxm_put_16(b, header, value); break; @@ -393,7 +393,7 @@ nxm_put_32m(struct ofpbuf *b, uint32_t header, ovs_be32 value, ovs_be32 mask) case 0: break; - case CONSTANT_HTONL(UINT32_MAX): + case OVS_BE32_MAX: nxm_put_32(b, header, value); break; @@ -425,7 +425,7 @@ nxm_put_64m(struct ofpbuf *b, uint32_t header, ovs_be64 value, ovs_be64 mask) case 0: break; - case CONSTANT_HTONLL(UINT64_MAX): + case OVS_BE64_MAX: nxm_put_64(b, header, value); break; @@ -535,6 +535,11 @@ nxm_put_ip(struct ofpbuf *b, const struct match *match, flow->tp_src, match->wc.masks.tp_src); nxm_put_16m(b, oxm ? OXM_OF_UDP_DST : NXM_OF_UDP_DST, flow->tp_dst, match->wc.masks.tp_dst); + } else if (flow->nw_proto == IPPROTO_SCTP) { + nxm_put_16m(b, OXM_OF_SCTP_SRC, flow->tp_src, + match->wc.masks.tp_src); + nxm_put_16m(b, OXM_OF_SCTP_DST, flow->tp_dst, + match->wc.masks.tp_dst); } else if (flow->nw_proto == icmp_proto) { if (match->wc.masks.tp_src) { nxm_put_8(b, icmp_type, ntohs(flow->tp_src)); @@ -565,7 +570,7 @@ nx_put_raw(struct ofpbuf *b, bool oxm, const struct match *match, int match_len; int i; - BUILD_ASSERT_DECL(FLOW_WC_SEQ == 20); + BUILD_ASSERT_DECL(FLOW_WC_SEQ == 21); /* Metadata. */ if (match->wc.masks.in_port.ofp_port) { @@ -1168,19 +1173,19 @@ nxm_reg_load_from_openflow12_set_field( /* ofp12_action_set_field is padded to 64 bits by zero */ if (oasf_len != ROUND_UP(sizeof(*oasf) + oxm_length, 8)) { - return OFPERR_OFPBAC_BAD_ARGUMENT; + return OFPERR_OFPBAC_BAD_SET_LEN; } if (!is_all_zeros((const uint8_t *)(oasf) + sizeof *oasf + oxm_length, oasf_len - oxm_length - sizeof *oasf)) { - return OFPERR_OFPBAC_BAD_ARGUMENT; + return OFPERR_OFPBAC_BAD_SET_ARGUMENT; } if (NXM_HASMASK(oxm_header)) { - return OFPERR_OFPBAC_BAD_ARGUMENT; + return OFPERR_OFPBAC_BAD_SET_TYPE; } mf = mf_from_nxm_header(oxm_header); if (!mf) { - return OFPERR_OFPBAC_BAD_ARGUMENT; + return OFPERR_OFPBAC_BAD_SET_TYPE; } load = ofpact_put_REG_LOAD(ofpacts); ofpact_set_field_init(load, mf, oasf + 1);