lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1237325373.27681.353.camel@macbook.infradead.org>
Date:	Tue, 17 Mar 2009 21:29:33 +0000
From:	David Woodhouse <dwmw2@...radead.org>
To:	netdev@...r.kernel.org
Subject: [PATCH 24/30] solos: Tidy up status interrupt handling, cope with
 'ERROR' status

Signed-off-by: David Woodhouse <David.Woodhouse@...el.com>
---
 drivers/atm/solos-pci.c |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/drivers/atm/solos-pci.c b/drivers/atm/solos-pci.c
index c54eceb..f27bd92 100644
--- a/drivers/atm/solos-pci.c
+++ b/drivers/atm/solos-pci.c
@@ -340,6 +340,12 @@ static int process_status(struct solos_card *card, int port, struct sk_buff *skb
 	str = next_string(skb);
 	if (!str)
 		return -EIO;
+	if (!strcmp(str, "ERROR")) {
+		dev_dbg(&card->dev->dev, "Status packet indicated Solos error on port %d (starting up?)\n",
+			 port);
+		return 0;
+	}
+
 	rate_up = simple_strtol(str, &end, 10);
 	if (*end)
 		return -EIO;
@@ -362,8 +368,7 @@ static int process_status(struct solos_card *card, int port, struct sk_buff *skb
 	}
 
 	if (state == ATM_PHY_SIG_LOST) {
-		dev_info(&card->dev->dev, "Port %d ATM state: %s\n",
-			 port, state_str);
+		dev_info(&card->dev->dev, "Port %d: %s\n", port, state_str);
 	} else {
 		char *snr, *attn;
 
@@ -374,7 +379,7 @@ static int process_status(struct solos_card *card, int port, struct sk_buff *skb
 		if (!attn)
 			return -EIO;
 
-		dev_info(&card->dev->dev, "Port %d: %s (%d/%d kb/s%s%s%s%s)\n",
+		dev_info(&card->dev->dev, "Port %d: %s @%d/%d kb/s%s%s%s%s\n",
 			 port, state_str, rate_down/1000, rate_up/1000,
 			 snr[0]?", SNR ":"", snr, attn[0]?", Attn ":"", attn);
 	}		
@@ -663,7 +668,11 @@ void solos_bh(unsigned long card_arg)
 				break;
 
 			case PKT_STATUS:
-				process_status(card, port, skb);
+				if (process_status(card, port, skb) &&
+				    net_ratelimit()) {
+					dev_warn(&card->dev->dev, "Bad status packet of %d bytes on port %d:\n", skb->len, port);
+					print_buffer(skb);
+				}
 				dev_kfree_skb_any(skb);
 				break;
 
-- 
1.6.0.6


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