diff options
Diffstat (limited to 'net/sunrpc/svcauth_unix.c')
-rw-r--r-- | net/sunrpc/svcauth_unix.c | 17 |
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 | } |