aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/gprs
AgeCommit message (Collapse)AuthorFilesLines
2014-04-04gprs: Fix compiler warnings ini gprs_sndcp_vty.cHolger Hans Peter Freyther1-2/+0
CC gprs_sndcp_vty.o gprs_sndcp_vty.c: In function ‘vty_dump_sne’: gprs_sndcp_vty.c:46:15: warning: unused variable ‘i’ [-Wunused-variable] unsigned int i;
2014-04-04gprs: Fix compiler warnings in sgsn_libgtp.cHolger Hans Peter Freyther1-4/+2
CC sgsn_libgtp.o sgsn_libgtp.c: In function ‘create_pdp_conf’: sgsn_libgtp.c:262:6: warning: variable ‘rc’ set but not used [-Wunused-but-set-variable] int rc; ^ sgsn_libgtp.c: In function ‘cb_data_ind’: sgsn_libgtp.c:432:6: warning: variable ‘rc’ set but not used [-Wunused-but-set-variable] int rc;
2014-04-04gprs: Fix compiler warnings in the gprs_llc.c codeHolger Hans Peter Freyther1-1/+9
CC gprs_llc.o gprs_llc.c: In function ‘t200_expired’: gprs_llc.c:322:2: warning: enumeration value ‘GPRS_LLES_UNASSIGNED’ not handled in switch [-Wswitch] switch (lle->state) { ^ gprs_llc.c:322:2: warning: enumeration value ‘GPRS_LLES_ASSIGNED_ADM’ not handled in switch [-Wswitch] gprs_llc.c:322:2: warning: enumeration value ‘GPRS_LLES_REMOTE_EST’ not handled in switch [-Wswitch] gprs_llc.c:322:2: warning: enumeration value ‘GPRS_LLES_ABM’ not handled in switch [-Wswitch] gprs_llc.c:322:2: warning: enumeration value ‘GPRS_LLES_TIMER_REC’ not handled in switch [-Wswitch] gprs_llc.c: In function ‘gprs_llc_hdr_rx’: gprs_llc.c:564:2: warning: enumeration value ‘GPRS_LLC_NULL’ not handled in switch [-Wswitch] switch (gph->cmd) { ^ gprs_llc.c:564:2: warning: enumeration value ‘GPRS_LLC_RR’ not handled in switch [-Wswitch] gprs_llc.c:564:2: warning: enumeration value ‘GPRS_LLC_ACK’ not handled in switch [-Wswitch] gprs_llc.c:564:2: warning: enumeration value ‘GPRS_LLC_RNR’ not handled in switch [-Wswitch] gprs_llc.c:564:2: warning: enumeration value ‘GPRS_LLC_SACK’ not handled in switch [-Wswitch] gprs_llc.c: In function ‘gprs_llc_rcvmsg’: gprs_llc.c:791:23: warning: unused variable ‘udh’ [-Wunused-variable] struct bssgp_ud_hdr *udh = (struct bssgp_ud_hdr *) msgb_bssgph(msg); ^ gprs_llc.c: At top level: gprs_llc.c:311:13: warning: ‘t200_expired’ defined but not used [-Wunused-function] static void t200_expired(void *data) ^ gprs_llc.c:337:13: warning: ‘t201_expired’ defined but not used [-Wunused-function] static void t201_expired(void *data)
2014-04-04gprs: Fix compiler warnings in gprs_sndcp.cHolger Hans Peter Freyther1-4/+2
CC gprs_sndcp.o gprs_sndcp.c: In function ‘defrag_input’: gprs_sndcp.c:188:25: warning: variable ‘scomph’ set but not used [-Wunused-but-set-variable] struct sndcp_comp_hdr *scomph = NULL; ^ gprs_sndcp.c: In function ‘sndcp_llunitdata_ind’: gprs_sndcp.c:512:11: warning: variable ‘npdu_num’ set but not used [-Wunused-but-set-variable] uint16_t npdu_num; ^ gprs_sndcp.c: At top level: gprs_sndcp.c:565:12: warning: ‘sndcp_ll_reset_ind’ defined but not used [-Wunused-function] static int sndcp_ll_reset_ind(struct gprs_sndcp_entity *se) ^ gprs_sndcp.c:573:12: warning: ‘sndcp_ll_status_ind’ defined but not used [-Wunused-function] static int sndcp_ll_status_ind() ^
2014-04-04gprs: Reduce the number of compiler warnings in gprs_gmm.cHolger Hans Peter Freyther1-11/+12
CC gprs_gmm.o gprs_gmm.c: In function ‘gsm48_tx_gmm_att_ack’: gprs_gmm.c:350:11: warning: unused variable ‘ptsig’ [-Wunused-variable] uint8_t *ptsig, *mid; ^ gprs_gmm.c: In function ‘gsm48_rx_gmm_auth_ciph_resp’: gprs_gmm.c:524:6: warning: variable ‘rc’ set but not used [-Wunused-but-set-variable] int rc; ^ gprs_gmm.c: In function ‘gsm48_rx_gmm_att_req’: gprs_gmm.c:703:9: warning: implicit declaration of function ‘sgsn_acl_lookup’ [-Wimplicit-function-declaration] !sgsn_acl_lookup(mi_string))) { ^ gprs_gmm.c:632:40: warning: variable ‘old_ra_info’ set but not used [-Wunused-but-set-variable] uint8_t *cur = gh->data, *msnc, *mi, *old_ra_info, *ms_ra_acc_cap; ^ gprs_gmm.c: In function ‘gsm48_rx_gmm_ra_upd_req’: gprs_gmm.c:915:6: warning: variable ‘rc’ set but not used [-Wunused-but-set-variable] int rc; ^ gprs_gmm.c:910:11: warning: variable ‘ms_ra_acc_cap’ set but not used [-Wunused-but-set-variable] uint8_t *ms_ra_acc_cap; ^ gprs_gmm.c: At top level: gprs_gmm.c:458:12: warning: ‘gsm48_tx_gmm_auth_ciph_req’ defined but not used [-Wunused-function] static int gsm48_tx_gmm_auth_ciph_req(struct sgsn_mm_ctx *mm, uint8_t *rand, ^ gprs_gmm.c:501:12: warning: ‘gsm48_tx_gmm_auth_ciph_rej’ defined but not used [-Wunused-function] static int gsm48_tx_gmm_auth_ciph_rej(struct sgsn_mm_ctx *mm) ^ gprs_gmm.c:1169:13: warning: ‘msgb_put_pdp_addr_ipv4’ defined but not used [-Wunused-function] static void msgb_put_pdp_addr_ipv4(struct msgb *msg, uint32_t ipaddr) ^ gprs_gmm.c:1180:13: warning: ‘msgb_put_pdp_addr_ppp’ defined but not used [-Wunused-function] static void msgb_put_pdp_addr_ppp(struct msgb *msg)
2014-04-04sgsn: Comparing array to NULL is not usefulHolger Hans Peter Freyther1-1/+1
.v is a unsigned char array with up-to 255 elements. We do not need to add a null check here. Fixes: Coverity CID 1040719
2014-03-23sgsn/ctrl: Add ctrl interface, implement listing subscribersHolger Hans Peter Freyther4-4/+158
Add the control interface with no hierachy right now and implement the first command to list IMSI + Context Address of active sessions. sgsn_cmd_handle could share more code with bsc variant. Fixes: SYS#264, SYS#265
2013-11-03gbproxy: The "[stats]" option was not documented, document itHolger Hans Peter Freyther1-1/+1
Documentation error (missing docs): <command id='show gbproxy [stats]'> <param name='[stats]' doc='(null)' />
2013-10-30vty: Use vty_install_default() instead of bsc_install_default()Jacob Erlbeck2-2/+2
Remove ournode_exit_cmd, ournode_end_cmd, and bsc_install_default() since this functionality is provided by the current libosmocore. Replace calls to bsc_install_default() by call to vty_install_default() with the following semantic patch: @rule1@ expression N; @@ - bsc_install_default(N); + vty_install_default(N); Ticket: OW#952 Sponsored-by: On-Waves ehf
2013-10-24gbproxy: Fix handling of NSEI changesJacob Erlbeck1-3/+6
The gbproxy looses NSEI changes on BVC_RESET and then tries to send later messages to the wrong (not longer existing) destination. This patch fixes this by updating the peer's nsei field on BVC_RESET. Ticket: OW#874 Sponsored-by: On-Waves ehf
2013-10-24gbproxy: Add test for NSEI and NSVCI changesJacob Erlbeck1-0/+11
This checks the behavior of the gbproxy when the BSS peer changes the NSEI and the NSVCI. It also tests BVC_RESET and other UNITDATA messages after these changes between BSS and SGSN and vice versa (via the gbproxy). Ticket: OW#874 Sponsored-by: On-Waves ehf
2013-10-24gbproxy/vty: Enhance delete-gbproxy-peer commandJacob Erlbeck2-23/+115
This adds the option to delete all BVC peers and/or NS_VC with a given NSEI with a single command. Static (configured) NS-VC are not affected. In addition, all connections for this NSEI that can be deleted by this command can be listed without deleting them by appending 'dry-run' to the command. Sponsored-by: On-Waves ehf
2013-10-24gbproxy: Add a command to delete peers from the GBProxyHolger Hans Peter Freyther2-2/+27
This just deletes the peer entry based on NSEI and BVCI. The NS-VC are not touched.
2013-10-24gbproxy: Fix rate counter group leak in peer_free()Jacob Erlbeck1-0/+1
This also frees the counter group pointed to by peer->ctrg when the peer gets freed. Sponsored-by: On-Waves ehf
2013-10-19gbproxy: Reject SGSN UNITDATA messages with an invalid BVCIJacob Erlbeck1-5/+7
Currently such messages lead to a creation of a new peer with the SGSN's NSEI, which results in echoing the message back to the SGSN. This patch modifies this by sending a STATUS response (invalid BVCI) instead back to the SGSN. Sponsored-by: On-Waves ehf
2013-10-19gbproxy: Test invalid BVCI from SGSNJacob Erlbeck1-1/+35
This adds a test with a UNITDATA SGSN message that is addressed to an invalid (unknown) BVCI. The test shows, that the message is echoed to the SGSN. Sponsored-by: On-Waves ehf
2013-10-19gbproxy: Add global and per peer countersJacob Erlbeck1-6/+165
This adds counters that are incremented when errors are detected. It also modifies the VTY command 'show gbproxy' so that 'show gbproxy stats' shows the counters. Sponsored-by: On-Waves ehf
2013-10-19gbproxy: Fix warning and log messageJacob Erlbeck1-1/+2
Add the unused attribute to peer_free() that isn't used currently. Change 'RAC' to 'NSEI' in the log message, since the latter has been examined before the log message is generated. Sponsored-by: On-Waves ehf
2013-10-15gbproxy: Replace NS-VC references by NSEIJacob Erlbeck2-61/+65
Currently in most places in gb_proxy.c a reference to a NS-VC object is used where the peer is meant instead. The patch changes this by using the NSEI instead in these cases. Sponsored-by: On-Waves ehf
2013-10-15gbproxy: Add test program to test gbproxy message handlingJacob Erlbeck1-0/+23
This program tests the gbproxy implementation by passing NS messages to a modified gbproxy that dumps the resulting messages, signals, and state. It focusses on testing abnormal situations like port changes. Ticket: OW#874 Sponsored-by: On-Waves ehf
2013-09-02vty: Use generic 'end' and 'exit' commandsJacob Erlbeck2-6/+2
Add bsc_install_default() and replace all install_default() This patch adds bsc_install_default() which calls install_default() and add 'exit' and 'end'. All other calls to install_default() are replaced by calls to bsc_install_default(). Since 'exit' and 'end' are now added automatically to each node, the explicit registrations of these commands are removed by this patch, too. The related tests succeed now without work-arounds (except for the 'config' node itself which is part of libosmocore).
2013-07-31gprs_gmm: Avoid assertion in the sending code during routing area updateHolger Hans Peter Freyther1-1/+1
Use old and new tlli as specified by the caller. WIP <000f> sgsn_libgtp.c:321 Received DELETE PDP CTX CONF, cause=128(Request accepted) <0013> gprs_sndcp.c:320 SNSM-DEACTIVATE.ind (lle=0x8095d08, TLLI=e3ddd574, SAPI=11, NSAPI=5) <0011> gprs_bssgp.c:376 BSSGP TLLI=0xe3ddd574 Rx UPLINK-UNITDATA <0012> gprs_llc.c:551 LLC SAPI=1 C FCS=0xb85a96CMD=UI DATA <0011> gprs_bssgp.c:376 BSSGP TLLI=0xe3ddd574 Rx UPLINK-UNITDATA <0012> gprs_llc.c:551 LLC SAPI=1 C FCS=0xbe5a96CMD=UI DATA <0002> gprs_gmm.c:214 Starting MM timer 3350 while old timer 3350 pending <0012> gprs_llc.c:417 LLC TX: unknown TLLI 0xe3ddd574, creating LLME on the fly Assert failed msgb_tlli(msg) == mmctx->llme->tlli || msgb_tlli(msg) == mmctx->llme->old_tlli || tlli_foreign2local(msgb_tlli(msg)) == mmctx->llme->tlli || tlli_foreign2local(msgb_tlli(msg)) == mmctx->llme->old_tlli gprs_llc.c:123 backtrace() returned 18 addresses /home/ich/install/openbsc/lib/libosmocore.so.4(osmo_generate_backtrace+0x16) [0xb7bb6a36] /home/ich/source/gsm/openbsc/openbsc/src/gprs/osmo-sgsn() [0x805224a] /home/ich/source/gsm/openbsc/openbsc/src/gprs/osmo-sgsn() [0x804a2f6] /home/ich/source/gsm/openbsc/openbsc/src/gprs/osmo-sgsn() [0x804b687] /home/ich/source/gsm/openbsc/openbsc/src/gprs/osmo-sgsn() [0x804bc35] /home/ich/source/gsm/openbsc/openbsc/src/gprs/osmo-sgsn() [0x804bd4e] /home/ich/source/gsm/openbsc/openbsc/src/gprs/osmo-sgsn() [0x804d20c] /home/ich/source/gsm/openbsc/openbsc/src/gprs/osmo-sgsn() [0x8052be4] /home/ich/source/gsm/openbsc/openbsc/src/gprs/osmo-sgsn(bssgp_prim_cb+0x55) [0x804f5a4] /home/ich/install/openbsc/lib/libosmogb.so.2(bssgp_rcvmsg+0x3b8) [0xb7b626b8] /home/ich/source/gsm/openbsc/openbsc/src/gprs/osmo-sgsn() [0x804f4f1] /home/ich/install/openbsc/lib/libosmogb.so.2(gprs_ns_rcvmsg+0x8c7) [0xb7b5ecf7] /home/ich/install/openbsc/lib/libosmogb.so.2(+0x4311) [0xb7b5f311] /home/ich/install/openbsc/lib/libosmocore.so.4(osmo_select_main+0x192) [0xb7bb2ed2] /home/ich/source/gsm/openbsc/openbsc/src/gprs/osmo-sgsn() [0x804fbcd] /lib/i386-linux-gnu/i686/cmov/libc.so.6(__libc_start_main+0xf5) [0xb796a8f5] /home/ich/source/gsm/openbsc/openbsc/src/gprs/osmo-sgsn() [0x8049db1] Program received signal SIGABRT, Aborted. 0xb7fde424 in __kernel_vsyscall () (gdb) bt #0 0xb7fde424 in __kernel_vsyscall () #1 0xb797f83f in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56 #2 0xb7982cf3 in __GI_abort () at abort.c:90 #3 0x0805224f in _bssgp_tx_dl_ud (mmctx=0x80932d0, msg=0x80963a8) at gprs_llc.c:120 #4 gprs_llc_tx_ui (msg=0x80963a8, sapi=1 '\001', command=0, mmctx=0x80932d0) at gprs_llc.c:496 #5 0x0804a2f6 in gsm48_gmm_sendmsg (msg=0x80963a8, command=0, mm=0x80932d0) at gprs_gmm.c:241 #6 0x0804b687 in gsm48_tx_gmm_ra_upd_ack (mm=0x80932d0) at gprs_gmm.c:851 #7 0x0804bc35 in gsm48_rx_gmm_ra_upd_req (mmctx=0x80932d0, msg=0x8091ce8, llme=0x8095630) at gprs_gmm.c:1004 #8 0x0804bd4e in gsm0408_rcv_gmm (mmctx=0x80932d0, msg=0x8091ce8, llme=0x8095630) at gprs_gmm.c:1036 #9 0x0804d20c in gsm0408_gprs_rcvmsg (msg=msg@entry=0x8091ce8, llme=0x8095630) at gprs_gmm.c:1566 #10 0x08052be4 in gprs_llc_rcvmsg (msg=0x8091ce8, tv=0xbfffdcb0) at gprs_llc.c:882 #11 0x0804f5a4 in bssgp_prim_cb (oph=oph@entry=0xbfffdc8c, ctx=ctx@entry=0x0) at sgsn_main.c:114 #12 0xb7b626b8 in bssgp_rx_ul_ud (tp=0xbfffdcb0, msg=0x8091ce8, ctx=<optimized out>) at gprs_bssgp.c:398 #13 bssgp_rx_ptp (bctx=0x8091a08, tp=0xbfffdcb0, msg=0x8091ce8) at gprs_bssgp.c:820 #14 bssgp_rcvmsg (msg=0x8091ce8) at gprs_bssgp.c:1016 #15 0x0804f4f1 in sgsn_ns_cb (event=GPRS_NS_EVT_UNIT_DATA, nsvc=0x8090740, msg=0x8091ce8, bvci=1801) at sgsn_main.c:92 #16 0xb7b5ecf7 in gprs_ns_rx_unitdata (msg=0x8091ce8, nsvc=0x8090740) at gprs_ns.c:616 #17 gprs_ns_rcvmsg (nsi=nsi@entry=0x807fd38, msg=msg@entry=0x8091ce8, saddr=saddr@entry=0xbfffedc0, ll=ll@entry=GPRS_NS_LL_UDP) at gprs_ns.c:841 #18 0xb7b5f311 in handle_nsip_read (bfd=0x807fd58) at gprs_ns.c:991 #19 nsip_fd_cb (bfd=0x807fd58, what=1) at gprs_ns.c:1024 #20 0xb7bb2ed2 in osmo_select_main (polling=0) at select.c:158 #21 0x0804fbcd in main (argc=3, argv=0xbffff234) at sgsn_main.c:369 (gdb) frame 5 #5 0x0804a2f6 in gsm48_gmm_sendmsg (msg=0x80963a8, command=0, mm=0x80932d0) at gprs_gmm.c:241 241 return gprs_llc_tx_ui(msg, GPRS_SAPI_GMM, command, mm); (gdb) p msgb_tlli(msg) $1 = 3822966132 (gdb) frame 4 #4 gprs_llc_tx_ui (msg=0x80963a8, sapi=1 '\001', command=0, mmctx=0x80932d0) at gprs_llc.c:496 496 return _bssgp_tx_dl_ud(msg, mmctx); (gdb) p mmctx $2 = (void *) 0x80932d0 (gdb) frame 3 #3 0x0805224f in _bssgp_tx_dl_ud (mmctx=0x80932d0, msg=0x80963a8) at gprs_llc.c:120 120 OSMO_ASSERT(msgb_tlli(msg) == mmctx->llme->tlli (gdb) p mmctx $3 = (struct sgsn_mm_ctx *) 0x80932d0 (gdb) p *mmctx $4 = {list = {next = 0x8092e28, prev = 0x805c318 <sgsn_mm_ctxts>}, imsi = "901700000003094\000", mm_state = GMM_REGISTERED_NORMAL, p_tmsi = 296043751, p_tmsi_old = 2075232571, p_tmsi_sig = 0, imei = "353943044782210\000", msisdn = '\000' <repeats 14 times>, ra = {mnc = 70, mcc = 901, lac = 1, rac = 0 '\000'}, cell_id = 0, cell_id_age = 0, sac = 0, sac_age = 0, new_sgsn_addr = 0, ciph_algo = GPRS_ALGO_GEA0, ms_radio_access_capa = {len = 11 '\v', buf = "4\307\003*\240B|\255\341\030\v", '\000' <repeats 38 times>}, ms_network_capa = { len = 2 '\002', buf = "\345\200\000\000\000\000\000"}, drx_parms = 3329, mnrg = 0, ngaf = 0, ppf = 0, recovery = 0, radio_prio_sms = 0 '\000', pdp_list = {next = 0x8093390, prev = 0x8093390}, llme = 0x8095630, tlli = 3822966132, tlli_new = 3517269223, nsei = 1801, bvci = 1801, ctrg = 0x8096048, timer = {node = {rb_parent_color = 3082574944, rb_right = 0x0, rb_left = 0x0}, list = {next = 0x80933b8, prev = 0x80933b8}, timeout = { tv_sec = 1375260414, tv_usec = 864196}, active = 1, cb = 0x804bfd0 <mmctx_timer_cb>, data = 0x80932d0}, T = 3350, num_T_exp = 0, t3350_mode = GMM_T3350_MODE_RAU, t3370_id_type = 1 '\001'} (gdb) p msgb_tlli(msg) No symbol "msgb_tlli" in current context. (gdb) frame 5 #5 0x0804a2f6 in gsm48_gmm_sendmsg (msg=0x80963a8, command=0, mm=0x80932d0) at gprs_gmm.c:241 241 return gprs_llc_tx_ui(msg, GPRS_SAPI_GMM, command, mm); (gdb) frame 6 #6 0x0804b687 in gsm48_tx_gmm_ra_upd_ack (mm=0x80932d0) at gprs_gmm.c:851 851 return gsm48_gmm_sendmsg(msg, 0, mm); (gdb) p msgb_tlli(msg) $5 = 3822966132 (gdb) p mmctx->tlli No symbol "mmctx" in current context. (gdb) p mm->tlli $6 = 3822966132 (gdb) p mm->tlli_new $7 = 3517269223 (gdb) p mm->llme->tlli $8 = 3517269223 (gdb) p mm->llme->tlli_old There is no member named tlli_old. (gdb) p mm->llme->old_tlli $9 = 4222716219 (gdb) bt #0 0xb7fde424 in __kernel_vsyscall () #1 0xb797f83f in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56 #2 0xb7982cf3 in __GI_abort () at abort.c:90 #3 0x0805224f in _bssgp_tx_dl_ud (mmctx=0x80932d0, msg=0x80963a8) at gprs_llc.c:120 #4 gprs_llc_tx_ui (msg=0x80963a8, sapi=1 '\001', command=0, mmctx=0x80932d0) at gprs_llc.c:496 #5 0x0804a2f6 in gsm48_gmm_sendmsg (msg=0x80963a8, command=0, mm=0x80932d0) at gprs_gmm.c:241 #6 0x0804b687 in gsm48_tx_gmm_ra_upd_ack (mm=0x80932d0) at gprs_gmm.c:851 #7 0x0804bc35 in gsm48_rx_gmm_ra_upd_req (mmctx=0x80932d0, msg=0x8091ce8, llme=0x8095630) at gprs_gmm.c:1004 #8 0x0804bd4e in gsm0408_rcv_gmm (mmctx=0x80932d0, msg=0x8091ce8, llme=0x8095630) at gprs_gmm.c:1036 #9 0x0804d20c in gsm0408_gprs_rcvmsg (msg=msg@entry=0x8091ce8, llme=0x8095630) at gprs_gmm.c:1566 #10 0x08052be4 in gprs_llc_rcvmsg (msg=0x8091ce8, tv=0xbfffdcb0) at gprs_llc.c:882 #11 0x0804f5a4 in bssgp_prim_cb (oph=oph@entry=0xbfffdc8c, ctx=ctx@entry=0x0) at sgsn_main.c:114 #12 0xb7b626b8 in bssgp_rx_ul_ud (tp=0xbfffdcb0, msg=0x8091ce8, ctx=<optimized out>) at gprs_bssgp.c:398 #13 bssgp_rx_ptp (bctx=0x8091a08, tp=0xbfffdcb0, msg=0x8091ce8) at gprs_bssgp.c:820 #14 bssgp_rcvmsg (msg=0x8091ce8) at gprs_bssgp.c:1016 #15 0x0804f4f1 in sgsn_ns_cb (event=GPRS_NS_EVT_UNIT_DATA, nsvc=0x8090740, msg=0x8091ce8, bvci=1801) at sgsn_main.c:92 #16 0xb7b5ecf7 in gprs_ns_rx_unitdata (msg=0x8091ce8, nsvc=0x8090740) at gprs_ns.c:616 #17 gprs_ns_rcvmsg (nsi=nsi@entry=0x807fd38, msg=msg@entry=0x8091ce8, saddr=saddr@entry=0xbfffedc0, ll=ll@entry=GPRS_NS_LL_UDP) at gprs_ns.c:841 #18 0xb7b5f311 in handle_nsip_read (bfd=0x807fd58) at gprs_ns.c:991 #19 nsip_fd_cb (bfd=0x807fd58, what=1) at gprs_ns.c:1024 #20 0xb7bb2ed2 in osmo_select_main (polling=0) at select.c:158 #21 0x0804fbcd in main (argc=3, argv=0xbffff234) at sgsn_main.c:369 (gdb) frame 3 #3 0x0805224f in _bssgp_tx_dl_ud (mmctx=0x80932d0, msg=0x80963a8) at gprs_llc.c:120 120 OSMO_ASSERT(msgb_tlli(msg) == mmctx->llme->tlli (gdb) p msgb_tlli(msg) No symbol "msgb_tlli" in current context. (gdb) frame 4 #4 gprs_llc_tx_ui (msg=0x80963a8, sapi=1 '\001', command=0, mmctx=0x80932d0) at gprs_llc.c:496 496 return _bssgp_tx_dl_ud(msg, mmctx); (gdb) p msgb_tlli(msg) No symbol "msgb_tlli" in current context. (gdb) frame 5 #5 0x0804a2f6 in gsm48_gmm_sendmsg (msg=0x80963a8, command=0, mm=0x80932d0) at gprs_gmm.c:241 241 return gprs_llc_tx_ui(msg, GPRS_SAPI_GMM, command, mm); (gdb) p msgb_tlli(msg) $10 = 3822966132 (gdb) p mm->tlli $11 = 3822966132 (gdb) p mm->tlli_new $12 = 3517269223 (gdb) p mm->tlli_new $13 = 3517269223 (gdb) p mm->llme->tlli $14 = 3517269223 (gdb) p mm->llme->tlli_old There is no member named tlli_old. (gdb) p mm->llme->old_tlli $15 = 4222716219 (gdb) p mm->llme->state $16 = GPRS_LLMS_ASSIGNED (gdb) q
2013-07-31gprs_llc: Assert that we send frames with either tlli or old_tlliHolger Hans Peter Freyther1-15/+21
In case we have access to the context verify that the selected msgb_tlli is either the old_tlli or the tlli in either local or foreign format. It is wrong to use any other TLLI.
2013-07-31gprs_llc: Work on finding the right LLE/LLME in case of routing area updateHolger Hans Peter Freyther1-65/+94
Attempt to solve what f0901f0067e363c0ced6254db1b45a9771640412 tried to solve without breaking the case of someone with a foreign TLLI from a different network. Lookup with the foreign TLLI converted to a local one in case we did not find the TLLI and only then create a LLE/LLME on the fly for the RX path.
2013-07-31gprs_llc: Lookup lle based on the real TLLIHolger Hans Peter Freyther1-3/+1
During the GPRS Attach procedure we might have a foreign tlli and in the RX create a LLME on the fly for this tlli. The GMM GPRS Attach handling code will then assign a new TLLI and keep the foreign tlli as the llme->old_tlli. When the GMM is sending the identity request the msgb_tlli will point to the foreign tlli. The GPRS LLC code will then try to find that foreign tlli but due the conversion this will not be found. Instead a new ad-hoc LLE/LLME will be created on the fly for each message (this means there are duplicate LLE/LLMEs in the list). Make the code more strict and remove the tlli_foreign2local change from the look-up routine. This will make the GPRS LLC code find the right LLE/LLME and the N(U) will be handled correctly. This partially reverts: f0901f0067e363c0ced6254db1b45a9771640412 Addresses: <0012> gprs_llc.c:773 LLC RX: unknown TLLI 0xadf11820, creating LLME on the fly ... <0012> gprs_llc.c:357 LLC TX: unknown TLLI 0xedf11820, creating LLME on the fly Reproducable: Use pcu_emu (gprs attach) and observe with wireshark.
2013-07-31gprs_sgsn: In case of a Activate PDP Context timeout we should free pdpHolger Hans Peter Freyther1-0/+9
In case of a failure this method didn't set the pctx->lib back to NULL. In case of a timeout the callback will be made with pdp=NULL and this would lead to leaking the PDP context. Check for the case of having a pctx->lib != pdp and free it. This resolves: <000f> gprs_sgsn.c:259 freeing PDP context that still has a libgtp handle attached to it, this shouldn't happen!
2013-07-28gprs: Fix a typo in the commentHolger Hans Peter Freyther1-1/+1
2013-07-21sgsn: spelling fixes inside commentsHarald Welte2-3/+3
2013-07-21sgsn: Add "auth-policy" VTY command to enable/disable ACLHarald Welte2-1/+19
2013-07-21sgsn: add a minimalistic ACLHarald Welte3-2/+82
This adds a minimalistic ACL by which certain, individual roaming IMSIs can be authorized to use the SGSN. So you can selectively bypass the 'MCC+MNC == first 5 digits of IMSI' checking for a couple of IMSIs
2013-07-04sgsn: Fix the unimplemented/uninstalled show ggsn commandHolger Hans Peter Freyther1-7/+0
This is fixing a GCC and Coverity warning. GCC: sgsn_vty.c: At top level: sgsn_vty.c:308:1: warning: ‘show_ggsn_cmd’ defined but not used [-Wunused-variable] Coverity: CID 1040727
2013-07-04sgsn_vty: Fix uninitialized variable in the gprs_apn2str methodHolger Hans Peter Freyther1-1/+1
This is fixing a GCC and Coverity warning: GCC: sgsn_vty.c: In function ‘vty_dump_pdp’: sgsn_vty.c:64:5: warning: ‘i’ may be used uninitialized in this function [-Wmaybe-uninitialized] sgsn_vty.c:49:15: note: ‘i’ was declared here Coverity: CID 1040706
2013-07-04sgsn: Fix logically dead code in regard to the osmo_fd_registerHolger Hans Peter Freyther1-4/+9
The code was written like checking the return value of the osmo_fd_register but the rc variable was not assigned for the subsequent calls. Fixes: Coverity CID 1040741
2013-07-04sgsn: Fix lengths of MS Network Capability and MS Radio Access Capability ↵Alexander Chemeris1-4/+3
elements. Original code was inconsistent about lengths and could lead to out of bounds write. Lengths were also inconsistent with the TS 24.008. Fixes: Coverity CID 1040714.
2013-06-21GPRS LLC: Add non-standard method of sequence number recoveryHarald Welte1-1/+17
In some situations (like MS reboot without prior DETACH or SGSN reboot without prior MS detach), the LLC sequence numbers for UI mode could be different on both sides. The LLC spec unfortunately doesn't permit us to send something like a FRMR in this case, but instructs us to silently discard the frame. At that time the remote LLC entity will re-transmit the frame with the same seqeunce number over and over again, which we will drop again and again. The mthod used now will keep track of the last received UI sequence number. If that number is retransmitted for three times in a row, then we accept this sequence number and recover from that point on.
2013-06-12Makefile.am: Use AM_CPPFLAGSAlexander Huemer1-1/+1
Since automake 1.13 INCLUDES is depricates and causes a warning
2012-12-19misc: Fix compilation now that the method is located in libosmocoreHolger Hans Peter Freyther1-7/+0
These TLV helper functions are now located in libosmocore.
2012-11-21sms: Use the DLSMS instead of the DSMS category throughout our codeHolger Hans Peter Freyther1-6/+0
2012-09-11gbproxy: Address two unaligned memory access warningsHolger Hans Peter Freyther1-8/+14
The lines 461 and 303 were producing unaligned memory access as the BVCI was not aligned properly. Introduce a tlvp_val16_unal to read 16bit from the data, use memcpy to the stack to make sure that it is working in the aligned and unaligned case.
2012-08-17VTY: improve VTY prompt and make sure exit/end works everywhereHarald Welte2-2/+2
Some nodes below 'config' didn't have ournode_exit / ournode_end, and thus were not able to properly perform this function. exit should always only go back one level, while end drops us back to ENABLE_NODE. The prompt now represents the nesting level, and there's one consistent space after the final prompt character (typically #).
2012-08-03gb: suspend_ref was changed to a plain uint8_t, update the codeHolger Hans Peter Freyther1-1/+1
Require a 0.5.2+ libosmogb due the change of the suspend_ref type.
2012-07-28misc: Introduce a script tha generates the VTY referenceHolger Hans Peter Freyther1-24/+0
Update/Move/Create example configuration files for NiTB, BSC, MGCP, NAT and the GbProxy. Create a script that starts, generates the vty reference and terminates the application.
2012-07-14SGSN: Code to help debug / fix sgsn crash in cb_data_ind()Harald Welte2-1/+26
A crash was obsserved in cb_data_ind() when mm is dereferenced. This patch adds some safeguards that try to prevent the library handle back-pointer to the pdp_ctx to be NULL, and print a stack backtrace in case we are free() ing the sgsn-side pdp_ctx while there's still a library handle attached.
2012-07-14add some comments regarding the free() / release of pdp contextxHarald Welte2-0/+8
It might be that we're deleting structures instead of properly cleaning up the attached libgtp handles...
2012-07-04GPRS LLC: fix segfault when transmitting downlink unit-data without mmctxHarald Welte1-5/+10
2012-06-17use new external libosmogb (part of libosmocore.git)0.12.0Harald Welte1-6/+5
This removes the libgb (GPRS NS/BSSGP) code from the openbsc.git repository and uses the new version from libosmocore.git instead.
2012-06-17libgb: make sure all BSSGP functions have bssgp_ prefixHarald Welte4-6/+6
We change the minority of functions employing the gprs_bssgp_ prefix to match with the majority without gprs_ in front.
2012-06-17libgb/gprs: don't use log_info from libcommon anymoreHarald Welte2-4/+93
2012-06-17libgb: prefix all NS related functions with gprs_Harald Welte2-3/+3
2012-06-17libgb: don't call directly into GMM / LLC layerHarald Welte3-2/+35
Instead of direct function calls to individual functions, we now generate primitives (osmo_prim) and send them to one application-provided function "bssgp_prim_cb()"