Skip to content

Commit

Permalink
sctp: reduce indent level on sctp_v4_get_dst
Browse files Browse the repository at this point in the history
Paves the day for the next patch. Functionality stays untouched.

Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Marcelo Ricardo Leitner authored and David S. Miller committed Jul 21, 2015
1 parent 7177a3b commit 0786828
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions net/sctp/protocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -489,21 +489,23 @@ static void sctp_v4_get_dst(struct sctp_transport *t, union sctp_addr *saddr,
list_for_each_entry_rcu(laddr, &bp->address_list, list) {
if (!laddr->valid)
continue;
if ((laddr->state == SCTP_ADDR_SRC) &&
(AF_INET == laddr->a.sa.sa_family)) {
fl4->fl4_sport = laddr->a.v4.sin_port;
flowi4_update_output(fl4,
asoc->base.sk->sk_bound_dev_if,
RT_CONN_FLAGS(asoc->base.sk),
daddr->v4.sin_addr.s_addr,
laddr->a.v4.sin_addr.s_addr);

rt = ip_route_output_key(sock_net(sk), fl4);
if (!IS_ERR(rt)) {
dst = &rt->dst;
goto out_unlock;
}
}
if (laddr->state != SCTP_ADDR_SRC ||
AF_INET != laddr->a.sa.sa_family)
continue;

fl4->fl4_sport = laddr->a.v4.sin_port;
flowi4_update_output(fl4,
asoc->base.sk->sk_bound_dev_if,
RT_CONN_FLAGS(asoc->base.sk),
daddr->v4.sin_addr.s_addr,
laddr->a.v4.sin_addr.s_addr);

rt = ip_route_output_key(sock_net(sk), fl4);
if (IS_ERR(rt))
continue;

dst = &rt->dst;
break;
}

out_unlock:
Expand Down

0 comments on commit 0786828

Please sign in to comment.