1337 Commits

Author SHA1 Message Date
Zdenek Styblik
14e26ac8a0 ID: 3611253 - configure.in - do not override OS-default values for interfaces
Commit fixes bug where OS default values were over-ridden if the corresponding
enable/disable arguments weren't provided via command-line parameters.
Commit also changes IPMI shell default configuration setting from 'yes' to
'auto'.

Commit for Dmitry Bazhenov
2013-04-26 19:16:31 +00:00
Zdenek Styblik
cee211da31 ID: 3611253 - configure.in - fixed build for the newer autotool releases
Commit for Dmitry Bazhenov
2013-04-25 08:50:53 +00:00
Zdenek Styblik
3818c0d296 ID: 3611253 - Don't print AUX info if IPMC returns 12byte Get Device ID response
Commit for Dmitry Bazhenov
2013-04-25 08:40:56 +00:00
Zdenek Styblik
ae05861b62 ID: 3611253 - 'lib/ipmi_sel.c' - avoid reading of uninitialized data
Zero data before making request in order to avoid reading of uninitialized data
in ipmi_sel_add_entry().

Commit for Dmitry Bazhenov
2013-04-25 08:29:45 +00:00
Zdenek Styblik
c29cf4bcd3 ID: 3611303 - 'src/plugins/lan/lan.c' - error check is missing braces
Fixed a bug where connecting to a remote shelf manager via the lan
interface would always fail with:

``Activate Session error: Session sequence out of range Error: Unable
to establish LAN session''

This is due to a bug introduced in get_random() by fix for ID#3600963 where
braces were missing from an error check.

Commit for Dan Gora
2013-04-25 07:50:45 +00:00
Zdenek Styblik
723e3da037 ID: 3611306 - 'lib/ipmi_tsol.c' - fix always fail in case of error
Commit fixes bug introduced by fix for ID#3600946 where
an error case was missing braces, so it would always fail.

Commit for Dan Gora
2013-04-25 07:43:07 +00:00
Zdenek Styblik
c72afa37ee ID: 3608760 - Add bswap.h to ipmi_chassis.c and ipmi_pef.c
ID: 3564701 - ipmitool 1.8.12 doesn't build on big endian architectures

Compilation would fail on big endian architecture because BSWAP_32 was not
defined in 'ipmi_chassis.c' and 'ipmi_pef.c'.

The problem was '#include <ipmitool/bswap.h>' depended on WORDS_BIGENDIAN which
comes from '<config.h>'. However, none of the previous header files
would include '<config.h>', so it remained undefined.

'bswap.h' gets included unconditionally now.

Commit for Dan Gora
2013-04-25 07:34:44 +00:00
Zdenek Styblik
fa5bdb2f3d ID: 3608765 - improve debug output in ipmi_ekanalyzer_fru_file2structure()
Format the records a little more clearly by adding offsets.

Commit for Dan Gora
2013-04-23 07:28:53 +00:00
Zdenek Styblik
49784a9ec8 ID: 3608765 - Fix indentation of ipmi_ek_create_amc_p2p_record()
Commit changes indentation and formatting in ipmi_ek_create_amc_p2p_record().

Commit for Dan Gora
2013-04-22 11:12:11 +00:00
Zdenek Styblik
d1d404fef4 ID: 3608765 - Fix signed offset in ipmi_ekanalyzer_fru_file2structure
If the offset was greater than 127, then the multi_offset would end
up being a negative value, which is not what we want.

Commit for Dan Gora
2013-04-22 10:31:50 +00:00
Zdenek Styblik
de1dee44bd ID: 3608765 - ipmi_ekanalyzer_fru_file2structure would return error
ipmi_ekanalyzer_fru_file2structure would return ERROR_STATUS even if
it finished sucessfully.

Commit for Dan Gora
2013-04-22 10:18:11 +00:00
Zdenek Styblik
e1728327f6 ID: 3608765 - Fix printing in ipmi_ek_display_amc_p2p_record()
Change the amc channel descriptor ports to be displayed in decimal
instead of hex. This matches the 'fru -v' output in ipmitool.

Add decimal value of Link Asymetric Match values. So people don't have to
look up the value in the source or in the PIGMG spec.

Commit for Dan Gora
2013-04-22 10:05:53 +00:00
Zdenek Styblik
3b77db9a86 ID: 3608765 - ipmi_ekanalyzer.c - fix reading amc channel and link descriptors
Due to a bug in gcc where unaligned bit fields were not packed correctly
before gcc 4.4, we changed the fru_picmgext_amc_channel_desc_record
and fru_picmgext_amc_link_desc_record structures to use
larger types to be packed correctly. This then requires
us to use the FRU_PICMGEXT_AMC_CHANNEL_DESC_RECORD_SIZE and
FRU_PICMGEXT_AMC_LINK_DESC_RECORD_SIZE defines instead of sizeof for
these structures.

