summaryrefslogtreecommitdiff
path: root/lib/ipmi_firewall.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2016-02-20 02:12:40 +0100
committerJörg Frings-Fürst <debian@jff-webhosting.net>2016-02-20 02:12:40 +0100
commit97d6a2e491c6ed08473beb2c4bac47c5cbc1201a (patch)
tree728b931c62b22ea55a13b292f6f77930897067fd /lib/ipmi_firewall.c
parent55031e72e6c02b4ae63e9052bad1a4b40002ac18 (diff)
Imported Upstream version 1.8.16upstream/1.8.16
Diffstat (limited to 'lib/ipmi_firewall.c')
-rw-r--r--lib/ipmi_firewall.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/ipmi_firewall.c b/lib/ipmi_firewall.c
index 8bda398..c3f51ad 100644
--- a/lib/ipmi_firewall.c
+++ b/lib/ipmi_firewall.c
@@ -512,7 +512,7 @@ _set_command_enables(struct ipmi_intf * intf,
{
struct ipmi_rs * rsp;
struct ipmi_rq req;
- unsigned char * d, rqdata[19];
+ unsigned char rqdata[19];
unsigned int c;
if (!p || !lnfn) {
@@ -568,8 +568,6 @@ _set_command_enables(struct ipmi_intf * intf,
return -1;
}
- d = rsp->data;
-
memset(&req, 0, sizeof(req));
req.msg.netfn = IPMI_NETFN_APP;
req.msg.cmd = BMC_SET_COMMAND_ENABLES;
@@ -591,7 +589,6 @@ _set_command_enables(struct ipmi_intf * intf,
return -1;
}
- d = rsp->data;
return 0;
}
@@ -1017,7 +1014,8 @@ ipmi_firewall_enable_disable(struct ipmi_intf * intf, int enable, int argc, char
{
struct ipmi_function_params p = {0xe, -1, -1, -1, -1};
struct bmc_fn_support * bmc_fn_support;
- unsigned int l, n, c, ret;
+ int ret;
+ unsigned int l, n, c;
unsigned char enables[MAX_COMMAND_BYTES];
if (argc < 1 || strncmp(argv[0], "help", 4) == 0) {
@@ -1107,10 +1105,15 @@ ipmi_firewall_reset(struct ipmi_intf * intf, int argc, char ** argv)
{
struct ipmi_function_params p = {0xe, -1, -1, -1, -1};
struct bmc_fn_support * bmc_fn_support;
- unsigned int l, n, c, ret;
+ int ret;
+ unsigned int l, n, c;
unsigned char enables[MAX_COMMAND_BYTES];
- if (argc > 0 || (argc > 0 && strncmp(argv[0], "help", 4) == 0)) {
+ if (argc < 1) {
+ lprintf(LOG_ERR, "Not enough parameters given.");
+ printf_firewall_usage();
+ return (-1);
+ } else if (argc > 0 && strncmp(argv[0], "help", 4) == 0) {
printf_firewall_usage();
return 0;
}