Commit 07868284e530d52f72b14b800398a8fefa7cf5d0
Committed by
David S. Miller
1 parent
7177a3b037
sctp: reduce indent level on sctp_v4_get_dst
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>
Showing 1 changed file with 17 additions and 15 deletions Side-by-side Diff
net/sctp/protocol.c
... | ... | @@ -489,21 +489,23 @@ |
489 | 489 | list_for_each_entry_rcu(laddr, &bp->address_list, list) { |
490 | 490 | if (!laddr->valid) |
491 | 491 | continue; |
492 | - if ((laddr->state == SCTP_ADDR_SRC) && | |
493 | - (AF_INET == laddr->a.sa.sa_family)) { | |
494 | - fl4->fl4_sport = laddr->a.v4.sin_port; | |
495 | - flowi4_update_output(fl4, | |
496 | - asoc->base.sk->sk_bound_dev_if, | |
497 | - RT_CONN_FLAGS(asoc->base.sk), | |
498 | - daddr->v4.sin_addr.s_addr, | |
499 | - laddr->a.v4.sin_addr.s_addr); | |
492 | + if (laddr->state != SCTP_ADDR_SRC || | |
493 | + AF_INET != laddr->a.sa.sa_family) | |
494 | + continue; | |
500 | 495 | |
501 | - rt = ip_route_output_key(sock_net(sk), fl4); | |
502 | - if (!IS_ERR(rt)) { | |
503 | - dst = &rt->dst; | |
504 | - goto out_unlock; | |
505 | - } | |
506 | - } | |
496 | + fl4->fl4_sport = laddr->a.v4.sin_port; | |
497 | + flowi4_update_output(fl4, | |
498 | + asoc->base.sk->sk_bound_dev_if, | |
499 | + RT_CONN_FLAGS(asoc->base.sk), | |
500 | + daddr->v4.sin_addr.s_addr, | |
501 | + laddr->a.v4.sin_addr.s_addr); | |
502 | + | |
503 | + rt = ip_route_output_key(sock_net(sk), fl4); | |
504 | + if (IS_ERR(rt)) | |
505 | + continue; | |
506 | + | |
507 | + dst = &rt->dst; | |
508 | + break; | |
507 | 509 | } |
508 | 510 | |
509 | 511 | out_unlock: |