2001-10-01 17:01:31

by Randy.Dunlap

[permalink] [raw]
Subject: Re: [patch] netconsole-2.4.10-B1

--- linux/drivers/net/netconsole.c.save Mon Oct 1 07:43:31 2001
+++ linux/drivers/net/netconsole.c Mon Oct 1 09:28:57 2001
@@ -263,25 +263,20 @@
printk(KERN_ERR "netconsole: network device %s is not an IP protocol device, aborting.\n", dev);
return -1;
}
- source_ip = ntohl(in_dev->ifa_list->ifa_local);
+ source_ip = in_dev->ifa_list->ifa_local;
if (!source_ip) {
printk(KERN_ERR "netconsole: network device %s has no local address, aborting.\n", dev);
return -1;
}
-#define IP(x) ((char *)&source_ip)[x]
- printk(KERN_INFO "netconsole: using source IP %i.%i.%i.%i\n",
- IP(3), IP(2), IP(1), IP(0));
-#undef IP
- source_ip = htonl(source_ip);
+ printk(KERN_INFO "netconsole: using source IP %u.%u.%u.%u\n", NIPQUAD(source_ip));
+
+ target_ip = htonl(target_ip);
if (!target_ip) {
printk(KERN_ERR "netconsole: target_ip parameter not specified, aborting.\n");
return -1;
}
-#define IP(x) ((char *)&target_ip)[x]
- printk(KERN_INFO "netconsole: using target IP %i.%i.%i.%i\n",
- IP(3), IP(2), IP(1), IP(0));
-#undef IP
- target_ip = htonl(target_ip);
+ printk(KERN_INFO "netconsole: using target IP %u.%u.%u.%u\n", NIPQUAD(target_ip));
+
if (!source_port) {
printk(KERN_ERR "netconsole: source_port parameter not specified, aborting.\n");
return -1;


Attachments:
netcon-ipaddr.patch (1.26 kB)