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>
This commit is contained in:
committed by
David S. Miller
parent
f940964901
commit
e7557af56a
@@ -294,14 +294,12 @@ static ssize_t show_remote_port(struct netconsole_target *nt, char *buf)
|
||||
|
||||
static ssize_t show_local_ip(struct netconsole_target *nt, char *buf)
|
||||
{
|
||||
return snprintf(buf, PAGE_SIZE, "%d.%d.%d.%d\n",
|
||||
HIPQUAD(nt->np.local_ip));
|
||||
return snprintf(buf, PAGE_SIZE, "%pI4\n", &nt->np.local_ip);
|
||||
}
|
||||
|
||||
static ssize_t show_remote_ip(struct netconsole_target *nt, char *buf)
|
||||
{
|
||||
return snprintf(buf, PAGE_SIZE, "%d.%d.%d.%d\n",
|
||||
HIPQUAD(nt->np.remote_ip));
|
||||
return snprintf(buf, PAGE_SIZE, "%pI4\n", &nt->np.remote_ip);
|
||||
}
|
||||
|
||||
static 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,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
nt->np.local_ip = ntohl(in_aton(buf));
|
||||
nt->np.local_ip = in_aton(buf);
|
||||
|
||||
return strnlen(buf, count);
|
||||
}
|
||||
@@ -454,7 +452,7 @@ static ssize_t store_remote_ip(struct netconsole_target *nt,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
nt->np.remote_ip = ntohl(in_aton(buf));
|
||||
nt->np.remote_ip = in_aton(buf);
|
||||
|
||||
return strnlen(buf, count);
|
||||
}
|
||||
|
Reference in New Issue
Block a user