summaryrefslogtreecommitdiffstats
path: root/drivers/s390/net/qeth_l3.h
diff options
context:
space:
mode:
authorJulian Wiedmann <jwi@linux.ibm.com>2019-12-18 17:34:44 +0100
committerDavid S. Miller <davem@davemloft.net>2019-12-18 21:34:56 +0100
commite6b1b7da247b329bb9e62adc97ef28678199cf35 (patch)
tree3c39f39c524ea73f2fd935f394fc88100606d38b /drivers/s390/net/qeth_l3.h
parents390/qeth: wake up all waiters from qeth_irq() (diff)
downloadlinux-e6b1b7da247b329bb9e62adc97ef28678199cf35.tar.xz
linux-e6b1b7da247b329bb9e62adc97ef28678199cf35.zip
s390/qeth: overhaul L3 IP address dump code
The current code that dumps the RXIP/VIPA/IPATO addresses via sysfs first checks whether the buffer still provides sufficient space to hold another formatted address. But the maximum length of an formatted IPv4 address is 15 characters, not 12. So we underestimate the max required length and if the buffer was previously filled to _just_ the right level, a formatted address can end up being truncated. Revamp these code paths to use the _actually_ required length of the formatted IP address, and while at it suppress a gratuitous newline. Also use scnprintf() to format the output. In case of a truncation, this would allow us to return the number of characters that were actually written. Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/s390/net/qeth_l3.h')
-rw-r--r--drivers/s390/net/qeth_l3.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/s390/net/qeth_l3.h b/drivers/s390/net/qeth_l3.h
index 5db04fe472c0..2383ffad0a4a 100644
--- a/drivers/s390/net/qeth_l3.h
+++ b/drivers/s390/net/qeth_l3.h
@@ -102,7 +102,8 @@ struct qeth_ipato_entry {
extern const struct attribute_group *qeth_l3_attr_groups[];
-void qeth_l3_ipaddr_to_string(enum qeth_prot_versions, const __u8 *, char *);
+int qeth_l3_ipaddr_to_string(enum qeth_prot_versions proto, const u8 *addr,
+ char *buf);
int qeth_l3_create_device_attributes(struct device *);
void qeth_l3_remove_device_attributes(struct device *);
int qeth_l3_setrouting_v4(struct qeth_card *);