mirror of
https://git.openafs.org/openafs.git
synced 2025-01-31 05:27:44 +00:00
Linux: use %pI4 if NIPQUAD is not available
The definition of NIPQUAD has been removed from the kernel headers in the mainline kernel. Replace it by using the %pI4 format specifier which takes the IP address as a single argument. There should be no change in the output. This fix is required for 2.6.36. Change-Id: I269e5bd754b7aef49b005081eb6b3af1b2679293 Reviewed-on: http://gerrit.openafs.org/2542 Tested-by: Derrick Brashear <shadow@dementia.org> Reviewed-by: Derrick Brashear <shadow@dementia.org>
This commit is contained in:
parent
3121a07fbf
commit
d4018b2673
@ -95,8 +95,12 @@ static int c_show(struct seq_file *m, void *p)
|
|||||||
if (!tc->cellHosts[j]) break;
|
if (!tc->cellHosts[j]) break;
|
||||||
|
|
||||||
addr = tc->cellHosts[j]->addr->sa_ip;
|
addr = tc->cellHosts[j]->addr->sa_ip;
|
||||||
|
#if defined(NIPQUAD)
|
||||||
seq_printf(m, "%u.%u.%u.%u #%u.%u.%u.%u\n",
|
seq_printf(m, "%u.%u.%u.%u #%u.%u.%u.%u\n",
|
||||||
NIPQUAD(addr), NIPQUAD(addr));
|
NIPQUAD(addr), NIPQUAD(addr));
|
||||||
|
#else
|
||||||
|
seq_printf(m, "%pI4 #%pI4\n", &addr, &addr);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -208,7 +212,11 @@ static int uu_show(struct seq_file *m, void *p)
|
|||||||
char ipaddr[16];
|
char ipaddr[16];
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
#if defined(NIPQUAD)
|
||||||
sprintf(ipaddr, "%u.%u.%u.%u", NIPQUAD(np->host));
|
sprintf(ipaddr, "%u.%u.%u.%u", NIPQUAD(np->host));
|
||||||
|
#else
|
||||||
|
sprintf(ipaddr, "%pI4", &np->host);
|
||||||
|
#endif
|
||||||
seq_printf(m, " %-15s %10d %10d", ipaddr, np->uid, np->client_uid);
|
seq_printf(m, " %-15s %10d %10d", ipaddr, np->uid, np->client_uid);
|
||||||
if (np->sysnamecount) {
|
if (np->sysnamecount) {
|
||||||
for (i = 0; i < np->sysnamecount; i++)
|
for (i = 0; i < np->sysnamecount; i++)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user