Updated ipmi_ek_create_amc_p2p_record() and
ipmi_ek_display_amc_p2p_record() to read data in the correct byte order
on both big and little endian machines.

Commit for Dan Gora
2013-04-22 09:50:53 +00:00
Zdenek Styblik
2abad0e504 ID: 3608757 - ipmi_fru.h/ipmi_fru.c - various fixes
Fixed several bugs with printing out the Carrier and AMC connectivity
information with 'ipmitool -v fru'

There were several bugs that were caused due to using bitfields with
char types in ipmi_fru.h. GCC versions before v4.4 had a bug where
they did not pack the bitfields correctly if the bitfields were not
cleanly aligned with the underlying char type.

Fixed and cleaned up all other PICMG FRU records.

Commit for Dan Gora
2013-04-22 08:37:13 +00:00
Zdenek Styblik
0411186443 ID: 3608765 - Fixed big endian bug in ipmi_ek_display_carrier_connectivity.
Fixed a bug where the carrier connectivity point to point descriptor
was not being displayed properly when compiled on big endian machines.

Commit for Dan Gora
2013-04-18 08:45:50 +00:00
Zdenek Styblik
1e96d20277 ID: 3608765 - Fixed bug reading length in fru info on big endian machines
Fixed bugs in ipmi_ek_display_chassis_info_area(),
ipmi_ek_display_product_info_area(), and
ipmi_ekanalyzer_fru_file2structure() where fread was being called to
read one byte of data into a int or long data type. This would result
in the value being byte swapped since the byte was read into the most
significant byte of the int (ie byte 0) on big endian machines.

Commit for Dan Gora
2013-04-18 08:27:33 +00:00
Zdenek Styblik
de4de4fc96 ID: 3608765 - Fixed bug in ipmi_ek_display_board_info_area()
Previous versions were not setting the file_offset properly if a Custom
board type was found, which would prevent subsequent dissectors from
operating properly and terminating the output of 'ipmitool ekanalyze
frushow oc=<atca carrier fruinfo>' early.

Rewrote ipmi_ek_display_board_info_area() to fix indentation and
to properly set the file_offset and end the while loop if a Custom
board_type was found.

Previous versions were also abusing the board_length variable,
treating it as an int and using it to break out of the loop.

Commit for Dan Gora
2013-04-18 07:57:26 +00:00
Zdenek Styblik
4299cfa385 ID: 3608765 - 'lib/ipmi_ekanalyzer.c' - reverse checks to reduce indentation
Rewrote ipmi_ek_display_chassis_info_area,
ipmi_ek_display_product_info_area, and
ipmi_ekanalyzer_fru_file2structure to reverse the checks of error
conditions to reduce the amount of indentation required.

Commit for Dan Gora
2013-04-15 11:33:17 +00:00
Zdenek Styblik
184994586e ID: 3608763 - 'lib/ipmi_sdr.c' - update main help
Commit updates main help of 'lib/ipmi_sdr.c'. Changes:
* LOG_ERR -> LOG_NOTICE
* add error messages, eg. Invalid command, Not enough parameters etc.
* handle 'sdr fill INV_PARAM'
* return codes on error
* general fixes and changes of SDR help output

Reported-by: Dan Gora
2013-04-15 08:24:13 +00:00
Zdenek Styblik
692861f292 ID: 3608763 - 'lib/ipmi_sdr.c' - fix 'nosats' -> 'nosat'
I forgot to modify size of compared string passed to strncmp() while changing
'nosats' to 'nosat'.
2013-04-12 14:52:14 +00:00
Zdenek Styblik
39408ea589 ID: 3608763 - ipmi_sdr_print_type() print error if sensor not found
'sdr type <TYPE_OF_SENSOR>' - print error message if sensor of given type
was not found.

Commit for Dan Gora
2013-04-12 13:11:26 +00:00
Zdenek Styblik
1602e0a7a2 ID: 3608763 - 'lib/ipmi_sdr.c' - fix 'nosats' -> 'nosat'
Commit fixes typo in strncmp() comparison of argv and changes 'nosats'
to 'nosat'.

Commit for Dan Gora
2013-04-12 13:01:07 +00:00
Zdenek Styblik
f074f76620 ID: 3608765 - 'lib/ipmi_ekanalyzer.c' - multiple increments in args to printf()
Performing prefix or postfix increments, eg. ++var or var++, in the
arguments to printf is inherently non-portable and may give different
results on different platforms.
Commit mends this issue.

Commit for Dan Gora
2013-04-09 10:20:02 +00:00
Zdenek Styblik
87e6c7279d ID: 3608765 - Remove unused variables from ipmi_ekanalyzer_ekeying_match().
Commit removes unused local variables from ipmi_ekanalyzer_ekeying_match().

