Cleanup dual bridge.

This commit is contained in:
Ales Ledvinka 2013-11-05 16:39:33 +01:00
parent 3df5c2ec8e
commit 08663e5c7e
11 changed files with 45 additions and 4502 deletions

View File

@ -1,14 +0,0 @@
diff -up ipmitool-1.8.12/lib/helper.c.systemd ipmitool-1.8.12/lib/helper.c
--- ipmitool-1.8.12/lib/helper.c.systemd 2012-08-13 14:24:47.391037471 +0200
+++ ipmitool-1.8.12/lib/helper.c 2012-08-13 14:24:53.088016793 +0200
@@ -549,10 +549,6 @@ ipmi_start_daemon(struct ipmi_intf *intf
sigset_t sighup;
#endif
- /* if we are started from init no need to become daemon */
- if (getppid() == 1)
- return;
-
#ifdef SIGHUP
sigemptyset(&sighup);
sigaddset(&sighup, SIGHUP);

View File

@ -1,13 +0,0 @@
diff -up ./lib/ipmi_sol.c.activate-core ./lib/ipmi_sol.c
--- ./lib/ipmi_sol.c.activate-core 2012-11-16 15:30:07.847679142 +0100
+++ ./lib/ipmi_sol.c 2012-11-16 15:30:50.263695103 +0100
@@ -163,8 +163,7 @@ ipmi_sol_payload_access_status(struct ip
rsp = intf->sendrecv(intf, &req);
if (rsp == NULL) {
- lprintf(LOG_ERR, "Error: Unexpected data length (%d) received",
- rsp->data_len);
+ lprintf(LOG_ERR, "Error: No valid response.\n");
return -1;
}

View File

@ -1,22 +0,0 @@
diff -up ipmitool-1.8.12/lib/ipmi_chassis.c.bigendian ipmitool-1.8.12/lib/ipmi_chassis.c
--- ipmitool-1.8.12/lib/ipmi_chassis.c.bigendian 2012-09-04 16:01:55.000000000 +0200
+++ ipmitool-1.8.12/lib/ipmi_chassis.c 2012-09-04 16:02:20.000000000 +0200
@@ -41,6 +41,7 @@
#include <ipmitool/ipmi_intf.h>
#include <ipmitool/ipmi_strings.h>
#include <ipmitool/ipmi_chassis.h>
+#include <ipmitool/bswap.h>
extern int verbose;
diff -up ipmitool-1.8.12/lib/ipmi_pef.c.bigendian ipmitool-1.8.12/lib/ipmi_pef.c
--- ipmitool-1.8.12/lib/ipmi_pef.c.bigendian 2012-09-04 16:02:05.000000000 +0200
+++ ipmitool-1.8.12/lib/ipmi_pef.c 2012-09-04 16:02:30.000000000 +0200
@@ -39,6 +39,7 @@
#include <ipmitool/ipmi.h>
#include <ipmitool/ipmi_intf.h>
#include <ipmitool/ipmi_pef.h>
+#include <ipmitool/bswap.h>
extern int verbose;
/*

View File

@ -1,17 +0,0 @@
diff -up ipmitool-1.8.12/lib/ipmi_delloem.c.bigendian2 ipmitool-1.8.12/lib/ipmi_delloem.c
--- ipmitool-1.8.12/lib/ipmi_delloem.c.bigendian2 2012-10-18 09:46:07.641569464 +0200
+++ ipmitool-1.8.12/lib/ipmi_delloem.c 2012-10-18 09:46:23.471318242 +0200
@@ -4283,10 +4283,10 @@ static int ipmi_set_power_cap(struct ipm
}
#if WORDS_BIGENDIAN
ipmipowercap.PowerCap = BSWAP_16(ipmipowercap.PowerCap);
- ipmipowercap.MaximumPowerConsump = BSWAP_16(ipmipowercap.MaximumPowerConsump);
- ipmipowercap.MinumumPowerConsump = BSWAP_16(ipmipowercap.MinimumPowerConsump);
+ ipmipowercap.MaximumPowerConsmp = BSWAP_16(ipmipowercap.MaximumPowerConsmp);
+ ipmipowercap.MinimumPowerConsmp = BSWAP_16(ipmipowercap.MinimumPowerConsmp);
ipmipowercap.AvailablePower = BSWAP_16(ipmipowercap.AvailablePower);
- ipmipowercap.totalnumpowersupp = BSWP_16(ipmipowercap.totalnumpowersupp);
+ ipmipowercap.totalnumpowersupp = BSWAP_16(ipmipowercap.totalnumpowersupp);
#endif
memset(data, 0, 13);

View File

@ -1,12 +0,0 @@
diff -up ./lib/ipmi_main.c.cip ./lib/ipmi_main.c
--- ./lib/ipmi_main.c.cip 2012-11-16 14:03:17.729119605 +0100
+++ ./lib/ipmi_main.c 2012-11-16 14:03:25.448123005 +0100
@@ -382,7 +382,7 @@ ipmi_main(int argc, char ** argv,
char * seloem = NULL;
int port = 0;
int devnum = 0;
- int cipher_suite_id = 1; /* See table 22-19 of the IPMIv2 spec */
+ int cipher_suite_id = 3; /* See table 22-19 of the IPMIv2 spec */
int argflag, i, found;
int rc = -1;
char sol_escape_char = SOL_ESCAPE_CHARACTER_DEFAULT;

View File

@ -1,163 +0,0 @@
diff -up ./ipmitool.1.manover ./ipmitool.1
--- doc/ipmitool.1.manover 2012-12-12 02:04:40.870399182 +0100
+++ doc/ipmitool.1 2012-12-12 02:25:08.368992981 +0100
@@ -2,38 +2,57 @@
.SH "NAME"
ipmitool \- utility for controlling IPMI\-enabled devices
.SH "SYNOPSIS"
-ipmitool [\fB\-c\fR|\fB\-h\fR|\fB\-d \fIN\fP\fR|\fB\-v\fR|\fB\-V\fR]
-\fB\-I\fR \fIopen\fP <\fIcommand\fP>
-ipmitool [\fB\-c\fR|\fB\-h\fR|\fB\-v\fR|\fB\-V\fR]
-\fB\-I\fR \fIlan\fP \fB\-H\fR <\fIhostname\fP>
- [\fB\-p\fR <\fIport\fP>]
- [\fB\-U\fR <\fIusername\fP>]
- [\fB\-A\fR <\fIauthtype\fP>]
- [\fB\-L\fR <\fIprivlvl\fP>]
- [\fB\-a\fR|\fB\-E\fR|\fB\-P\fR|\fB\-f\fR <\fIpassword\fP>]
- [\fB\-o\fR <\fIoemtype\fP>]
- [\fB\-O\fR <\fIsel oem\fP>]
- [\fB\-e\fR <\fIesc_char\fP>]
- [\fB\-N\fR <\fIsec\fP>]
- [\fB\-R\fR <\fIcount\fP>]
- <\fIcommand\fP>
-
-ipmitool [\fB\-c\fR|\fB\-h\fR|\fB\-v\fR|\fB\-V\fR]
-\fB\-I\fR \fIlanplus\fP \fB\-H\fR <\fIhostname\fP>
- [\fB\-p\fR <\fIport\fP>]
- [\fB\-U\fR <\fIusername\fP>]
- [\fB\-L\fR <\fIprivlvl\fP>]
- [\fB\-a\fR|\fB\-E\fR|\fB\-P\fR|\fB\-f\fR <\fIpassword\fP>]
- [\fB\-o\fR <\fIoemtype\fP>]
- [\fB\-O\fR <\fIsel oem\fP>]
- [\fB\-C\fR <\fIciphersuite\fP>]
- [\fB\-Y\fR|[\fB\-K\fR|\fB\-k\fR <\fIkg_key\fP>]
- [\fB\-y\fR <\fIhex_kg_key\fP>]
- [\fB\-e\fR <\fIesc_char\fP>]
- [\fB\-N\fR <\fIsec\fP>]
- [\fB\-R\fR <\fIcount\fP>]
- <\fIcommand\fP>
+ipmitool [ <options> ] <command> [ <sub-commands and sub-options> ]
+
+<options> := [ <general-options> | <conditional-opts> ]
+.br
+Any recognized option is accepted. Conditional options may be ignored or it's usage postponed until shell or exec processes relevant command.
+.br
+
+<general-options> := [ -h | -V | -v | -I <interface> | -H <address> |
+ -d <N> | -p <port> | -c | -U <username> |
+ -L <privlvl> | -l <lun> | -m <local_address> |
+ -N <sec> | -R <count> | <password-option> |
+ <oem-option> | <bridge-options> ]
+
+<conditional-opts> := [ <lan-options> | <lanplus-options> |
+ <command-options> ]
+.br
+Bridging:
+.br
+<bridge-options> := -t <target_address> [ -b <channel> |
+ [ -T <address> | -B <channel> ] ]
+.br
+
+Options used with -I lan:
+.br
+<lan-options> := [ -A <authtype> ]
+.br
+
+Options used with -I lanplus:
+.br
+<lanplus-options> := [ -C <ciphersuite> | <key-option> ]
+.br
+
+Option groups setting same value:
+.br
+<key-option> := [ -k <key> | -K | -y <hex_key> | -Y ]
+.br
+<password-option> := [ -f <password_file> | -a | -P <password> | -E ]
+.br
+<oem-option> := [ -o <oemtype> | -g | -s ]
+.br
+
+Options used with specific command <command-options>:
+.br
+<options-sdr> := [ -S <sdr_cache_file> ]
+.br
+<options-sel> := [ -O <sel_oem> ]
+.br
+<options-sol> := [ -e <sol_escape_char> ]
+
+
.SH "DESCRIPTION"
This program lets you manage Intelligent Platform Management Interface
(IPMI) functions of either the local system, via a kernel device driver,
@@ -87,7 +106,7 @@ is to use \fI~\fP but this can conflict
.TP
\fB\-E\fR
The remote server password is specified by the environment
-variable \fIIPMI_PASSWORD\fP.
+variable \fIIPMI_PASSWORD\fP or \fIIPMITOOL_PASSWORD\fP. The \fIIPMITOOL_PASSWORD\fP takes precedence.
.TP
\fB\-f\fR <\fIpassword_file\fP>
Specifies a file containing the remote server password. If this
@@ -121,6 +140,8 @@ Set destination lun for raw commands.
\fB\-L\fR <\fIprivlvl\fP>
Force session privilege level. Can be CALLBACK, USER,
OPERATOR, ADMINISTRATOR. Default is ADMINISTRATOR.
+This value is ignored and always set to ADMINISTRATOR when
+combined with \fI-t target address\fP.
.TP
\fB\-m\fR <\fIlocal_address\fP>
Set the local IPMB address. The default is 0x20 and there
@@ -131,7 +152,9 @@ Set transit local address for bridge req
.TP
\fB\-N\fR <\fIsec\fP>
Specify nr. of seconds between retransmissions of lan/lanplus messages.
-Default are 2 seconds for lan and 1 second for lanplus interfaces.
+Defaults are 2 seconds for lan and 1 second for lanplus interfaces.
+Command \fIraw\fP uses fixed value of 15 seconds.
+Command \fIsol\fP uses fixed value of 1 second.
.TP
\fB\-o\fR <\fIoemtype\fP>
Select OEM type to support. This usually involves minor hacks
@@ -154,6 +177,8 @@ option is not recommended.
.TP
\fB\-R\fR <\fIcount\fP>
Set the number of retries for lan/lanplus interface (default=4).
+Command \fIraw\fP uses fixed value of one try (no retries).
+Command \fIhpm\fP uses fixed value of 10 retries.
.TP
\fB\-s\fR
Deprecated. Use: -o supermicro
@@ -166,7 +191,8 @@ SDR cache from a remote system can be cr
\fIsdr dump\fP command.
.TP
\fB\-t\fR <\fItarget_address\fP>
-Bridge IPMI requests to the remote target address.
+Bridge IPMI requests to the remote target address. Default is 32.
+The \fI-L privlvl\fP option is always ignored and value set to ADMINISTRATOR.
.TP
\fB\-T\fR <\fItransmit_address\fP>
Set transit address for bridge request. (dual bridge)
@@ -178,7 +204,11 @@ Remote server username, default is NULL
Increase verbose output level. This option may be specified
multiple times to increase the level of debug output. If given
three times you will get hexdumps of all incoming and
-outgoing packets.
+outgoing packets. Using it five times provides details
+on request and expected reply procesing. The \fIhpm\fP commands
+\fItargetcap\fP \fIcompprop\fP \fIabort\fP \fIupgstatus\fP
+\fIrollback\fP \fIrollbackstatus\fP \fIselftestresult\fP increases
+the verbosity level
.TP
\fB\-V\fR
Display version information.
@@ -2758,6 +2788,9 @@ Remote RMCP port.
\fIcsv\fP [\fBlevel\fR]
Enable output in comma separated format.
+Affects following commands:
+\fIuser\fP, \fIchannel\fP, \fIisol\fP, \fIsunoem\fP,
+\fIsol\fP, \fIsensor\fP, \fIsdr\fP, \fIsel\fP, \fIsession\fP.
.RS
.RE
.TP

View File

@ -1,163 +0,0 @@
diff -up ./lib/ipmi_main.c.minleaks ./lib/ipmi_main.c
--- ./lib/ipmi_main.c.minleaks 2012-12-12 11:44:02.177217050 +0100
+++ ./lib/ipmi_main.c 2012-12-12 12:18:11.967076191 +0100
@@ -387,6 +387,7 @@ ipmi_main(int argc, char ** argv,
uint32_t timeout = 0;
int authtype = -1;
char * tmp = NULL;
+ char * tmpe = NULL;
char * hostname = NULL;
char * username = NULL;
char * password = NULL;
@@ -412,6 +413,8 @@ ipmi_main(int argc, char ** argv,
{
switch (argflag) {
case 'I':
+ if (intfname)
+ free(intfname);
intfname = strdup(optarg);
if (intfname == NULL) {
lprintf(LOG_ERR, "%s: malloc failure", progname);
@@ -489,6 +492,8 @@ ipmi_main(int argc, char ** argv,
csv_output = 1;
break;
case 'H':
+ if (hostname)
+ free(hostname);
hostname = strdup(optarg);
if (hostname == NULL) {
lprintf(LOG_ERR, "%s: malloc failure", progname);
@@ -504,6 +509,8 @@ ipmi_main(int argc, char ** argv,
"from file %s", optarg);
break;
case 'a':
+ if (tmp)
+ free(tmp);
#ifdef HAVE_GETPASSPHRASE
tmp = getpassphrase("Password: ");
#else
@@ -520,6 +527,8 @@ ipmi_main(int argc, char ** argv,
}
break;
case 'k':
+ if (kgkey)
+ free(kgkey);
kgkey = strdup(optarg);
if (kgkey == NULL) {
lprintf(LOG_ERR, "%s: malloc failure", progname);
@@ -527,10 +536,10 @@ ipmi_main(int argc, char ** argv,
}
break;
case 'K':
- if ((tmp = getenv("IPMI_KGKEY"))) {
+ if ((tmpe = getenv("IPMI_KGKEY"))) {
if (kgkey)
free(kgkey);
- kgkey = strdup(tmp);
+ kgkey = strdup(tmpe);
if (kgkey == NULL) {
lprintf(LOG_ERR, "%s: malloc failure", progname);
goto out_free;
@@ -540,6 +549,8 @@ ipmi_main(int argc, char ** argv,
}
break;
case 'y':
+ if (kgkey)
+ free(kgkey);
kgkey = ipmi_parse_hex(optarg);
if (kgkey == NULL) {
goto out_free;
@@ -547,14 +558,14 @@ ipmi_main(int argc, char ** argv,
break;
case 'Y':
#ifdef HAVE_GETPASSPHRASE
- tmp = getpassphrase("Key: ");
+ tmpe = getpassphrase("Key: ");
#else
- tmp = getpass("Key: ");
+ tmpe = getpass("Key: ");
#endif
- if (tmp != NULL) {
+ if (tmpe != NULL) {
if (kgkey)
free(kgkey);
- kgkey = strdup(tmp);
+ kgkey = strdup(tmpe);
if (kgkey == NULL) {
lprintf(LOG_ERR, "%s: malloc failure", progname);
goto out_free;
@@ -562,6 +573,8 @@ ipmi_main(int argc, char ** argv,
}
break;
case 'U':
+ if (username)
+ free(username);
if (strlen(optarg) > 16) {
lprintf(LOG_ERR, "Username is too long (> 16 bytes)");
goto out_free;
@@ -573,6 +586,8 @@ ipmi_main(int argc, char ** argv,
}
break;
case 'S':
+ if (sdrcache)
+ free(sdrcache);
sdrcache = strdup(optarg);
if (sdrcache == NULL) {
lprintf(LOG_ERR, "%s: malloc failure", progname);
@@ -581,6 +596,8 @@ ipmi_main(int argc, char ** argv,
break;
#ifdef ENABLE_ALL_OPTIONS
case 'o':
+ if (oemtype)
+ free(oemtype);
oemtype = strdup(optarg);
if (oemtype == NULL) {
lprintf(LOG_ERR, "%s: malloc failure", progname);
@@ -595,10 +612,14 @@ ipmi_main(int argc, char ** argv,
break;
case 'g':
/* backwards compatible oem hack */
+ if (oemtype)
+ free(oemtype);
oemtype = strdup("intelwv2");
break;
case 's':
/* backwards compatible oem hack */
+ if (oemtype)
+ free(oemtype);
oemtype = strdup("supermicro");
break;
case 'P':
@@ -615,19 +636,19 @@ ipmi_main(int argc, char ** argv,
memset(optarg, 'X', i);
break;
case 'E':
- if ((tmp = getenv("IPMITOOL_PASSWORD"))) {
+ if ((tmpe = getenv("IPMITOOL_PASSWORD"))) {
if (password)
free(password);
- password = strdup(tmp);
+ password = strdup(tmpe);
if (password == NULL) {
lprintf(LOG_ERR, "%s: malloc failure", progname);
goto out_free;
}
}
- else if ((tmp = getenv("IPMI_PASSWORD"))) {
+ else if ((tmpe = getenv("IPMI_PASSWORD"))) {
if (password)
free(password);
- password = strdup(tmp);
+ password = strdup(tmpe);
if (password == NULL) {
lprintf(LOG_ERR, "%s: malloc failure", progname);
goto out_free;
@@ -697,6 +718,8 @@ ipmi_main(int argc, char ** argv,
sol_escape_char = optarg[0];
break;
case 'O':
+ if (seloem)
+ free(seloem);
seloem = strdup(optarg);
if (seloem == NULL) {
lprintf(LOG_ERR, "%s: malloc failure", progname);

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,13 @@
diff -up ipmitool-1.8.13/doc/ipmitool.1.dualbridge ipmitool-1.8.13/doc/ipmitool.1
--- ipmitool-1.8.13/doc/ipmitool.1.dualbridge 2013-11-05 10:10:20.139940133 +0100
+++ ipmitool-1.8.13/doc/ipmitool.1 2013-11-05 10:10:35.197947425 +0100
@@ -156,9 +156,6 @@ Set the local IPMB address. The local a
or is auto discovered on PICMG platforms when -m is not specified.
There should be no need to change the local address for normal operation.
.TP
-\fB\-M\fR <\fIaddress\fP>
-Set transit local address for bridge request. (dual bridge)
-.TP
\fB\-N\fR <\fIsec\fP>
Specify nr. of seconds between retransmissions of lan/lanplus messages.
Defaults are 2 seconds for lan and 1 second for lanplus interfaces.

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +1,11 @@
Name: ipmitool
Summary: Utility for IPMI control
Version: 1.8.13
Release: 1%{?dist}
Release: 2%{?dist}
License: BSD
Group: System Environment/Base
URL: http://ipmitool.sourceforge.net/
Source0: %{name}-%{version}.tar.bz2
Source0: http://downloads.sourceforge.net/project/%{name}/%{name}/%{version}/%{name}-%{version}.tar.bz2
Source1: openipmi-ipmievd.sysconf
Source2: ipmievd.service
Source3: exchange-bmc-os-info.service
@ -17,6 +17,7 @@ BuildRequires: openssl-devel readline-devel ncurses-devel
BuildRequires: systemd-units
# bootstrap
BuildRequires: automake autoconf libtool
Requires:OpenIPMI-modalias
Requires(post): systemd-sysv
Requires(post): systemd-units
Requires(preun): systemd-units
@ -33,6 +34,8 @@ Patch4: cxoem-jb-cx6.patch
Patch5: ipmitool-1.8.12-fips.patch
# pending
Patch6: ipmitool-1.8.12-fipsman.patch
# pending https://sourceforge.net/p/ipmitool/bugs/280/
Patch7: ipmitool-1.8.13-dualbridgedoc.patch
%description
This package contains a utility for interfacing with devices that support
@ -49,9 +52,21 @@ displaying sensor values, displaying the contents of the System Event
Log (SEL), printing Field Replaceable Unit (FRU) information, reading and
setting LAN configuration, and chassis power control.
%package -n bmc-snmp-proxy
Requires: net-snmp
Requires: exchange-bmc-os-info
Requires:OpenIPMI-modalias
BuildArch: noarch
Summary: Reconfigure SNMP to include host SNMP agent within BMC
%description -n bmc-snmp-proxy
Given a host with BMC, this package would extend system configuration
of net-snmp to include redirections to BMC based SNMP.
%package -n exchange-bmc-os-info
Requires: hostname
Requires: ipmitool OpenIPMI
Requires:OpenIPMI-modalias
BuildArch: noarch
Requires(post): systemd-sysv
Requires(post): systemd-units
@ -75,6 +90,7 @@ for the host OS to use.
%patch4 -p1 -b .cxoem
%patch5 -p0 -b .fips
%patch6 -p0 -b .fipsman
%patch7 -p1 -b .dualbridgedoc
for f in AUTHORS ChangeLog; do
iconv -f iso-8859-1 -t utf8 < ${f} > ${f}.utf8
@ -104,8 +120,6 @@ make %{?_smp_mflags}
%install
make DESTDIR=%{buildroot} install
#mkdir -p %{buildroot}%{_sysconfdir}/profile.d
install -Dpm 644 %{SOURCE2} %{buildroot}%{_unitdir}/ipmievd.service
install -Dpm 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/sysconfig/ipmievd
install -Dm 644 %{SOURCE3} %{buildroot}%{_unitdir}/exchange-bmc-os-info.service
@ -114,6 +128,10 @@ install -Dm 644 %{SOURCE5} %{buildroot}%{_sysconfdir}/profile.d/set-bmc-url.sh
install -Dm 755 %{SOURCE6} %{buildroot}%{_libexecdir}/exchange-bmc-os-info
install -Dm 644 contrib/bmc-snmp-proxy.sysconf %{buildroot}%{_sysconfdir}/sysconfig/bmc-snmp-proxy
install -Dm 644 contrib/bmc-snmp-proxy.service %{buildroot}%{_unitdir}/bmc-snmp-proxy.service
install -Dm 755 contrib/bmc-snmp-proxy %{buildroot}%{_libexecdir}/bmc-snmp-proxy
%post
%systemd_post ipmievd.service
@ -158,8 +176,18 @@ install -Dm 755 %{SOURCE6} %{buildroot}%{_libexecdir}/exchange-bmc-os-info
%{_unitdir}/exchange-bmc-os-info.service
%{_libexecdir}/exchange-bmc-os-info
%files -n bmc-snmp-proxy
%config(noreplace) %{_sysconfdir}/sysconfig/bmc-snmp-proxy
%{_unitdir}/bmc-snmp-proxy.service
%{_libexecdir}/bmc-snmp-proxy
%changelog
* Tue Nov 5 2013 Ales Ledvinka <aledvink@redhat.com> 1.8.13-3
- Cleanup of dual bridge option.
* Tue Oct 15 2013 Ales Ledvinka <aledvink@redhat.com> 1.8.13-2
- BMC SNMP agent redirection
* Mon Oct 14 2013 Ales Ledvinka <aledvink@redhat.com> 1.8.13-1
- Upstream release 1.8.13