lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210914112738.358627-6-idosch@idosch.org>
Date:   Tue, 14 Sep 2021 14:27:38 +0300
From:   Ido Schimmel <idosch@...sch.org>
To:     netdev@...r.kernel.org
Cc:     mkubecek@...e.cz, kuba@...nel.org, andrew@...n.ch,
        f.fainelli@...il.com, vadimp@...dia.com, mlxsw@...dia.com,
        vladyslavt@...dia.com, moshe@...dia.com, popadrian1996@...il.com,
        Ido Schimmel <idosch@...dia.com>
Subject: [PATCH ethtool 5/5] netlink: eeprom: Fix compilation when pretty dump is disabled

From: Ido Schimmel <idosch@...dia.com>

When pretty dump is disabled (i.e., configure --disable-pretty-dump),
the following errors are emitted:

/usr/bin/ld: netlink/module-eeprom.o: in function `decoder_print':
netlink/module-eeprom.c:330: undefined reference to `sff8636_show_all_paged'
netlink/module-eeprom.c:334: undefined reference to `cmis_show_all'
netlink/module-eeprom.c:325: undefined reference to `sff8079_show_all'

The else clause is unreachable when pretty dump is disabled, so wrap it
with ifdef directive.

This will be re-worked in future patches where the netlink code only
queries the SFF-8024 Identifier Value and defers page requests to
individual parsers.

Signed-off-by: Ido Schimmel <idosch@...dia.com>
---
 netlink/module-eeprom.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/netlink/module-eeprom.c b/netlink/module-eeprom.c
index e9a122df3259..48cd2cc55bee 100644
--- a/netlink/module-eeprom.c
+++ b/netlink/module-eeprom.c
@@ -275,6 +275,7 @@ static int page_fetch(struct nl_context *nlctx, const struct ethtool_module_eepr
 	return nlsock_process_reply(nlsock, nomsg_reply_cb, NULL);
 }
 
+#ifdef ETHTOOL_ENABLE_PRETTY_DUMP
 static int decoder_prefetch(struct nl_context *nlctx)
 {
 	struct ethtool_module_eeprom *page_zero_lower = cache_get(0, 0, ETH_I2C_ADDRESS_LOW);
@@ -338,6 +339,7 @@ static void decoder_print(void)
 		break;
 	}
 }
+#endif
 
 int nl_getmodule(struct cmd_context *ctx)
 {
@@ -414,10 +416,12 @@ int nl_getmodule(struct cmd_context *ctx)
 		else
 			dump_hex(stdout, eeprom_data, dump_length, request.offset);
 	} else {
+#ifdef ETHTOOL_ENABLE_PRETTY_DUMP
 		ret = decoder_prefetch(nlctx);
 		if (ret)
 			goto cleanup;
 		decoder_print();
+#endif
 	}
 
 cleanup:
-- 
2.31.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