Commit b22d73d6 authored by Julian Wiedmann's avatar Julian Wiedmann Committed by David S. Miller

s390/qeth: don't apply takeover changes to RXIP

When takeover is switched off, current code clears the 'TAKEOVER' flag on
all IPs. But the flag is also used for RXIP addresses, and those should
not be affected by the takeover mode.
Fix the behaviour by consistenly applying takover logic to NORMAL
addresses only.
Signed-off-by: default avatarJulian Wiedmann <jwi@linux.vnet.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7fbd9493
...@@ -174,6 +174,8 @@ int qeth_l3_is_addr_covered_by_ipato(struct qeth_card *card, ...@@ -174,6 +174,8 @@ int qeth_l3_is_addr_covered_by_ipato(struct qeth_card *card,
if (!card->ipato.enabled) if (!card->ipato.enabled)
return 0; return 0;
if (addr->type != QETH_IP_TYPE_NORMAL)
return 0;
qeth_l3_convert_addr_to_bits((u8 *) &addr->u, addr_bits, qeth_l3_convert_addr_to_bits((u8 *) &addr->u, addr_bits,
(addr->proto == QETH_PROT_IPV4)? 4:16); (addr->proto == QETH_PROT_IPV4)? 4:16);
...@@ -290,8 +292,7 @@ int qeth_l3_add_ip(struct qeth_card *card, struct qeth_ipaddr *tmp_addr) ...@@ -290,8 +292,7 @@ int qeth_l3_add_ip(struct qeth_card *card, struct qeth_ipaddr *tmp_addr)
memcpy(addr, tmp_addr, sizeof(struct qeth_ipaddr)); memcpy(addr, tmp_addr, sizeof(struct qeth_ipaddr));
addr->ref_counter = 1; addr->ref_counter = 1;
if (addr->type == QETH_IP_TYPE_NORMAL && if (qeth_l3_is_addr_covered_by_ipato(card, addr)) {
qeth_l3_is_addr_covered_by_ipato(card, addr)) {
QETH_CARD_TEXT(card, 2, "tkovaddr"); QETH_CARD_TEXT(card, 2, "tkovaddr");
addr->set_flags |= QETH_IPA_SETIP_TAKEOVER_FLAG; addr->set_flags |= QETH_IPA_SETIP_TAKEOVER_FLAG;
} }
......
...@@ -396,10 +396,11 @@ static ssize_t qeth_l3_dev_ipato_enable_store(struct device *dev, ...@@ -396,10 +396,11 @@ static ssize_t qeth_l3_dev_ipato_enable_store(struct device *dev,
card->ipato.enabled = enable; card->ipato.enabled = enable;
hash_for_each(card->ip_htable, i, addr, hnode) { hash_for_each(card->ip_htable, i, addr, hnode) {
if (addr->type != QETH_IP_TYPE_NORMAL)
continue;
if (!enable) if (!enable)
addr->set_flags &= ~QETH_IPA_SETIP_TAKEOVER_FLAG; addr->set_flags &= ~QETH_IPA_SETIP_TAKEOVER_FLAG;
else if (addr->type == QETH_IP_TYPE_NORMAL && else if (qeth_l3_is_addr_covered_by_ipato(card, addr))
qeth_l3_is_addr_covered_by_ipato(card, addr))
addr->set_flags |= QETH_IPA_SETIP_TAKEOVER_FLAG; addr->set_flags |= QETH_IPA_SETIP_TAKEOVER_FLAG;
} }
out: out:
......
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