From: gitosis@osmocom.org
Precedence: list
To: osmocom-commitlog@lists.osmocom.org
Date: Wed, 24 Sep 2014 10:56:07 GMT
Message-ID: <201409241056.s8OAu7mD001619@git.osmocom.org>
Subject: openbsc.git branch jerlbeck/wip/gprs-patching updated.
	0.13.0-685-g9a696cf
Message: 1

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The OpenBSC GSM Base Station Controller (+MSC/HLR/SGSN)".

The branch, jerlbeck/wip/gprs-patching has been updated
  discards  00c1cde7861f16a4fe08ad8ffc186644d977e715 (commit)
  discards  c388e4247cfc33ea1c4f0eab9502c23fb9d028ac (commit)
  discards  012945daf876af9772fb72eb64c2226f1c6f6027 (commit)
  discards  eb16391cd7de088adbf3ac64cfbfe0b0c72878b8 (commit)
  discards  a391b52103c44076d813bd78fce4586a811481df (commit)
  discards  37f27e9edf0b0cd01c115411fd4d88fb5ab306d2 (commit)
  discards  f6af2b66a1e59b540a2e728441bc462090d78b70 (commit)
  discards  d180551273e7f6b252e16ef02ea318ac6c859933 (commit)
  discards  67625f0e43bdd373457b399d74c0ef7c4d897524 (commit)
  discards  71a71c1019701fd8ad50212e50511a145facbfa1 (commit)
  discards  139713d557ebec952bcbb2045c10ea4ead024df3 (commit)
  discards  c421a28d2f218572d61545a93f7a4e700096678f (commit)
  discards  82a32cb7a1b30b9e28e2cd9eb4ca821520fcd8c7 (commit)
  discards  c22af2ff6964cc014809762b03befbe16efde387 (commit)
  discards  9b9a1cf1763ef7bf79c58f9b8aedcb30ab2d1cb8 (commit)
  discards  a616caa4da476f21088d28edd3d0b6eb5a7c9668 (commit)
  discards  a16d84a48d6a66770035582ae6ac2cdd49203905 (commit)
  discards  9217f6b00f1b096e0d438b2161ffe9335b3ee957 (commit)
  discards  f2864f727c7cc8f8d702efc503a6fce3f9534674 (commit)
  discards  303bed9819967b861c70010fbc3d8b482086e8b6 (commit)
  discards  b23350718ccb5d6e9dd583c22bbb0722863e0fe8 (commit)
       via  9a696cf1bcac6b8be2c10d1ab04420e1330ceda4 (commit)
       via  cab45cf21e690647dc68e3a6f1a23fc722e29702 (commit)
       via  b984242135ecdd51ef9e5de4c466617ac39d3571 (commit)
       via  8c10c354136d7b73f7fa9b034a5aeddcc29a216d (commit)
       via  36e8333166ea9311388a3f4836f5e03db3fedc05 (commit)
       via  334ae094e8aace21f1a18a41aba3830f89f4e33e (commit)
       via  805bff87f69e2a4175e5e45bdd1c8d756fb9a9bc (commit)
       via  8b08d3e2cff38ac6adcd75c02eeb485a58d81a1b (commit)
       via  2b45801fb5fb148f6d13a0b46dfe3d2d1de2221f (commit)
       via  5bedbb85f9025d0ffb5fb75934a24744feb4d5f7 (commit)
       via  8319e3edc3fb829964feba8a16dfc982cfba0dd3 (commit)
       via  a7de1e34bd17a31c41b168097aea30494d26606e (commit)
       via  3592991d14f087c278600c39f69fb75cd75f8cd9 (commit)
       via  d5a75139088675031891fd865f31ff93b2e1d122 (commit)
       via  ab8b04356375d298296c8f4cf679789eeb887340 (commit)
       via  a48e19c80762240f5c0f4a977425479ae7eb6922 (commit)
       via  ca007d21857635e60636f9bdb023bbafac0dc9ec (commit)
       via  f77b8f040864810f4184728fb80f6d1831c5b3da (commit)
       via  e91f67f64d706b53165cda19833d06ee47d97bf8 (commit)
       via  0cdfe8d2314dc44b2d9aa946dc838ee5747a3093 (commit)
       via  4ca6f7263875d40bccd0f629d82ff7df6724221b (commit)
       via  c76f20e17f4efd2d5d990b26d7de330b367d2713 (commit)
       via  465531403c0f95968854a3667060b1a106a939f6 (commit)
       via  b15ceec33f557b7cdd22166fd997e6615c644cc5 (commit)

