diff options
author | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2015-12-02 14:14:32 +0100 |
---|---|---|
committer | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2015-12-03 11:44:39 +0100 |
commit | 52c0bd3025f319597ce40621ef44e39e01594605 (patch) | |
tree | a79880f42e32a1d8a2b8edf8ae94a1d1b4755f79 /openbsc/src/gprs/gtphub.c | |
parent | bc44330671c019be92b335149a2aefa3cc08b8f7 (diff) |
gtphub: cosmetic: early continue for less indent
Sponsored-by: On-Waves ehi
Diffstat (limited to 'openbsc/src/gprs/gtphub.c')
-rw-r--r-- | openbsc/src/gprs/gtphub.c | 43 |
1 files changed, 22 insertions, 21 deletions
diff --git a/openbsc/src/gprs/gtphub.c b/openbsc/src/gprs/gtphub.c index 66716de37..6dc1ea0fb 100644 --- a/openbsc/src/gprs/gtphub.c +++ b/openbsc/src/gprs/gtphub.c @@ -1276,27 +1276,28 @@ static int gtphub_check_reused_teis(struct gtphub *hub, for_each_side_and_plane(side_idx, plane_idx) { te = &tun->endpoint[side_idx][plane_idx]; te2 = &new_tun->endpoint[side_idx][plane_idx]; - if ((te->tei_orig == te2->tei_orig) - && gsn_addr_same(&te->peer->peer_addr->addr, - &te2->peer->peer_addr->addr)) { - - /* The peer is reusing a TEI that I believe to - * be part of another tunnel. The other tunnel - * must be stale, then. */ - LOG(LOGL_NOTICE, - "Expiring tunnel due to reused TEI:" - " peer %s sent %s TEI %x," - " previously used by tunnel %s...\n", - gtphub_port_str(te->peer), - gtphub_plane_idx_names[plane_idx], - te->tei_orig, - gtphub_tunnel_str(tun)); - LOG(LOGL_NOTICE, "...while establishing tunnel %s\n", - gtphub_tunnel_str(new_tun)); - expiring_item_del(&tun->expiry_entry); - /* continue to find more matches. There shouldn't be - * any, but let's make sure. */ - } + if ((te->tei_orig != te2->tei_orig) + || !gsn_addr_same(&te->peer->peer_addr->addr, + &te2->peer->peer_addr->addr)) + continue; + + /* The peer is reusing a TEI that I believe to + * be part of another tunnel. The other tunnel + * must be stale, then. */ + LOG(LOGL_NOTICE, + "Expiring tunnel due to reused TEI:" + " peer %s sent %s TEI %x," + " previously used by tunnel %s...\n", + gtphub_port_str(te->peer), + gtphub_plane_idx_names[plane_idx], + te->tei_orig, + gtphub_tunnel_str(tun)); + LOG(LOGL_NOTICE, "...while establishing tunnel %s\n", + gtphub_tunnel_str(new_tun)); + + expiring_item_del(&tun->expiry_entry); + /* continue to find more matches. There shouldn't be + * any, but let's make sure. */ } /* Check whether the mapped TEIs assigned to the endpoints are |