X-Git-Url: http://git.cascardo.eti.br/?a=blobdiff_plain;f=lib%2Fofp-errors.c;h=f9e1fa9b71f9c4d152c79575763ce1dc9a0882c5;hb=0a2869d524fc3612b4b77a9df4991bff2aa3b465;hp=61591052070f7adac046ccecf1939220c33efce4;hpb=de658847fd5703ac7ac6413ec29ecf7f4db91421;p=cascardo%2Fovs.git diff --git a/lib/ofp-errors.c b/lib/ofp-errors.c index 615910520..f9e1fa9b7 100644 --- a/lib/ofp-errors.c +++ b/lib/ofp-errors.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, 2014 Nicira, Inc. + * Copyright (c) 2012, 2013, 2014, 2016 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -284,17 +284,15 @@ ofperr_decode_msg(const struct ofp_header *oh, struct ofpbuf *payload) const struct ofp_error_msg *oem; enum ofpraw raw; uint16_t type, code; - enum ofperr error; uint32_t vendor; - struct ofpbuf b; if (payload) { memset(payload, 0, sizeof *payload); } /* Pull off the error message. */ - ofpbuf_use_const(&b, oh, ntohs(oh->length)); - error = ofpraw_pull(&raw, &b); + struct ofpbuf b = ofpbuf_const_initializer(oh, ntohs(oh->length)); + enum ofperr error = ofpraw_pull(&raw, &b); if (error) { return 0; }