- struct ofpact_note *note;
-
- note = ofpact_put_NOTE(ofpacts);
- while (*arg != '\0') {
- uint8_t byte;
- bool ok;
-
- if (*arg == '.') {
- arg++;
- }
- if (*arg == '\0') {
- break;
- }
-
- byte = hexits_value(arg, 2, &ok);
- if (!ok) {
- return xstrdup("bad hex digit in `note' argument");
- }
- ofpbuf_put(ofpacts, &byte, 1);
-
- note = ofpacts->header;
- note->length++;
-
- arg += 2;
+ size_t start_ofs = ofpacts->size;
+ ofpact_put_NOTE(ofpacts);
+ arg = ofpbuf_put_hex(ofpacts, arg, NULL);
+ if (arg[0]) {
+ return xstrdup("bad hex digit in `note' argument");