Commit for Dan Gora
2013-04-09 10:00:40 +00:00
Zdenek Styblik
1f1dc806fe ID: 3608765 - Fix spelling of ipmi_ek_diplay_carrier_connectivity()
Commit corrects spelling of function ipmi_ek_display_carrier_connectivity().

Commit for Dan Gora
2013-04-09 09:55:03 +00:00
Zdenek Styblik
8afb3c315b ID: 3608763 - 'lib/ipmi_sdr.c' - display hex values of Sensors
Commit adds the hex value for the sensor type to displays so that the user
can correlate sensor type values with their hex values without having to
look them up in the IPMI spec.

Commit for Dan Gora
2013-04-09 08:38:31 +00:00
Zdenek Styblik
4aae41904d ID: 3608763 - Update sensor_type_desc values to differentiate watchdogs
Previous versions had two values for "Watchdog" in the list which
means that users could not perform # ipmitool sdr type "Watchdog";
and get the IPMI v1.0 and later version of the watchdog sensor,
eg. 0x23 instead of 0x11.

Commit for Dan Gora
2013-04-09 08:08:20 +00:00
Zdenek Styblik
41a44b037f ID: 3608759 - Remove '-Wno-packed-bitfield-compat' from CFLAGS
Commit removes -Wno-packed-bitfield-compat from 'configure.in'. This was hiding
an important bug in ipmi_fru.h and is not a valid flag for older versions of
gcc.

Commit for Dan Gora
2013-04-09 07:38:35 +00:00
Zdenek Styblik
49a7ceee70 ID: 3608761 - 'lib/ipmi_main.c' - PICMG Get Device Locator was never run
This code was moved to ipmi_main.c from open.c and in the change a bug
was introduced where the PICMG Get Device Locator command would not
be run unless the user explicitly set my_addr to 0 with the -m command.

The more sensible thing to do is to run this unless the user explictly
overrides it with the -m option.

Commit for Dan Gora
2013-04-08 17:46:17 +00:00
Zdenek Styblik
3687a6cbb8 ID: 3608762 - 'lib/ipm_hpmfwup.c' - Fixed help messages for hpm command
Commit cleans up the formatting of help output a bit to fit on an 80 column
screen.

Commit for Dan Gora
2013-04-08 17:36:33 +00:00
Zdenek Styblik
627cadaa39 ID: 3608759 - Fix bug in configure.in when cross compiling
The previous test to see if we need pragma pack(1) was failing if we
cross compile because there was no way to run the test.

We now use AC_TRY_COMPILE and add the pragma pack(1) to the test code.
If it compiles, it must be good, so add the define.

Commit for Dan Gora
2013-04-08 17:29:24 +00:00
Zdenek Styblik
eb63058bc3 ID: 2871903 - ipmitool user priv incorrectly sets Link Auth
Commit fixes issue in 'user priv' sub-command which turns off LinkAuth whenever
user's privilege is changed. This was caused by not setting apropriate bits.
However, fix leverages Set User Access Command(IPMI spec. v2 PDF, p.320) and
sets 7th bit of 1st byte to 0. This tells BMC not to change IPMI messaging,
LinkAuth and Callback for given user.

As a consequence, ipmitool no longer turns 'IPMI messaging' on by default when
user's privilege is being set. IPMI messaging can be turned on/off via 'channel
setaccess' sub-command.

Reported-by: Kipp Glover
2013-04-08 17:21:38 +00:00
Zdenek Styblik
15f1255237 ID: 3610286 - 'lib/ipmi_sdr.c' - ipmi_sdr_print_type - incorrect eval
Commit fixes incorrect evaluation of str2uchar() return value in
ipmi_sdr_print_type(). Prior to this fix, practically no user input was accepted
as a valid one in # ipmitool sdr type HEX_SENSOR_TYPE ;

This bug was introduced by ID#3528368 - 'lib/ipmi_sdr.c' - possible int *flow
2013-04-08 17:04:34 +00:00
Jim Mankovich
2dfa02ba24 Fix "help" command line processing in fru command defect (ID: 3610117)
introduced by the following changes:

ID: 3582307 - 'lib/ipmi_fru.c' - ipmi_fru_main() return codes
ID: 3582310 - 'lib/ipmi_fru.c' - ipmi_fru_main() - misuse of printf()
2013-04-08 13:22:34 +00:00
Zdenek Styblik
9d6a201911 ID: 3608758 - 'include/ipmitool/ipmi.h' - add IPMI_NETFN_OEM
Commit adds IPMI_NETFN_OEM code 0x2E for completeness.

Commit for Dan Gora
2013-04-04 11:54:00 +00:00
Zdenek Styblik
ad01921281 ID: 3609985 - delloem : Wrong MAC returned when flex addressing is enabled
Commit fixes problem in 'lib/ipmi_delloem.c'. Command % ipmitool delloem mac;
returns wrong MAC when flex addressing is enabled on the blade chassis.