This update added new revisions after undoing existing revisions.  That is
to say, the old revision is not a strict subset of the new revision.  This
situation occurs when you --force push a change and generate a repository
containing something like this:

 * -- * -- B -- O -- O -- O (00c1cde7861f16a4fe08ad8ffc186644d977e715)
            \
             N -- N -- N (9a696cf1bcac6b8be2c10d1ab04420e1330ceda4)

When this happens we assume that you've already had alert emails for all
of the O revisions, and so we here report only the revisions in the N
branch from the common base, B.

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cgit.osmocom.org/openbsc/commit/?id=9a696cf1bcac6b8be2c10d1ab04420e1330ceda4

commit 9a696cf1bcac6b8be2c10d1ab04420e1330ceda4
Author: Jacob Erlbeck <jerlbeck@sysmocom.de>
Date:   Mon Sep 22 19:16:06 2014 +0200

    gbproxy/test: Add expect_msg checks to test_gbproxy_keep_info (TODO)
    
    This patch adds assertions to check the LLC/GMM message received from
    the gbproxy by the test framework within the function
    test_gbproxy_keep_info.
    
    TODO:
     - more tests
    
    Sponsored-by: On-Waves ehf

http://cgit.osmocom.org/openbsc/commit/?id=cab45cf21e690647dc68e3a6f1a23fc722e29702

commit cab45cf21e690647dc68e3a6f1a23fc722e29702
Author: Jacob Erlbeck <jerlbeck@sysmocom.de>
Date:   Tue Sep 23 14:56:38 2014 +0200

    gbproxy/test: Add expect_msg checks to test_gbproxy_ra_patching
    
    This patch adds assertions to check the LLC/GMM message received from
    the gbproxy by the test framework within the function
    test_gbproxy_ra_patching.
    
    Sponsored-by: On-Waves ehf

http://cgit.osmocom.org/openbsc/commit/?id=b984242135ecdd51ef9e5de4c466617ac39d3571

commit b984242135ecdd51ef9e5de4c466617ac39d3571
Author: Jacob Erlbeck <jerlbeck@sysmocom.de>
Date:   Mon Sep 22 18:54:34 2014 +0200

    gbproxy/test: Save and check received messages
    
    Currently the only way to check, whether the right message have been
    generated is to look into the generated text output. This is
    error-prone if there are many messages.
    
    This patch adds a way to optionally store all received messages into
    a FIFO. They can then be checked by calling expect_msg() which
    removes the first message from the FIFO and returns a pointer to it
    or NULL if there is none. The pointer is only valid until the next
    call to this function.
    
    A few convenience functions are added to check for common message
    types:
    
      - expect_gmm_msg checks for certain GSM 04.08 messages in LLC/GMM
      - expect_llc_msg checks for arbitrary LLC messages in BSSGP/UD
      - expect_bssgp_msg checks for arbitrary BSSG messages
    
    Each of their arguments can be set by MATCH_ANY to ignore it while
    matching. On success, they return a pointer to a statically
    allocated struct containing the pointer to the msg and the full parse
    context.
    
    Recording is enabled by setting the global variable received_messages
    to a pointer to a struct llist_head. It can be disabled again by
    setting it to NULL.
    
    Sponsored-by: On-Waves ehf

