75 Commits

Author SHA1 Message Date
Zdenek Styblik
77fe563503 ID:461 - Make compiler happier about changes related to OpenSSL 1.1
Complaint was that ctx isn't initialized.
2017-01-15 15:11:25 +01:00
Dennis Schridde
b57487e360 ID:461 - OpenSSL 1.1 compatibility - "error: storage size of 'ctx' isn't known"
In OpenSSL 1.1 EVP_CIPHER_CTX became opaque, cf. `man 3ssl EVP_EncryptInit`

Fixes: ID:461
2016-11-30 17:33:00 +01:00
Marcin Bernatowicz
75a79e164d ID: 464 - ipmievd crash fix in log_event
added missing format specifier for sensor number in lprintf
2016-09-24 21:16:02 +02:00
Zdenek Styblik
51198a1749 ID: 38 - Protocol violating SOL retries when talking to SIMSO-HTC
c&p from the ticket:
~~~
When I try to use CVS-ipmitool on Ubuntu 8.04 x86_64 to talk to a SuperMicros
SIMSO-HTC (Rev. 2.5, IPMI 2.0) chip on a X7SBi-Board via SOL I often get doubled
characters when typing fast, making the SOL interface basically unusable for
anyone accustomed to using a keyboard for longer than a month ;)

At first I thought this was an issue with SuperMicros implementation of the
protocol and/or the flow control
setup on the machine, but their own app works fine (but not the Linux CLI, which
is maybe
based on ipmitool?). But after reading the IPMI 2.0 SOL specs and watching the
debug output for a bit, it seems that is really an issue with lanplus-SOL
protocol implentation of ipmitool in general.

Specifically, in lanplus.c:ipmi_lanplus_send_payload, when waiting for a SOL
response the case that a non SOL packet is returned is not being
checked. Also the "if (is_sol_packet(rsp) && rsp->data_len)" branch does
terminate with a break, but instead goes for a send try, that seems
counterintuitive, Both these things cause doubled characters for me.

The attached patch seems to solve these issues in my case, but I don't claim to
fully understand your protocol code and/or the protocol, so maybe it will cause
problems elsewhere, especially under packet loss conditions.
~~~
2016-08-21 13:16:16 +02:00
Dmitry Rakhchev
e30c357db7 ID:375 - Add lan6 subcommand to handle IPv6 LAN parameters 2016-08-21 08:59:27 +02:00
Dmitry Rakhchev
7f8d37493f Rewrite code with the notion that Kg is binary data, not string
- use uint8_t as the storage type
  - allocate kgkey on stack
  - do not treat incoming kgkey as 0-trminated string in
    ipmi_intf_session_set_kgkey()
2016-07-31 08:52:40 +02:00
Dmitry Rakhchev
ea46724878 Fix warning for buf2str argument 2016-07-31 08:52:40 +02:00
Dmitry Rakhchev
a203644728 ID:447 - Fix access beyond array limits in serial_terminal 2016-06-08 21:30:53 +02:00
Zdenek Styblik
d56220f81f ID:355 - Fix ``warning: ISO C forbids zero-size array 'data''' 2016-06-08 20:25:35 +02:00
Zdenek Styblik
0fdfbce8b6 ID:355 - Replace DEBUG() macro with lprintf(LOG_DEBUG, ...)
Commit replaces parametric macro DEBUG() in insrc/plugins/imb/imbapi.c.
2016-06-05 14:00:56 +02:00
Zdenek Styblik
2153bd7aa3 Change formatting, remove commented-out code in src/plugins/imb/imbapi.c
Commit changes formatting in src/plugins/imb/imbapi.c and also removes commented
out code.
2016-06-05 13:46:29 +02:00
Zdenek Styblik
9b1a1a1e82 Fix indentation of #define in src/plugins/imb/imbapi.c 2016-06-05 07:20:02 +02:00
Leonid Nevecherya
0ffe39dedc ID:445 - Fix of compilation on FreeBSD 2016-05-31 22:26:19 +02:00
Zdenek Styblik
8ca47f21ca ID:441 - Add support for HMAC_MD5 and HMAC_SHA256
Commit adds support for cipher suites 6/7/8 (HMAC-MD5) and cipher
suites 15/16/17 (HMAC_SHA256).
This also fixes:
* ID:442 - IPMI_AUTH_RAKP_HMAC_MD5 support in lanplus
* ID:141 - RMCP+ Cipher-suite 17 not supported

