From d4018b2673e6532543984838290ffb891b970fea Mon Sep 17 00:00:00 2001 From: Marc Dionne Date: Wed, 11 Aug 2010 17:18:32 -0400 Subject: [PATCH] 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 Reviewed-by: Derrick Brashear --- src/afs/LINUX/osi_proc.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/afs/LINUX/osi_proc.c b/src/afs/LINUX/osi_proc.c index ca83ca056a..b4b5c9e95c 100644 --- a/src/afs/LINUX/osi_proc.c +++ b/src/afs/LINUX/osi_proc.c @@ -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++)