* error message code (composed with ofp_mkerr()) for the caller to propagate
* upward. Otherwise, returns 0.
*
- * 'oh' is used to make log messages more informative. */
+ * The log message mentions 'msg_type'. */
static int
-reject_slave_controller(struct ofconn *ofconn, const struct ofp_header *oh)
+reject_slave_controller(struct ofconn *ofconn, const const char *msg_type)
{
if (ofconn->type == OFCONN_PRIMARY && ofconn->role == NX_ROLE_SLAVE) {
static struct vlog_rate_limit perm_rl = VLOG_RATE_LIMIT_INIT(1, 5);
- char *type_name;
-
- type_name = ofp_message_type_to_string(oh->type);
VLOG_WARN_RL(&perm_rl, "rejecting %s message from slave controller",
- type_name);
- free(type_name);
+ msg_type);
return ofp_mkerr(OFPET_BAD_REQUEST, OFPBRC_EPERM);
} else {
uint16_t in_port;
int error;
- error = reject_slave_controller(ofconn, oh);
+ error = reject_slave_controller(ofconn, "OFPT_PACKET_OUT");
if (error) {
return error;
}
struct ofport *port;
int error;
- error = reject_slave_controller(ofconn, oh);
+ error = reject_slave_controller(ofconn, "OFPT_PORT_MOD");
if (error) {
return error;
}
size_t n_actions;
int error;
- error = reject_slave_controller(ofconn, &ofm->header);
+ error = reject_slave_controller(ofconn, "OFPT_FLOW_MOD");
if (error) {
return error;
}