Commit for Krishnaprasad K
2013-04-04 07:27:11 +00:00
Zdenek Styblik
d27d2f7ae3 ID: 3016359 - Get SEL Alloc Information is incorrect
The Information given by the command SEL was incorrect in "Get SEL Allocation"
command. According to the specification "byte 10" in response denotes the
"Maximum record size in allocation units". This information is given as "Max
Record Size : " in sel command. However, ipmitool was getting "byte 9" instead
of "byte 10".

Commit for Gokulakannan
2013-04-02 10:37:15 +00:00
Zdenek Styblik
26c17eeb91 ID: 3600933 - 'lib/ipmi_sol.c' - use of deprecated bzero()
Commit replaces deprecated bzero() call with memset().

Commit for Ales Ledvinka
2013-03-30 06:37:51 +00:00
Zdenek Styblik
fdbef84866 ID: 3609472 - Add the instance to the SOL commands
The SOL protocol supports multiple serial ports using the "instance",
allow this to be passed in to ipmitool.

Commit for Corey Minyard
2013-03-29 21:01:10 +00:00
Zdenek Styblik
3a383608dd ID: 3609473 - Add assertion/deassertion to threshold events
The event data and SDRs support assertions and deassertions for threshold events
as well as discrete events. So print out assertion and deassertion on all
events.

Commit for Corey Minyard
2013-03-29 18:45:16 +00:00
Zdenek Styblik
66fcf484a4 ID: 3600911 - 'lib/ipmi_fru.c' - fix multiple increments in args to printf
Commit fixes multiple increments in arguments of printf() which leads to
undefined/inconsistent behaviour and results.

Reported-by: Ales Ledvinka
2013-03-29 14:52:59 +00:00
Zdenek Styblik
52c07d61f9 ID: 3608149 - ipmitool - set pointer to NULL after free()
Commit is a response(and fix) to double-free bug in 'lib/ipmi_main.c' via
username. Now, pointers should be set to NULL after calling free().

Reported-by: Ales Ledvinka
2013-03-29 14:40:21 +00:00
Zdenek Styblik
fd752420ec ID: 3608261 - 'lib/ipmi_delloem.c' - code formatting
Commit changes code formatting in 'lib/ipmi_delloem.c' to be more consistent
with the rest of ipmitool's code. No functional changes are intended.
Clean up isn't perfect, but it's one of steps in long term effort.
2013-03-21 14:07:50 +00:00
Zdenek Styblik
7a74ab32a8 ID: 3608022 - 'lib/ipmi_fru.c' - unsigned errors
Commit removes 'size' check from ipmi_fru_get_multirec_from_file() as
an unsigned value can't be less than zero(0).
This error has been introduced by ID#3600911.

Reported-by: Ales Ledvinka
2013-03-21 11:32:09 +00:00
Zdenek Styblik
3ea41bda4b ID: 3607981 - 'lib/ipmi_lanp.c' - replace atoi() calls
Commit replaces atoi() calls with str2uchar() ones to eliminate possible int
*flow via user input.
2013-03-21 09:37:57 +00:00
Zdenek Styblik
992b42ceee ID: 3607320 - 'lib/ipmi_lanp.c' - possible NULL reference
Commit fixes possible NULL reference in 'lib/ipmi_lanp.c' which is caused by not
checking return value of get_lan_param(), resp. get_lan_param_select(). This
function can return NULL in certain situations.
2013-03-19 19:53:52 +00:00
Zdenek Styblik
002c8becf4 REVERT - ID: 3608261 - FReq - 'lib/ipmi_delloem.c' - clean up the code
I'm reverting previous commit. I'm not sure what happened, but there is a huge
difference between what got committed, what came as a diff in e-mail and what
should have been committed in the first place.
2013-03-16 21:15:21 +00:00
Zdenek Styblik
6f1bd51f1e ID: 3608261 - FReq - 'lib/ipmi_delloem.c' - clean up the code
Commit removes trailing white spaces and tabs in 'lib/ipmi_delloem.c'.
2013-03-16 20:15:07 +00:00
Zdenek Styblik
4719d371b7 ID: 3608007 - 'lib/ipmi_session.c' - typo in error message
Commit fixes typo in error mesage in ipmi_session_main().
2013-03-14 12:41:48 +00:00
Zdenek Styblik
ba9a313911 ID: 3600926 - 'lib/ipmi_lanp.c'
Commit replaces condition ``if (p == NULL)'' in get_lan_param_select(). This
condition is never met, because structure is on heap.
Condition is replaced by for() control structure which goes through structure
ipmi_lan_params and checks whether requested LAN parameter is defined in
structure or not.

Reported-by: Ales Ledvinka
2013-03-14 08:38:32 +00:00