http://cgit.osmocom.org/openbsc/commit/?id=8c10c354136d7b73f7fa9b034a5aeddcc29a216d

commit 8c10c354136d7b73f7fa9b034a5aeddcc29a216d
Author: Jacob Erlbeck <jerlbeck@sysmocom.de>
Date:   Mon Sep 22 18:50:08 2014 +0200

    gprs: Fix gprs_msgb_copy pointer computation
    
    Currently the pointer are computed by adding an offset to the new
    message's _data pointer even when the original pointer is NULL.
    This leads to invalid pointers in the copied msgb.
    
    This patch adds a NULL check to each computation such that NULL
    pointers are not adjusted.
    
    Sponsored-by: On-Waves ehf

http://cgit.osmocom.org/openbsc/commit/?id=36e8333166ea9311388a3f4836f5e03db3fedc05

commit 36e8333166ea9311388a3f4836f5e03db3fedc05
Author: Jacob Erlbeck <jerlbeck@sysmocom.de>
Date:   Mon Sep 22 15:41:21 2014 +0200

    gbproxy: Refactor local message generation
    
    This patch adds und uses the function gbproxy_gsm48_to_peer() which
    takes a GSM 04.08 message, encapsulates it in BSSGP and LLC, and
    sends it to the BSS peer. This function increments vu_gen_tx_bss
    which is now used instead of imsi_acq_retries to set the N(U) of the
    outgoing message.
    
    Since imsi_acq_retries isn't currently incremented before a Detach
    Accept is generated, this patch also fixes the N(U) of such messages.
    
    Sponsored-by: On-Waves ehf

http://cgit.osmocom.org/openbsc/commit/?id=334ae094e8aace21f1a18a41aba3830f89f4e33e

commit 334ae094e8aace21f1a18a41aba3830f89f4e33e
Author: Jacob Erlbeck <jerlbeck@sysmocom.de>
Date:   Mon Sep 22 13:30:46 2014 +0200

    gbproxy: Reset IMSI acquisition within gbproxy_unregister_link_info
    
    Currently then link_info is not cleanup up completely, when
    gbproxy_unregister_link_info is called.
    
    This patch adds a function gbproxy_reset_link that must be defined
    externally. This is done in gb_proxy.c, where it resets the IMSI
    acquisition.
    
    Sponsored-by: On-Waves ehf

http://cgit.osmocom.org/openbsc/commit/?id=805bff87f69e2a4175e5e45bdd1c8d756fb9a9bc

commit 805bff87f69e2a4175e5e45bdd1c8d756fb9a9bc
Author: Jacob Erlbeck <jerlbeck@sysmocom.de>
Date:   Mon Sep 22 10:42:05 2014 +0200

    gbproxy: Parse Attach Reject messages
    
    That message is currently ignored but should invalidate the TLLI and
    de-register the logical link instead.
    
    This patch extends the parser to recognize such messages and to set
    the invalidate_tlli flag.
    
    Sponsored-by: On-Waves ehf

http://cgit.osmocom.org/openbsc/commit/?id=8b08d3e2cff38ac6adcd75c02eeb485a58d81a1b

commit 8b08d3e2cff38ac6adcd75c02eeb485a58d81a1b
Author: Jacob Erlbeck <jerlbeck@sysmocom.de>
Date:   Mon Sep 22 11:26:58 2014 +0200

    gbproxy/test: Add invalidation tests to test_gbproxy_keep_info()
    
    The TLLI should also be invalidated:
     - when an Attach Reject info is received from the SGSN
     - when an Attach Req is immediately followed by a Detach Req
     - when an Attach Req is immediately followed by an MT detach
       procedure
    
    To verify that, this patch adds corresponding message sequences to
    the test.
    
    Sponsored-by: On-Waves ehf

http://cgit.osmocom.org/openbsc/commit/?id=2b45801fb5fb148f6d13a0b46dfe3d2d1de2221f

