X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;ds=sidebyside;f=ofproto%2Fconnmgr.c;h=6432ba660ab66a4178f1a80aa1ba1011a3b0891d;hb=537559908e6ea61223d46fa3d49ffa15218eb75e;hp=2d0b8c5d5a56ff963951389bfb90a32aee6dced1;hpb=747b434cd8adc3f4ef26f456ffd45873dd748c0d;p=sliver-openvswitch.git diff --git a/ofproto/connmgr.c b/ofproto/connmgr.c index 2d0b8c5d5..6432ba660 100644 --- a/ofproto/connmgr.c +++ b/ofproto/connmgr.c @@ -828,8 +828,30 @@ void ofconn_send_error(const struct ofconn *ofconn, const struct ofp_header *request, int error) { - struct ofpbuf *msg = ofputil_encode_error_msg(error, request); + struct ofpbuf *msg; + + msg = ofputil_encode_error_msg(error, request); if (msg) { + static struct vlog_rate_limit err_rl = VLOG_RATE_LIMIT_INIT(10, 10); + + if (!VLOG_DROP_INFO(&err_rl)) { + const struct ofputil_msg_type *type; + const char *type_name; + size_t request_len; + char *error_s; + + request_len = ntohs(request->length); + type_name = (!ofputil_decode_msg_type_partial(request, + MIN(64, request_len), + &type) + ? ofputil_msg_type_name(type) + : "invalid"); + + error_s = ofputil_error_to_string(error); + VLOG_INFO("%s: sending %s error reply to %s message", + rconn_get_name(ofconn->rconn), error_s, type_name); + free(error_s); + } ofconn_send_reply(ofconn, msg); } }