aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/netconsole.c
diff options
context:
space:
mode:
authorHarvey Harrison <harvey.harrison@gmail.com>2009-03-28 11:38:31 -0400
committerDavid S. Miller <davem@davemloft.net>2009-03-29 02:55:58 -0400
commite7557af56a576762a655f1aaaded253ad14c5958 (patch)
tree7594980090f4c6b8fcfe1be554d94096b9d80db3 /drivers/net/netconsole.c
parentf940964901aa69e28ce729d7614061d014184472 (diff)
netpoll: store local and remote ip in net-endian
Allows for the removal of byteswapping in some places and the removal of HIPQUAD (replaced by %pI4). Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/netconsole.c')
-rw-r--r--drivers/net/netconsole.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
index d304d38cd5d1..eceadf787a67 100644
--- a/drivers/net/netconsole.c
+++ b/drivers/net/netconsole.c
@@ -294,14 +294,12 @@ static ssize_t show_remote_port(struct netconsole_target *nt, char *buf)
294 294
295static ssize_t show_local_ip(struct netconsole_target *nt, char *buf) 295static ssize_t show_local_ip(struct netconsole_target *nt, char *buf)
296{ 296{
297 return snprintf(buf, PAGE_SIZE, "%d.%d.%d.%d\n", 297 return snprintf(buf, PAGE_SIZE, "%pI4\n", &nt->np.local_ip);
298 HIPQUAD(nt->np.local_ip));
299} 298}
300 299
301static ssize_t show_remote_ip(struct netconsole_target *nt, char *buf) 300static ssize_t show_remote_ip(struct netconsole_target *nt, char *buf)
302{ 301{
303 return snprintf(buf, PAGE_SIZE, "%d.%d.%d.%d\n", 302 return snprintf(buf, PAGE_SIZE, "%pI4\n", &nt->np.remote_ip);
304 HIPQUAD(nt->np.remote_ip));
305} 303}
306 304
307static ssize_t show_local_mac(struct netconsole_target *nt, char *buf) 305static ssize_t show_local_mac(struct netconsole_target *nt, char *buf)
@@ -438,7 +436,7 @@ static ssize_t store_local_ip(struct netconsole_target *nt,
438 return -EINVAL; 436 return -EINVAL;
439 } 437 }
440 438
441 nt->np.local_ip = ntohl(in_aton(buf)); 439 nt->np.local_ip = in_aton(buf);
442 440
443 return strnlen(buf, count); 441 return strnlen(buf, count);
444} 442}
@@ -454,7 +452,7 @@ static ssize_t store_remote_ip(struct netconsole_target *nt,
454 return -EINVAL; 452 return -EINVAL;
455 } 453 }
456 454
457 nt->np.remote_ip = ntohl(in_aton(buf)); 455 nt->np.remote_ip = in_aton(buf);
458 456
459 return strnlen(buf, count); 457 return strnlen(buf, count);
460} 458}