commit 2b45801fb5fb148f6d13a0b46dfe3d2d1de2221f
Author: Jacob Erlbeck <jerlbeck@sysmocom.de>
Date:   Mon Sep 22 09:28:27 2014 +0200

    gbproxy/test: Fix IMSI length check (Coverity)
    
    This fixes the IMSI length assertion, which currently uses a
    greater-or-equal than zero comparison which always yields true. It is
    replaced by a greater than zero check.
    
    Fixes: Coverity CID 1239442
    
    Sponsored-by: On-Waves ehf

http://cgit.osmocom.org/openbsc/commit/?id=5bedbb85f9025d0ffb5fb75934a24744feb4d5f7

commit 5bedbb85f9025d0ffb5fb75934a24744feb4d5f7
Author: Jacob Erlbeck <jerlbeck@sysmocom.de>
Date:   Fri Sep 19 16:40:21 2014 +0200

    gbproxy/test: Fix time calculation in test_gbproxy_tlli_expire()
    
    A single test case still uses time() to obtain the reference time.
    
    This commit fixes this by using the 'now' variable instead, that
    contains a fixed time value and does therefore not depend on when the
    test is executed.
    
    Sponsored-by: On-Waves ehf

http://cgit.osmocom.org/openbsc/commit/?id=8319e3edc3fb829964feba8a16dfc982cfba0dd3

commit 8319e3edc3fb829964feba8a16dfc982cfba0dd3
Author: Jacob Erlbeck <jerlbeck@sysmocom.de>
Date:   Fri Sep 19 16:34:01 2014 +0200

    gbproxy: Use monotonic system time instead of time-of-day
    
    Currently time() is used for age calculations. This time source
    may jump either forwards or backwards in time (NTP update, leap
    seconds).
    
    This patch replaces the use of time() by using
    clock_gettime(CLOCK_MONOTONIC) instead.
    
    Sponsored-by: On-Waves ehf

http://cgit.osmocom.org/openbsc/commit/?id=a7de1e34bd17a31c41b168097aea30494d26606e

commit a7de1e34bd17a31c41b168097aea30494d26606e
Author: Jacob Erlbeck <jerlbeck@sysmocom.de>
Date:   Fri Sep 19 16:14:14 2014 +0200

    gbproxy: Only search by valid identifiers
    
    Don't return a link_info if TLLI is 0 resp. P-TMSI is 0xffff. These
    values are used for uninitialised or cleared fields and can possibly
    match several entries.
    
    Sponsored-by: On-Waves ehf

http://cgit.osmocom.org/openbsc/commit/?id=3592991d14f087c278600c39f69fb75cd75f8cd9

commit 3592991d14f087c278600c39f69fb75cd75f8cd9
Author: Jacob Erlbeck <jerlbeck@sysmocom.de>
Date:   Fri Sep 19 15:36:44 2014 +0200

    gbproxy: Replace 'tlli' by 'link' in VTY commands
    
    Since the (former) TLLI list has developed into a logical link list,
    related commands are renamed accordingly.
    
     - tlli-list * -> link-list *
     - delete-gbproxy-tlli * -> delete-gbproxy-link *
     - show gbproxy tllis -> show gbproxy links
    
    Sponsored-by: On-Waves ehf

http://cgit.osmocom.org/openbsc/commit/?id=d5a75139088675031891fd865f31ff93b2e1d122

commit d5a75139088675031891fd865f31ff93b2e1d122
Author: Jacob Erlbeck <jerlbeck@sysmocom.de>
Date:   Fri Sep 19 16:03:07 2014 +0200

    gbproxy: Rename the field 'enabled_tllis' to 'logical_links'
    
    This field in struct gbproxy_patch_state has involved and holds a
    list of all tracked logical links now. Thus the name is modified
    accordingly.
    
    Sponsored-by: On-Waves ehf

http://cgit.osmocom.org/openbsc/commit/?id=ab8b04356375d298296c8f4cf679789eeb887340

