diff options
author | Julian Wiedmann <jwi@linux.vnet.ibm.com> | 2017-12-20 20:11:09 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-12-20 15:23:46 -0500 |
commit | 556fd27186e66500693e2105bd0af475d19a3a97 (patch) | |
tree | 184a36416364d1ad4ffe71c62e4b90f210f31aa0 /drivers/s390/net/qeth_l3_sys.c | |
parent | f6c131420a12945abd95f64b1400100988c6da10 (diff) | |
download | blackbird-obmc-linux-556fd27186e66500693e2105bd0af475d19a3a97.tar.gz blackbird-obmc-linux-556fd27186e66500693e2105bd0af475d19a3a97.zip |
s390/qeth: replace open-coded in*_pton()
There's a common helper for parsing an IP address string, let's use it.
Signed-off-by: Julian Wiedmann <jwi@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/s390/net/qeth_l3_sys.c')
-rw-r--r-- | drivers/s390/net/qeth_l3_sys.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/s390/net/qeth_l3_sys.c b/drivers/s390/net/qeth_l3_sys.c index 6ea2b528a64e..00a10b66c01f 100644 --- a/drivers/s390/net/qeth_l3_sys.c +++ b/drivers/s390/net/qeth_l3_sys.c @@ -10,11 +10,23 @@ #include <linux/slab.h> #include <asm/ebcdic.h> #include <linux/hashtable.h> +#include <linux/inet.h> #include "qeth_l3.h" #define QETH_DEVICE_ATTR(_id, _name, _mode, _show, _store) \ struct device_attribute dev_attr_##_id = __ATTR(_name, _mode, _show, _store) +static int qeth_l3_string_to_ipaddr(const char *buf, + enum qeth_prot_versions proto, u8 *addr) +{ + const char *end; + + if ((proto == QETH_PROT_IPV4 && !in4_pton(buf, -1, addr, -1, &end)) || + (proto == QETH_PROT_IPV6 && !in6_pton(buf, -1, addr, -1, &end))) + return -EINVAL; + return 0; +} + static ssize_t qeth_l3_dev_route_show(struct qeth_card *card, struct qeth_routing_info *route, char *buf) { |