X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=ofproto%2Fconnmgr.c;h=77b7b3916bc64d967c2957474be75d336ea080a1;hb=07c8ec217b5641b74f20b216ad63fef230649f2c;hp=928c56d033b8f3dfd1cd27f148ba76379d59a7eb;hpb=df30f9b1cde861e157059d225f46e16826fe13c0;p=sliver-openvswitch.git diff --git a/ofproto/connmgr.c b/ofproto/connmgr.c index 928c56d03..77b7b3916 100644 --- a/ofproto/connmgr.c +++ b/ofproto/connmgr.c @@ -976,29 +976,26 @@ void ofconn_send_error(const struct ofconn *ofconn, const struct ofp_header *request, enum ofperr error) { + static struct vlog_rate_limit err_rl = VLOG_RATE_LIMIT_INIT(10, 10); struct ofpbuf *reply; reply = ofperr_encode_reply(error, request); - if (reply) { - static struct vlog_rate_limit err_rl = VLOG_RATE_LIMIT_INIT(10, 10); - - if (!VLOG_DROP_INFO(&err_rl)) { - const char *type_name; - size_t request_len; - enum ofpraw raw; - - request_len = ntohs(request->length); - type_name = (!ofpraw_decode_partial(&raw, request, - MIN(64, request_len)) - ? ofpraw_get_name(raw) - : "invalid"); - - VLOG_INFO("%s: sending %s error reply to %s message", - rconn_get_name(ofconn->rconn), ofperr_to_string(error), - type_name); - } - ofconn_send_reply(ofconn, reply); - } + if (!VLOG_DROP_INFO(&err_rl)) { + const char *type_name; + size_t request_len; + enum ofpraw raw; + + request_len = ntohs(request->length); + type_name = (!ofpraw_decode_partial(&raw, request, + MIN(64, request_len)) + ? ofpraw_get_name(raw) + : "invalid"); + + VLOG_INFO("%s: sending %s error reply to %s message", + rconn_get_name(ofconn->rconn), ofperr_to_string(error), + type_name); + } + ofconn_send_reply(ofconn, reply); } /* Same as pktbuf_retrieve(), using the pktbuf owned by 'ofconn'. */