diff options
Diffstat (limited to 'net/sunrpc/xprtsock.c')
-rw-r--r-- | net/sunrpc/xprtsock.c | 41 |
1 files changed, 19 insertions, 22 deletions
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index 0a50361e3d83..5cbb404c4cdf 100644 --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c | |||
@@ -284,8 +284,7 @@ static void xs_format_ipv4_peer_addresses(struct rpc_xprt *xprt, | |||
284 | 284 | ||
285 | buf = kzalloc(20, GFP_KERNEL); | 285 | buf = kzalloc(20, GFP_KERNEL); |
286 | if (buf) { | 286 | if (buf) { |
287 | snprintf(buf, 20, NIPQUAD_FMT, | 287 | snprintf(buf, 20, "%pI4", &addr->sin_addr.s_addr); |
288 | NIPQUAD(addr->sin_addr.s_addr)); | ||
289 | } | 288 | } |
290 | xprt->address_strings[RPC_DISPLAY_ADDR] = buf; | 289 | xprt->address_strings[RPC_DISPLAY_ADDR] = buf; |
291 | 290 | ||
@@ -300,8 +299,8 @@ static void xs_format_ipv4_peer_addresses(struct rpc_xprt *xprt, | |||
300 | 299 | ||
301 | buf = kzalloc(48, GFP_KERNEL); | 300 | buf = kzalloc(48, GFP_KERNEL); |
302 | if (buf) { | 301 | if (buf) { |
303 | snprintf(buf, 48, "addr="NIPQUAD_FMT" port=%u proto=%s", | 302 | snprintf(buf, 48, "addr=%pI4 port=%u proto=%s", |
304 | NIPQUAD(addr->sin_addr.s_addr), | 303 | &addr->sin_addr.s_addr, |
305 | ntohs(addr->sin_port), | 304 | ntohs(addr->sin_port), |
306 | protocol); | 305 | protocol); |
307 | } | 306 | } |
@@ -323,8 +322,8 @@ static void xs_format_ipv4_peer_addresses(struct rpc_xprt *xprt, | |||
323 | 322 | ||
324 | buf = kzalloc(30, GFP_KERNEL); | 323 | buf = kzalloc(30, GFP_KERNEL); |
325 | if (buf) { | 324 | if (buf) { |
326 | snprintf(buf, 30, NIPQUAD_FMT".%u.%u", | 325 | snprintf(buf, 30, "%pI4.%u.%u", |
327 | NIPQUAD(addr->sin_addr.s_addr), | 326 | &addr->sin_addr.s_addr, |
328 | ntohs(addr->sin_port) >> 8, | 327 | ntohs(addr->sin_port) >> 8, |
329 | ntohs(addr->sin_port) & 0xff); | 328 | ntohs(addr->sin_port) & 0xff); |
330 | } | 329 | } |
@@ -342,8 +341,7 @@ static void xs_format_ipv6_peer_addresses(struct rpc_xprt *xprt, | |||
342 | 341 | ||
343 | buf = kzalloc(40, GFP_KERNEL); | 342 | buf = kzalloc(40, GFP_KERNEL); |
344 | if (buf) { | 343 | if (buf) { |
345 | snprintf(buf, 40, NIP6_FMT, | 344 | snprintf(buf, 40, "%pI6",&addr->sin6_addr); |
346 | NIP6(addr->sin6_addr)); | ||
347 | } | 345 | } |
348 | xprt->address_strings[RPC_DISPLAY_ADDR] = buf; | 346 | xprt->address_strings[RPC_DISPLAY_ADDR] = buf; |
349 | 347 | ||
@@ -358,18 +356,17 @@ static void xs_format_ipv6_peer_addresses(struct rpc_xprt *xprt, | |||
358 | 356 | ||
359 | buf = kzalloc(64, GFP_KERNEL); | 357 | buf = kzalloc(64, GFP_KERNEL); |
360 | if (buf) { | 358 | if (buf) { |
361 | snprintf(buf, 64, "addr="NIP6_FMT" port=%u proto=%s", | 359 | snprintf(buf, 64, "addr=%pI6 port=%u proto=%s", |
362 | NIP6(addr->sin6_addr), | 360 | &addr->sin6_addr, |
363 | ntohs(addr->sin6_port), | 361 | ntohs(addr->sin6_port), |
364 | protocol); | 362 | protocol); |
365 | } | 363 | } |
366 | xprt->address_strings[RPC_DISPLAY_ALL] = buf; | 364 | xprt->address_strings[RPC_DISPLAY_ALL] = buf; |
367 | 365 | ||
368 | buf = kzalloc(36, GFP_KERNEL); | 366 | buf = kzalloc(36, GFP_KERNEL); |
369 | if (buf) { | 367 | if (buf) |
370 | snprintf(buf, 36, NIP6_SEQFMT, | 368 | snprintf(buf, 36, "%pi6", &addr->sin6_addr); |
371 | NIP6(addr->sin6_addr)); | 369 | |
372 | } | ||
373 | xprt->address_strings[RPC_DISPLAY_HEX_ADDR] = buf; | 370 | xprt->address_strings[RPC_DISPLAY_HEX_ADDR] = buf; |
374 | 371 | ||
375 | buf = kzalloc(8, GFP_KERNEL); | 372 | buf = kzalloc(8, GFP_KERNEL); |
@@ -381,10 +378,10 @@ static void xs_format_ipv6_peer_addresses(struct rpc_xprt *xprt, | |||
381 | 378 | ||
382 | buf = kzalloc(50, GFP_KERNEL); | 379 | buf = kzalloc(50, GFP_KERNEL); |
383 | if (buf) { | 380 | if (buf) { |
384 | snprintf(buf, 50, NIP6_FMT".%u.%u", | 381 | snprintf(buf, 50, "%pI6.%u.%u", |
385 | NIP6(addr->sin6_addr), | 382 | &addr->sin6_addr, |
386 | ntohs(addr->sin6_port) >> 8, | 383 | ntohs(addr->sin6_port) >> 8, |
387 | ntohs(addr->sin6_port) & 0xff); | 384 | ntohs(addr->sin6_port) & 0xff); |
388 | } | 385 | } |
389 | xprt->address_strings[RPC_DISPLAY_UNIVERSAL_ADDR] = buf; | 386 | xprt->address_strings[RPC_DISPLAY_UNIVERSAL_ADDR] = buf; |
390 | 387 | ||
@@ -1415,8 +1412,8 @@ static int xs_bind4(struct sock_xprt *transport, struct socket *sock) | |||
1415 | if (port > last) | 1412 | if (port > last) |
1416 | nloop++; | 1413 | nloop++; |
1417 | } while (err == -EADDRINUSE && nloop != 2); | 1414 | } while (err == -EADDRINUSE && nloop != 2); |
1418 | dprintk("RPC: %s "NIPQUAD_FMT":%u: %s (%d)\n", | 1415 | dprintk("RPC: %s %pI4:%u: %s (%d)\n", |
1419 | __func__, NIPQUAD(myaddr.sin_addr), | 1416 | __func__, &myaddr.sin_addr, |
1420 | port, err ? "failed" : "ok", err); | 1417 | port, err ? "failed" : "ok", err); |
1421 | return err; | 1418 | return err; |
1422 | } | 1419 | } |
@@ -1448,8 +1445,8 @@ static int xs_bind6(struct sock_xprt *transport, struct socket *sock) | |||
1448 | if (port > last) | 1445 | if (port > last) |
1449 | nloop++; | 1446 | nloop++; |
1450 | } while (err == -EADDRINUSE && nloop != 2); | 1447 | } while (err == -EADDRINUSE && nloop != 2); |
1451 | dprintk("RPC: xs_bind6 "NIP6_FMT":%u: %s (%d)\n", | 1448 | dprintk("RPC: xs_bind6 %pI6:%u: %s (%d)\n", |
1452 | NIP6(myaddr.sin6_addr), port, err ? "failed" : "ok", err); | 1449 | &myaddr.sin6_addr, port, err ? "failed" : "ok", err); |
1453 | return err; | 1450 | return err; |
1454 | } | 1451 | } |
1455 | 1452 | ||