* [PATCH] scsi: libcxgbi: return error if interface is not up
@ 2016-12-09 9:10 Varun Prakash
2016-12-14 20:12 ` Martin K. Petersen
0 siblings, 1 reply; 2+ messages in thread
From: Varun Prakash @ 2016-12-09 9:10 UTC (permalink / raw)
To: martin.petersen, jejb; +Cc: linux-scsi, indranil, varun
Do not post hw active open cmd if IFF_UP is not set
or link is down on the interface, return -ENETDOWN
in this case.
Signed-off-by: Varun Prakash <varun@chelsio.com>
---
drivers/scsi/cxgbi/libcxgbi.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/scsi/cxgbi/libcxgbi.c b/drivers/scsi/cxgbi/libcxgbi.c
index 9f4fde9..9167bcd 100644
--- a/drivers/scsi/cxgbi/libcxgbi.c
+++ b/drivers/scsi/cxgbi/libcxgbi.c
@@ -642,6 +642,12 @@ static struct cxgbi_sock *cxgbi_check_route(struct sockaddr *dst_addr)
n->dev->name, ndev->name, mtu);
}
+ if (!(ndev->flags & IFF_UP) || !netif_carrier_ok(ndev)) {
+ pr_info("%s interface not up.\n", ndev->name);
+ err = -ENETDOWN;
+ goto rel_neigh;
+ }
+
cdev = cxgbi_device_find_by_netdev(ndev, &port);
if (!cdev) {
pr_info("dst %pI4, %s, NOT cxgbi device.\n",
@@ -736,6 +742,12 @@ static struct cxgbi_sock *cxgbi_check_route6(struct sockaddr *dst_addr)
}
ndev = n->dev;
+ if (!(ndev->flags & IFF_UP) || !netif_carrier_ok(ndev)) {
+ pr_info("%s interface not up.\n", ndev->name);
+ err = -ENETDOWN;
+ goto rel_rt;
+ }
+
if (ipv6_addr_is_multicast(&daddr6->sin6_addr)) {
pr_info("multi-cast route %pI6 port %u, dev %s.\n",
daddr6->sin6_addr.s6_addr,
--
2.0.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] scsi: libcxgbi: return error if interface is not up
2016-12-09 9:10 [PATCH] scsi: libcxgbi: return error if interface is not up Varun Prakash
@ 2016-12-14 20:12 ` Martin K. Petersen
0 siblings, 0 replies; 2+ messages in thread
From: Martin K. Petersen @ 2016-12-14 20:12 UTC (permalink / raw)
To: Varun Prakash; +Cc: martin.petersen, jejb, linux-scsi, indranil
>>>>> "Varun" == Varun Prakash <varun@chelsio.com> writes:
Varun> Do not post hw active open cmd if IFF_UP is not set or link is
Varun> down on the interface, return -ENETDOWN in this case.
Applied to 4.10/scsi-fixes.
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-12-14 20:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-09 9:10 [PATCH] scsi: libcxgbi: return error if interface is not up Varun Prakash
2016-12-14 20:12 ` Martin K. Petersen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).