Skip to content

Commit

Permalink
net: sctp_probe: simplify code by using %pISc format specifier
Browse files Browse the repository at this point in the history
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>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Daniel Borkmann authored and David S. Miller committed Aug 23, 2013
1 parent 5b5fde7 commit 05f147e
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions net/sctp/probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 05f147e

Please sign in to comment.