Original author Liebig Holger(Fujitsu).
Code cleanup done by Florian Breu and Zdenek Styblik.
2016-05-28 13:32:45 +02:00
Dmitry Bazhenov
b44366e92d ID:400 - Add support for VITA-specific sensor types and events.
Reworked event type code/sensor type parsing in order to support
VITA-specific extensions. Added VITA-specific sensor-specific event
types and VITA-specific sensor types.
2016-05-17 20:49:06 +02:00
Dennis Schridde
955a875274 Fix implicit declaration of function 'ipmi_get_oem' in src/plugins/lanplus/lanplus.c 2016-04-11 17:18:40 +02:00
Dennis Schridde
5d271b0f67 Fix implicit declaration of function 'ipmi_get_oem' in src/plugins/open/open.c 2016-04-11 17:18:40 +02:00
Dennis Schridde
954859e330 Fix implicit declaration of function 'ipmi_get_oem' in src/plugins/imb/imb.c 2016-04-11 17:18:40 +02:00
Dennis Schridde
0f896e36f2 Fix "redirecting incorrect #include <sys/poll.h> to <poll.h>" warning with musl libc 2016-04-11 17:18:40 +02:00
Dennis Schridde
0008072590 ID:426 - Fallback to run-time detection of PAGESIZE if compile-time detection is not supported
Fixes an error ('EXEC_PAGESIZE' undeclared) with musl libc.

