Commit aa9bea0b authored by Kittipon Meesompop's avatar Kittipon Meesompop Committed by David S. Miller

s390/qeth: reject multicast rxip addresses

There exist different commands to add unicast and multicast addresses on
the OSA card. rxip addresses are always set as unicast addresses and
thus just unicast addresses should be allowed.

Adding a multicast address now fails and a grace message is generated.
Signed-off-by: default avatarKittipon Meesompop <kmeesomp@linux.vnet.ibm.com>
Signed-off-by: default avatarJulian Wiedmann <jwi@linux.vnet.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d65626ad
...@@ -895,9 +895,26 @@ static ssize_t qeth_l3_dev_rxip_add4_show(struct device *dev, ...@@ -895,9 +895,26 @@ static ssize_t qeth_l3_dev_rxip_add4_show(struct device *dev,
static int qeth_l3_parse_rxipe(const char *buf, enum qeth_prot_versions proto, static int qeth_l3_parse_rxipe(const char *buf, enum qeth_prot_versions proto,
u8 *addr) u8 *addr)
{ {
__be32 ipv4_addr;
struct in6_addr ipv6_addr;
if (qeth_l3_string_to_ipaddr(buf, proto, addr)) { if (qeth_l3_string_to_ipaddr(buf, proto, addr)) {
return -EINVAL; return -EINVAL;
} }
if (proto == QETH_PROT_IPV4) {
memcpy(&ipv4_addr, addr, sizeof(ipv4_addr));
if (ipv4_is_multicast(ipv4_addr)) {
QETH_DBF_MESSAGE(2, "multicast rxip not supported.\n");
return -EINVAL;
}
} else if (proto == QETH_PROT_IPV6) {
memcpy(&ipv6_addr, addr, sizeof(ipv6_addr));
if (ipv6_addr_is_multicast(&ipv6_addr)) {
QETH_DBF_MESSAGE(2, "multicast rxip not supported.\n");
return -EINVAL;
}
}
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment