ipmid: allow command not found for filtered commands

Filters are executed first and the actual ipmi command handler will not
execute if the filter rejects it for any reason.

However, if a filter returns a value for a command that is not even
implemented, the old logic would return that value instead of command
not implemented (C1h). This is incorrect behavior.

This fix will run the filter and then check to see if the command is
registered. If the command is registered AND the filter has returned
some error, only then will the filter error get returned. If the command
is registered and the filter returns no error, the command is executed.
If the command is not registered, C1h is returned, as per the spec.

Tested:
    1) Add some bogus command definitions to the whitelist filter
    2) Run the bogus command
    3) See that C1h is returned, not insufficient privilege

Change-Id: I069df8f47a169d6b2961460a561bf9cae6ae285c
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
1 file changed