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 PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Tue, 10 Jul 2007 14:49:56 +0530 From: Satyam Sharma <ssatyam@....iitk.ac.in> To: Linux Kernel Mailing List <linux-kernel@...r.kernel.org> Cc: Matt Mackall <mpm@...enic.com>, Keiichi Kii <k-keiichi@...jp.nec.com>, Satyam Sharma <ssatyam@....iitk.ac.in>, Netdev <netdev@...r.kernel.org>, Joel Becker <joel.becker@...cle.com>, Stephen Hemminger <shemminger@...ux-foundation.org>, Andrew Morton <akpm@...ux-foundation.org>, David Miller <davem@...emloft.net> Subject: [PATCH v2 -mm 7/9] netconsole: Use netif_running() in write_msg() From: Satyam Sharma <ssatyam@....iitk.ac.in> [7/9] netconsole: Use netif_running() in write_msg() Avoid unnecessarily disabling interrupts and calling netpoll_send_udp() if the corresponding local interface is not up. Signed-off-by: Satyam Sharma <ssatyam@....iitk.ac.in> Cc: Keiichi Kii <k-keiichi@...jp.nec.com> --- drivers/net/netconsole.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) --- diff -ruNp a/drivers/net/netconsole.c b/drivers/net/netconsole.c --- a/drivers/net/netconsole.c 2007-07-10 07:26:47.000000000 +0530 +++ b/drivers/net/netconsole.c 2007-07-10 07:45:51.000000000 +0530 @@ -113,16 +113,16 @@ static void write_msg(struct console *co unsigned long flags; struct netconsole_target *nt = &default_target; - local_irq_save(flags); - - for (left = len; left;) { - frag = min(left, MAX_PRINT_CHUNK); - netpoll_send_udp(&nt->np, msg, frag); - msg += frag; - left -= frag; + if (netif_running(nt->np.dev)) { + local_irq_save(flags); + for (left = len; left;) { + frag = min(left, MAX_PRINT_CHUNK); + netpoll_send_udp(&nt->np, msg, frag); + msg += frag; + left -= frag; + } + local_irq_restore(flags); } - - local_irq_restore(flags); } static struct console netconsole = { - 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