Should adhere to sysconf(3) and posixoptions(7).
2016-04-11 17:18:40 +02:00
Dennis Schridde
aeba39bffc ID:426 - Include wchar.h instead of defining wchar_t ourselves
Fixes a compilation error with musl libc
2016-04-11 17:18:40 +02:00
Dennis Schridde
f3f4361568 ID:426 - Include sys/socket.h instead of asm/socket.h
Fixes a compilation error with musl libc.
2016-04-11 17:18:34 +02:00
Zdenek Styblik
3123ce01b5 ID:322 - let 'ekanalyzer frushow' run without a working IPMI target
Commit changes a dummy interface in a way that it acts as a dummy interface when
no IPMI_DUMMY_SOCK env variable is set. Therefore, it's possible to run
'ekanalyzer frushow' without having BMC. Still, you need to specify this IPMI
interface.
If IPMI_DUMMY_SOCK is set, then dummy interface will work as it was working
before.
2016-04-10 19:40:11 +02:00
Gianfranco Costamagna
9639cb3fa1 Get rid of old INCLUDES macro, use AM_CPPFLAGS instead. 2016-03-15 12:08:23 +01:00
Zdenek Styblik
d65658aacc Remove #if 0 code aka not-compiled-in
Commit removes code which resides in `#if 0` block. Why? Because this code
doesn't get compiled in, so there is no reason for it to be around.
2016-03-14 21:19:52 +01:00
Zdenek Styblik
24ebe2fed9 ID:355 - Remove declared, but not used variables
Commit removes bunch of declared, but not used, variables.
2016-03-14 20:19:35 +01:00
Zdenek Styblik
eb5c73c04e ID:355 - Add macros and #include and reduce number of warnings
Commit adds macros and #include in order to bring down the number of `warning:
implicit declaration of function 'X' [-Wimplicit-function-declaration]`
warnings.
2016-03-13 11:40:10 +01:00
Boris Ranto
9289aeb8c2 ID:407 - Avoid assert on mismatched session ID
Move the logic that checks the session ID from read_session_data_v2x
function to the ipmi_lan_poll_single function in order to avoid calling
assert in this case. We can continue with the next packet if we detect
a session ID mismatch.

Signed-off-by: Boris Ranto <branto@redhat.com>
2016-02-27 13:24:44 +01:00
Zdenek Styblik
b8ca3cac3a ID:417 - Fix some typos
Commit fixes typos in texts in code, print-outs, README and man page.

Submitted by Jörg Frings-Fürst
2016-02-27 10:03:44 +01:00
Ruediger Oertel
a74e837562 ID:421 - Fix memleak for sol output
CC: Thomas Renninger <trenn@suse.com>
2016-02-27 09:56:15 +01:00
Rickard von Essen
6a196c4a6a ID:418 - Fix Compiling under Mac OS X
NI_MAXHOST and NI_MAXSERV is only defined in /usr/include/netdb.h if
_DARWIN_C_SOURCE is defined or _POSIX_C_SOURCE is undefined.

From /usr/include/netdb.h OS 10.11 - El Capitan:

  /*
   * Constants for getnameinfo()
   */
  #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
  #define	NI_MAXHOST	1025
  #define	NI_MAXSERV	32
  #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
2016-02-27 09:48:30 +01:00
Zdenek Styblik
909fc7815c ID:419 - List dummy.h in Makefile.am, so it gets included in a release tarball 2016-02-24 21:38:22 +01:00
Dmitry Bazhenov
f67a7a3b2f ID:409 - Fix IPv6 socket creation on Windows/Cygwin.
IPv6-based LAN interface connection using global IPv6 address fails under Windows/Cygwin.
This patch fixes the problem.
2016-01-19 20:24:55 +01:00
Dmitry Bazhenov
37307c93e9 ID:401 - Fixed 30 second delay when activating SOL on 'dumb' Intel MACs.
Boards equipped with 'dumb' Intel MAC can do only SOL. IPMITool performs
several autodetection requests before initiating SOL, which are not
recognized by the boards. With each request retried 5 times it takes
about 30 seconds to establish SOL. This patch resolves the problem.
2015-11-06 09:27:15 +01:00
Zdenek Styblik
636a785d82 ID:336 - ipmitool does not fall back to IPv4 for IPMI v2 / RMCP+ sessions
Commit implements '-4' and '-6' switch in order to enforce IPv4 or IPv6
connection. In order to do so, struct ipmi_intf has been extended to carry
ai_family flag.
2015-11-05 17:31:54 +01:00
Zdenek Styblik
5be090f047 ID:394 - close fp if isn't NULL and set it NULL afterwards in USB plugin
Commit brings back check whether fp is or isn't NULL. If fp isn't NULL, close()
is called and fp is set to NULL afterwards.
2015-10-20 22:03:51 +02:00
Jeremy Kerr
607cfe6f47 ID:394 - plugins/usb: Fix probe for SCSI devices
The current USB plugin doesn't find my IPMI channel:

  # ipmitool -I usb mc info
  Error in USB session setup

  Unable to setup interface usb
  Error loading interface usb

This is beacuse I have more than 8 scsi-generic devices that identify
as AMI:

  # grep -c ^AMI /proc/scsi/sg/device_strs
  13

So we end up hitting the max in FindG2CDROM, and abort without finding
the actual IPMI endpoint (on my system, this is /dev/sg11).

This change bumps that maximum up to 16.

However, that means we hit another bug in scsiProbeNew, where if
we hit the end of the file without completely filling the array,
we return with an error. This change handles the EOF condition
gracefully instead.

Also, fp is never going to become NULL; we don't need to check for that
condition.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
2015-10-20 21:58:04 +02:00
Zdenek Styblik
4a8691f477 ID:333 - Set read timeout to 15s in OpenIPMI interface
Commit sets read timeout in OpenIPMI interface to 15s in order to eliminate
possible infinite hang.
2015-10-09 20:47:31 +02:00
Zdenek Styblik
e2c5b322d8 ID:390 - Support for new Communication Interface (USB Medium)
This feature request is for adding support for USB Medium as an interface in
IPMITool. AMI BMC (OEM feature) provides Virtual USB devices in the host as
part of its feature list. IPMITool can use this 'Virtual USB device' as a
medium for Inband communication with BMC.

Just like any other interface, use can just give 'ipmitool -I usb xxxx' to
communicate with the BMC via USB Interface.
2015-09-11 19:01:31 +02:00
Zdenek Styblik
13a2a29156 Remove trailing white-spaces in src/plugins/dummy/dummy.c 2015-09-11 06:14:18 +02:00
Zdenek Styblik
30becb3588 ID:384 - Fix compilation under cygwin64
Patch fixes several compile-time errors which appear during IPMITOOL
compilation in Cygwin64 environment.

Commit for: Dmitry Bazhenov
2015-08-01 10:08:20 +02:00
Zdenek Styblik
0d8f9a7453 ID:383 - Fix compile-time error in src/plugins/lan/lan.c
Patch fixes an error of incompatible pointer type which appears during LAN
plugin compilation.

Commit for: Dmitry Bazhenov
2015-08-01 10:05:48 +02:00
Zdenek Styblik
169d9ac3fc Merge /u/whissi/ipmitool/ branch fix-pidfile-handling into master
http://sourceforge.net/p/ipmitool/source/merge-requests/8/
2015-07-25 11:38:09 +00:00
Zdenek Styblik
6dec83ff5d ID:369 - Fix lanplus interface bridging and response matching
Request/response matching for bridged and double-bridged requests is broken.
This patch reworks the sending and command construction code, and fixes the
response matching problems.
Since the polling code is retried several times, it was moved into a separate
function in order to make the code more readable.

Commit for: Dmitry Bazhenov
2015-07-25 13:15:41 +02:00
Zdenek Styblik
c87aa0b96a ID:368 - Fix handling of bridging-related parameters
1. my_addr is not set if an interface does not expose set_my_addr.
   Currently, the only interface which requires some special handling to set
   my_addr is OpenIPMI. But changing of my_addr still needed for other interfaces.
   So, we must set it regardless of presence of set_my_addr().
2. Since set_my_addr() for serial interfaces only sets my_addr, we remove them
   as redundand.
3. Bridging is enabled when either trasit_addr or target_addr is not 0.
   Currentle transit_addr is not regarded.
4. target_lun does not relate to briging. It is needed for "raw" command. We
   set it regardles of bridging.

Commit for: Dmitry Bazhenov
2015-07-25 13:03:37 +02:00
Zdenek Styblik
fb6e311d27 ID:367 - Fix building of non-bridged LAN interface commands
When bridging is used (-t specifies an address which is different from 20h),
presession command must go to BMC_SLAVE_ADDR, not to target_addr.
BMC_SLAVE_ADDR is always used as the responder address in outer Send Message
request, when message is forwarded. Use the same approach for non-bridged
commands.

Commit for:  Dmitry Bazhenov
2015-07-25 12:53:16 +02:00
Zdenek Styblik
24fd406506 ID:366 - Properly clean LAN and LAN+ interfaces on close
When closing, LAN and LAN+ interfaces do not do proper cleaning of request
entries. Some pointers remain non NULL. This may cause bad memory references.

Commit for: Dmitry Bazhenov
2015-07-25 12:51:10 +02:00
Zdenek Styblik
a585af7e0c ID:365 - Fix for ipmitool crash when using serial-terminal interface
Negative value returned by serial_read_line() function was not properly
recognized, since the storage type was unsigned. This caused ipmitool crash in
some sutuations. This patch fixes the problem.

Commit for: Dmitry Bazhenov
2015-07-25 12:49:07 +02:00
Zdenek Styblik
e8450850e3 ID:364 - Fix for serial-basic interface bridging
Response matching for bridged serial-basic interface request is broken.
This patch fixes the problem.

Commit for: Dmitry Bazhenov
2015-07-25 12:47:20 +02:00
Thomas D
d12b3b4870 Output pidfile only in verbose mode 2015-03-27 01:26:46 +01:00