netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: sctp_probe: simplify code by using %pISc format specifier
@ 2013-08-22 15:12 Daniel Borkmann
  2013-08-22 15:26 ` Neil Horman
  2013-08-23  5:10 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Daniel Borkmann @ 2013-08-22 15:12 UTC (permalink / raw)
  To: davem; +Cc: netdev, linux-sctp

We can simply use the %pISc format specifier that was recently added
and thus remove some code that distinguishes between IPv4 and IPv6.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
---
 net/sctp/probe.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/net/sctp/probe.c b/net/sctp/probe.c
index e62c225..cd72ae5 100644
--- a/net/sctp/probe.c
+++ b/net/sctp/probe.c
@@ -155,13 +155,8 @@ static sctp_disposition_t jsctp_sf_eat_sack(struct net *net,
 			if (sp == asoc->peer.primary_path)
 				printl("*");
 
-			if (sp->ipaddr.sa.sa_family == AF_INET)
-				printl("%pI4 ", &sp->ipaddr.v4.sin_addr);
-			else
-				printl("%pI6 ", &sp->ipaddr.v6.sin6_addr);
-
-			printl("%2u %8u %8u %8u %8u %8u ",
-			       sp->state, sp->cwnd, sp->ssthresh,
+			printl("%pISc %2u %8u %8u %8u %8u %8u ",
+			       &sp->ipaddr, sp->state, sp->cwnd, sp->ssthresh,
 			       sp->flight_size, sp->partial_bytes_acked,
 			       sp->pathmtu);
 		}
-- 
1.7.11.7

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] net: sctp_probe: simplify code by using %pISc format specifier
  2013-08-22 15:12 [PATCH net-next] net: sctp_probe: simplify code by using %pISc format specifier Daniel Borkmann
@ 2013-08-22 15:26 ` Neil Horman
  2013-08-23  5:10 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Neil Horman @ 2013-08-22 15:26 UTC (permalink / raw)
  To: Daniel Borkmann; +Cc: davem, netdev, linux-sctp

On Thu, Aug 22, 2013 at 05:12:50PM +0200, Daniel Borkmann wrote:
> We can simply use the %pISc format specifier that was recently added
> and thus remove some code that distinguishes between IPv4 and IPv6.
> 
> Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
> ---
>  net/sctp/probe.c | 9 ++-------
>  1 file changed, 2 insertions(+), 7 deletions(-)
> 
> diff --git a/net/sctp/probe.c b/net/sctp/probe.c
> index e62c225..cd72ae5 100644
> --- a/net/sctp/probe.c
> +++ b/net/sctp/probe.c
> @@ -155,13 +155,8 @@ static sctp_disposition_t jsctp_sf_eat_sack(struct net *net,
>  			if (sp == asoc->peer.primary_path)
>  				printl("*");
>  
> -			if (sp->ipaddr.sa.sa_family == AF_INET)
> -				printl("%pI4 ", &sp->ipaddr.v4.sin_addr);
> -			else
> -				printl("%pI6 ", &sp->ipaddr.v6.sin6_addr);
> -
> -			printl("%2u %8u %8u %8u %8u %8u ",
> -			       sp->state, sp->cwnd, sp->ssthresh,
> +			printl("%pISc %2u %8u %8u %8u %8u %8u ",
> +			       &sp->ipaddr, sp->state, sp->cwnd, sp->ssthresh,
>  			       sp->flight_size, sp->partial_bytes_acked,
>  			       sp->pathmtu);
>  		}
> -- 
> 1.7.11.7
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sctp" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
Acked-by: Neil Horman <nhorman@tuxdriver.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] net: sctp_probe: simplify code by using %pISc format specifier
  2013-08-22 15:12 [PATCH net-next] net: sctp_probe: simplify code by using %pISc format specifier Daniel Borkmann
  2013-08-22 15:26 ` Neil Horman
@ 2013-08-23  5:10 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2013-08-23  5:10 UTC (permalink / raw)
  To: dborkman; +Cc: netdev, linux-sctp

From: Daniel Borkmann <dborkman@redhat.com>
Date: Thu, 22 Aug 2013 17:12:50 +0200

> We can simply use the %pISc format specifier that was recently added
> and thus remove some code that distinguishes between IPv4 and IPv6.
> 
> Signed-off-by: Daniel Borkmann <dborkman@redhat.com>

Applied.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-08-23  5:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-22 15:12 [PATCH net-next] net: sctp_probe: simplify code by using %pISc format specifier Daniel Borkmann
2013-08-22 15:26 ` Neil Horman
2013-08-23  5:10 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).