aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/svcauth_unix.c
diff options
context:
space:
mode:
authorHarvey Harrison <harvey.harrison@gmail.com>2008-10-31 03:54:56 -0400
committerDavid S. Miller <davem@davemloft.net>2008-10-31 03:54:56 -0400
commit21454aaad30651ba0dcc16fe5271bc12ee21f132 (patch)
treeeb525494d6f80a0e855840bc588ae1f422348b04 /net/sunrpc/svcauth_unix.c
parent14d5e834f6b36667c7da56374645f99b6cf30814 (diff)
net: replace NIPQUAD() in net/*/
Using NIPQUAD() with NIPQUAD_FMT, %d.%d.%d.%d or %u.%u.%u.%u can be replaced with %pI4 Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sunrpc/svcauth_unix.c')
-rw-r--r--net/sunrpc/svcauth_unix.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/net/sunrpc/svcauth_unix.c b/net/sunrpc/svcauth_unix.c
index 16f714a247bc..82240e6127b2 100644
--- a/net/sunrpc/svcauth_unix.c
+++ b/net/sunrpc/svcauth_unix.c
@@ -162,11 +162,7 @@ static void ip_map_request(struct cache_detail *cd,
162 struct ip_map *im = container_of(h, struct ip_map, h); 162 struct ip_map *im = container_of(h, struct ip_map, h);
163 163
164 if (ipv6_addr_v4mapped(&(im->m_addr))) { 164 if (ipv6_addr_v4mapped(&(im->m_addr))) {
165 snprintf(text_addr, 20, NIPQUAD_FMT, 165 snprintf(text_addr, 20, "%pI4", &im->m_addr.s6_addr32[3]);
166 ntohl(im->m_addr.s6_addr32[3]) >> 24 & 0xff,
167 ntohl(im->m_addr.s6_addr32[3]) >> 16 & 0xff,
168 ntohl(im->m_addr.s6_addr32[3]) >> 8 & 0xff,
169 ntohl(im->m_addr.s6_addr32[3]) >> 0 & 0xff);
170 } else { 166 } else {
171 snprintf(text_addr, 40, "%pI6", &im->m_addr); 167 snprintf(text_addr, 40, "%pI6", &im->m_addr);
172 } 168 }
@@ -208,7 +204,7 @@ static int ip_map_parse(struct cache_detail *cd,
208 len = qword_get(&mesg, buf, mlen); 204 len = qword_get(&mesg, buf, mlen);
209 if (len <= 0) return -EINVAL; 205 if (len <= 0) return -EINVAL;
210 206
211 if (sscanf(buf, NIPQUAD_FMT "%c", &b1, &b2, &b3, &b4, &c) == 4) { 207 if (sscanf(buf, "%u.%u.%u.%u%c", &b1, &b2, &b3, &b4, &c) == 4) {
212 addr.s6_addr32[0] = 0; 208 addr.s6_addr32[0] = 0;
213 addr.s6_addr32[1] = 0; 209 addr.s6_addr32[1] = 0;
214 addr.s6_addr32[2] = htonl(0xffff); 210 addr.s6_addr32[2] = htonl(0xffff);
@@ -278,13 +274,8 @@ static int ip_map_show(struct seq_file *m,
278 dom = im->m_client->h.name; 274 dom = im->m_client->h.name;
279 275
280 if (ipv6_addr_v4mapped(&addr)) { 276 if (ipv6_addr_v4mapped(&addr)) {
281 seq_printf(m, "%s " NIPQUAD_FMT " %s\n", 277 seq_printf(m, "%s %pI4 %s\n",
282 im->m_class, 278 im->m_class, &addr.s6_addr32[3], dom);
283 ntohl(addr.s6_addr32[3]) >> 24 & 0xff,
284 ntohl(addr.s6_addr32[3]) >> 16 & 0xff,
285 ntohl(addr.s6_addr32[3]) >> 8 & 0xff,
286 ntohl(addr.s6_addr32[3]) >> 0 & 0xff,
287 dom);
288 } else { 279 } else {
289 seq_printf(m, "%s %pI6 %s\n", im->m_class, &addr, dom); 280 seq_printf(m, "%s %pI6 %s\n", im->m_class, &addr, dom);
290 } 281 }