commit ab8b04356375d298296c8f4cf679789eeb887340
Author: Jacob Erlbeck <jerlbeck@sysmocom.de>
Date:   Fri Sep 19 15:07:27 2014 +0200

    gbproxy: Use the term 'link' instead of 'tlli'
    
    Currently in many places where 'tlli' (Temporary Logical Link
    Identifier) within identifiers is used, the logical link itself is
    meant instead. For instance, the tlli_info contain information about
    an LLC logical link including up to four individual TLLI.
    
    To avoid confusion between these concepts, this patch replaces all
    'tlli_info' by 'link_info' and a few 'tlli' by 'link'.
    
    Sponsored-by: On-Waves ehf

http://cgit.osmocom.org/openbsc/commit/?id=a48e19c80762240f5c0f4a977425479ae7eb6922

commit a48e19c80762240f5c0f4a977425479ae7eb6922
Author: Jacob Erlbeck <jerlbeck@sysmocom.de>
Date:   Fri Sep 19 13:30:14 2014 +0200

    gbproxy: Rename functions related to tlli_info
    
    This patch replaces 'tlli' by 'tlli_info' within the following
    function identifiers:
      - gbproxy_delete_tlli
      - gbproxy_delete_tllis
      - gbproxy_remove_stale_tllis
      - gbproxy_touch_tlli
      - gbproxy_unregister_tlli
      - gbproxy_remove_matching_tllis
      - gbproxy_find_tlli -> gbproxy_tlli_info_by_tlli
      - gbproxy_find_tlli_by_* -> gbproxy_tlli_info_by_*
    
    These functions refer to the whole logical link info rather than to a
    certain TLLI. So they are renamed to be named consistently with
    gbproxy_attach_tlli_info and others.
    
    Sponsored-by: On-Waves ehf

http://cgit.osmocom.org/openbsc/commit/?id=ca007d21857635e60636f9bdb023bbafac0dc9ec

commit ca007d21857635e60636f9bdb023bbafac0dc9ec
Author: Jacob Erlbeck <jerlbeck@sysmocom.de>
Date:   Fri Sep 19 13:23:21 2014 +0200

    gbproxy: Remove sgsn_nsei parameter
    
    The function gbproxy_imsi_acquisition() has a parameter sgsn_nsei
    that is alyways equal to tlli_info->sgsn_nsei (if tlli_info is not
    NULL).
    
    This patch removes this parameter from gbproxy_imsi_acquisition() and
    gbproxy_flush_stored_messages() and accesses tlli_info->sgsn_nsei
    instead within these functions.
    
    Sponsored-by: On-Waves ehf

http://cgit.osmocom.org/openbsc/commit/?id=f77b8f040864810f4184728fb80f6d1831c5b3da

commit f77b8f040864810f4184728fb80f6d1831c5b3da
Author: Jacob Erlbeck <jerlbeck@sysmocom.de>
Date:   Fri Sep 19 13:17:55 2014 +0200

    gbproxy: Rename identifiers related to IMSI matching
    
    This patch renames gbproxy_check_tlli() to
    gbproxy_imsi_matches() and struct tlli_info's
    enable_patching to imsi_matches.
    
    It's meant to be more obvious and consistent this way.
    
    Sponsored-by: On-Waves ehf

http://cgit.osmocom.org/openbsc/commit/?id=e91f67f64d706b53165cda19833d06ee47d97bf8

commit e91f67f64d706b53165cda19833d06ee47d97bf8
Author: Jacob Erlbeck <jerlbeck@sysmocom.de>
Date:   Fri Sep 5 14:32:36 2014 +0200

    sgsn: Send detach(re-attach) instead of gmm status if TLLI unknown (TODO)
    
    The osmo-sgsn sends Status messages (or nothing in case of non
    GMM/GSM) when the TLLI is unknown. This prevents the MS from
    reconnecting.
    
    This experimental patch initiates a MT detach procedure to force a
    re-attach to set up a valid LLE context.
    
    TODO:
      - test cases
    
    Note that the MS can be put into REGISTERED state after initially
    wanting to detach itself, since it will receive a Detach Req
    (re-attach) after the SGSN or gbproxy (P-TMSI patching enabled) has
    been restarted. This same behaviour has been observed with another
    SGSN.
    
    Sponsored-by: On-Waves ehf

