X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=lib%2Fbundle.c;h=af1be63031857c163e538642aed7489ab7960eb3;hb=9c8e276ec3f4a3368ec1cb7f713543d46d8ad23a;hp=86762f92a850c0e97ecfdbfb1f4e013c650de56f;hpb=ce523f65fc0f283269f6a697b152c089fb0a22ee;p=openvswitch diff --git a/lib/bundle.c b/lib/bundle.c index 86762f92..af1be630 100644 --- a/lib/bundle.c +++ b/lib/bundle.c @@ -193,6 +193,7 @@ bundle_parse__(struct ofpbuf *b, const char *s, char **save_ptr, const char *slave_type, const char *dst, const char *slave_delim) { + enum ofputil_action_code code; struct nx_action_bundle *nab; uint16_t n_slaves; @@ -205,14 +206,15 @@ bundle_parse__(struct ofpbuf *b, const char *s, char **save_ptr, s, slave_delim); } - b->l2 = ofpbuf_put_zeros(b, sizeof *nab); + code = dst ? OFPUTIL_NXAST_BUNDLE_LOAD : OFPUTIL_NXAST_BUNDLE; + b->l2 = ofputil_put_action(code, b); n_slaves = 0; for (;;) { ovs_be16 slave_be; char *slave; - slave = strtok_r(NULL, ", ", save_ptr); + slave = strtok_r(NULL, ", [", save_ptr); if (!slave || n_slaves >= BUNDLE_MAX_SLAVES) { break; } @@ -229,10 +231,7 @@ bundle_parse__(struct ofpbuf *b, const char *s, char **save_ptr, } nab = b->l2; - nab->type = htons(OFPAT_VENDOR); nab->len = htons(b->size - ((char *) b->l2 - (char *) b->data)); - nab->vendor = htonl(NX_VENDOR_ID); - nab->subtype = htons(dst ? NXAST_BUNDLE_LOAD: NXAST_BUNDLE); nab->n_slaves = htons(n_slaves); nab->basis = htons(atoi(basis));