@@ -4165,14 +4165,33 @@ static int handle_lan_get_msg_cmd(struct ipmi_smi *intf,
4165
4165
rcu_read_unlock ();
4166
4166
4167
4167
if (user == NULL ) {
4168
- /* We didn't find a user, just give up. */
4168
+ /* We didn't find a user, just give up and return an error . */
4169
4169
ipmi_inc_stat (intf , unhandled_commands );
4170
4170
4171
+ msg -> data [0 ] = (IPMI_NETFN_APP_REQUEST << 2 );
4172
+ msg -> data [1 ] = IPMI_SEND_MSG_CMD ;
4173
+ msg -> data [2 ] = chan ;
4174
+ msg -> data [3 ] = msg -> rsp [4 ]; /* handle */
4175
+ msg -> data [4 ] = msg -> rsp [8 ]; /* rsSWID */
4176
+ msg -> data [5 ] = ((netfn + 1 ) << 2 ) | (msg -> rsp [9 ] & 0x3 );
4177
+ msg -> data [6 ] = ipmb_checksum (& msg -> data [3 ], 3 );
4178
+ msg -> data [7 ] = msg -> rsp [5 ]; /* rqSWID */
4179
+ /* rqseq/lun */
4180
+ msg -> data [8 ] = (msg -> rsp [9 ] & 0xfc ) | (msg -> rsp [6 ] & 0x3 );
4181
+ msg -> data [9 ] = cmd ;
4182
+ msg -> data [10 ] = IPMI_INVALID_CMD_COMPLETION_CODE ;
4183
+ msg -> data [11 ] = ipmb_checksum (& msg -> data [7 ], 4 );
4184
+ msg -> data_size = 12 ;
4185
+
4186
+ dev_dbg (intf -> si_dev , "Invalid command: %*ph\n" ,
4187
+ msg -> data_size , msg -> data );
4188
+
4189
+ smi_send (intf , intf -> handlers , msg , 0 );
4171
4190
/*
4172
- * Don't do anything with these messages, just allow
4173
- * them to be freed.
4191
+ * We used the message, so return the value that
4192
+ * causes it to not be freed or queued .
4174
4193
*/
4175
- rv = 0 ;
4194
+ rv = -1 ;
4176
4195
} else {
4177
4196
recv_msg = ipmi_alloc_recv_msg ();
4178
4197
if (!recv_msg ) {
0 commit comments