http://cgit.osmocom.org/openbsc/commit/?id=0cdfe8d2314dc44b2d9aa946dc838ee5747a3093

commit 0cdfe8d2314dc44b2d9aa946dc838ee5747a3093
Author: Jacob Erlbeck <jerlbeck@sysmocom.de>
Date:   Fri Sep 19 09:28:42 2014 +0200

    gbproxy/sgsn: Enforce termination when creating a P-TMSI/TLLI
    
    Currently the number of iterations when creating a P-TMSI/TLLI is not
    limited. It is nevertheless very unlikely that the loop will not
    terminate. On the other hand, the number of iterations of every loop
    should have an upper bound (loop variant) which wouldn't be the case
    here if an arbitrary random generator was used.
    
    This patch limits the number of iterations to 23 and logs an error if
    the creation of the indentifier was aborted due to this limit.
    
    Sponsored-by: On-Waves ehf

http://cgit.osmocom.org/openbsc/commit/?id=4ca6f7263875d40bccd0f629d82ff7df6724221b

commit 4ca6f7263875d40bccd0f629d82ff7df6724221b
Author: Jacob Erlbeck <jerlbeck@sysmocom.de>
Date:   Thu Sep 18 10:08:27 2014 +0200

    gbproxy: Restart IMSI acquisition on RA UDP REQ
    
    Currently the IMSI acquisition is not restarted when a RA Update
    Request is received. This leads to repeated N(U) in the generated
    Ident Request message, which in turn causes the MS to drop the
    second of these message. This is bad, when the first Ident Response
    has been lost between MS and gbproxy.
    
    This patch changes gbproxy_imsi_acquisition() to handle RA Update
    Request messages like Attach Requests.
    
    Sponsored-by: On-Waves ehf

http://cgit.osmocom.org/openbsc/commit/?id=c76f20e17f4efd2d5d990b26d7de330b367d2713

commit c76f20e17f4efd2d5d990b26d7de330b367d2713
Author: Jacob Erlbeck <jerlbeck@sysmocom.de>
Date:   Thu Sep 18 09:57:47 2014 +0200

    gbproxy/test: Test IMSI acquisition for RA UDP REQ
    
    When a MS is state GMM_REGISTERED enters a new RA, it sends a RA
    Update Request which is then handled by a gbproxy that possibly
    doesn't have a matching tlli_info. In this case, depending on the
    configuration an identification procedure to acquire the IMSI must be
    started.
    
    This adds tests to test_gbproxy_imsi_acquisition():
     - IMSI acquisition triggered by a RA Update Request message
     - Reaction to repeated RA Update Request messages, like it could be
       caused by packet loss between PCU and gbproxy.
    
    Sponsored-by: On-Waves ehf

-----------------------------------------------------------------------

Summary of changes:
 openbsc/include/openbsc/gprs_sgsn.h  |   5 +
 openbsc/src/gprs/gprs_gmm.c          | 107 +++++++-------
 openbsc/src/gprs/gprs_llc.c          |   6 +-
 openbsc/src/gprs/gprs_sgsn.c         |   4 +-
 openbsc/src/gprs/sgsn_libgtp.c       |  10 +-
 openbsc/tests/gbproxy/gbproxy_test.c | 261 ++++++++++++++++++++++++++---------
 6 files changed, 266 insertions(+), 127 deletions(-)


hooks/post-receive
-- 
The OpenBSC GSM Base Station Controller (+MSC/HLR/SGSN)


