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:
Marc Dionne 2010-08-11 17:18:32 -04:00 committed by Derrick Brashear
parent 3121a07fbf
commit d4018b2673

View File

@ -95,8 +95,12 @@ static int c_show(struct seq_file *m, void *p)
if (!tc->cellHosts[j]) break;
addr = tc->cellHosts[j]->addr->sa_ip;
#if defined(NIPQUAD)
seq_printf(m, "%u.%u.%u.%u #%u.%u.%u.%u\n",
NIPQUAD(addr), NIPQUAD(addr));
#else
seq_printf(m, "%pI4 #%pI4\n", &addr, &addr);
#endif
}
return 0;
@ -208,7 +212,11 @@ static int uu_show(struct seq_file *m, void *p)
char ipaddr[16];
int i;
#if defined(NIPQUAD)
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);
if (np->sysnamecount) {
for (i = 0; i < np->sysnamecount; i++)