aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/gprs/gprs_gmm.c
AgeCommit message (Collapse)AuthorFilesLines
2015-06-02sgsn: Simplify finding/using the first address of the resultHolger Hans Peter Freyther1-7/+2
The loop was used to print all returned addresses but we can simply pick the first one. This is fixing a coverity issue that the loop will be executed eaxactly once (and that was on purpose). Simplify the code and just take the first element (which might be NULL). Fixes: Coverity CID#1302852
2015-05-29ggsn: The id is a uint32_t don't print it as signedHolger Hans Peter Freyther1-1/+1
This was noticed as I started to use UINT32_MAX for dynamically created GGSNs.
2015-05-25sgsn: Allow to resolve the IPv4 address of a GGSN through DNSHolger Hans Peter Freyther1-10/+141
For real networks we need to check if the requested APN string is allowed and then resolve the GGSN address through DNS. There are countries with two or three digit MNCs and one could either try to keep a list of countries that have two/three digits or just try both of them. I have opted for the later for the ease of the implementation. C-Ares doesn't allow to cancel a request so we will need to have the MMCTX and the Lookup have different lifetimes. We simply set ->mmctx to NULL in case the MMCTX dies more early. The selected and verified apn_str will be copied into the out parameter. In case no static APN/GGSN config is present and the dynamic mode is enabled a request will be made.
2015-05-25sgsn: Create a copy of the msgb for later usageHolger Hans Peter Freyther1-3/+35
When needing to do an asynchronous DNS query we need to keep the TLV data around. So create a wrapper that takes a copy of it and frees it after the call. I can change the code to add an out parameter to decide if the msgb should be freed or not. Pick network failure in case the msgb could not be cloned in the hope the MS will retry then.
2015-05-25sgsn: Re-factor the activate PDP code for future changesHolger Hans Peter Freyther1-24/+39
A real SGSN will dynamically resolve the APN name into the GGSN IP Address. This means that after we have collected all information we need to start to resolve the GGSN and then can continue.
2015-05-24sgsn: Extract the hlr Number into the mm contextHolger Hans Peter Freyther1-0/+38
Include the hlr-Number of the subscriber in the CDR. This is useful for debugging and understanding which equipment was used during the test. In contrast to the MSISDN the '+' is emitted as the number must be in international format already.
2015-05-06sgsn: Add various signals consumed by CDR or other client codeHolger Hans Peter Freyther1-1/+30
2015-05-06sgsn: Extract the MSISDN from the subscr data structureHolger Hans Peter Freyther1-0/+34
In case there is a subscr attached to the MM context and there is an encoded MSISDN we will attempt to decode it and in case of an international number prepend a '+'. Assume that the array size of gsm_mmcc_called->number is as big as ctx->msisdn for the strncpy.
2015-02-06sgsn: Select GGSN based on APNJacob Erlbeck1-6/+7
Currently the APN IE in the Activate PDP Contex Request and the PDP data that is stored with the subscriber is ignored completely. This commit adds the sgsn_mm_ctx_find_ggsn_ctx that checks the APN IE against the subscriber's PDP data entries if both are present. If there is no match, the request is rejected. If an APN IE has not been included but PDP data entries are present, the function checks all of these entries against the static 'apn' configuration to find a suitable entry. If an APN has not been determined so far and any APN is allowed, the configuration is checked with an empty APN string, to allow for default configurations based on the IMSI prefix only. If nothing of this succeeded but the request wasn't rejected either, and there is no 'apn' configuration at all or if any APN is allowed but a default configuration ist not present, the GGSN with id 0 is used (if present). Otherwise the request is rejected ('missing APN'). Ticket: OW#1334 Sponsored-by: On-Waves ehf
2015-01-28sgsn: Add sgsn_mm_ctx_cleanup_free for safe shutdownJacob Erlbeck1-22/+2
Currently the MM context cleanup code is distributed over several functions. sgsn_mm_ctx_free not only frees data structure but also eventually stops the timer and does the subscriber clean-up. mm_ctx_cleanup_free (gprs_gmm.c) cleans up the PDP contexts and unassign the TLLI. This commit moves the cleanup code from both functions into a new unifying function sgsn_mm_ctx_cleanup_free that cares about the clean-up of all related sub-systems. Sponsored-by: On-Waves ehf
2015-01-26sgsn: Ensure 0-terminated imsi strings (Coverity)Jacob Erlbeck1-3/+3
Currently the size argument of strncpy is set to sizeof(mm->imsi) in some places. If the source IMSI string is too long, the terminating NUL byte in the static mm->imsi field gets overwritten. This patch limits the size to sizeof(mm->imsi)-1, so that the last byte of the buffer (that has been initialized to 0) is not overwritten. Fixes: Coverity CID 12065751, 12065754, 1206575 Sponsored-by: On-Waves ehf
2015-01-26sgsn: Remove inactive LLME/MM after inactivity timeoutJacob Erlbeck1-0/+6
Currently old LLMEs and MM contexts that haven't been explicitly detached or cancelled are not removed until another request with the same IMSI is made. These stale entries may accumulate over time and severely compromise the operation of the SGSN. This patch implements age based LLME expiry, when the maximum age has been reached, the corresponding MM context is cancelled. If such an MM context doesn't exist, the LLME is unassigned directly. The implementation works as follows. - llme->age_timestamp is reset on each received PTP LLC message - sgsn_llme_check_cb is invoked periodically (each 30s) - sgsn_llme_check_cb sets the age_timestamp to the current time if it has been reset - sgsn_llme_check_cb computes the age and expires the LLME if it exceeds gprs_max_time_to_idle() Ticket: OW#1364 Sponsored-by: On-Waves ehf [hfreyther: Fix typo in comment LMME -> LLME]
2015-01-26gprs: Use a macro value to set the 'Periodic RA update timer'Jacob Erlbeck1-2/+5
Currently the T3312 timer is directly set as encoded value when generating the Attach/RAU Accept messages. This patch adds GSM0408_T3312_SECS and uses it to set the information element's value. Sponsored-by: On-Waves ehf
2015-01-26gprs: Add 'Negotiated READY timer value' IE to Attach/RAU AcceptJacob Erlbeck1-2/+12
Currently this optional IE is omitted, so that the optional 'Requested READY timer value' of the corresponding Request message is used by the MS (or the default value if this IE is not used). This patch extends gsm48_tx_gmm_att_ack and gsm48_tx_gmm_ra_upd_ack to always include the IE set to the default value of T3312 (44s, see GSM 04.08, table 11.4a). Ticket: OW#1364 Sponsored-by: On-Waves ehf
2015-01-20sgsn: Add SGSN_ERROR_CAUSE_NONE and use it instead of 0Jacob Erlbeck1-2/+2
Currently an error_cause of 0 is being used to indicate normal operation. Albeit this is not a defined GMM cause, the value is not explicitly reserved. This commit adds the macro SGSN_ERROR_CAUSE_NONE and uses it for initialisation (instead of relying on talloc_zero) and comparisons. The value is set to -1 to be on the safe side. The VTY code is updated to set the error_cause when using the 'update-subscriber imsi IMSI update-location-result CAUSE' command. Sponsored-by: On-Waves ehf
2015-01-18sgsn: Pass subscriber error causes to the GMM layerJacob Erlbeck1-34/+31
This patch extends gsm0408_gprs_access_denied and gsm0408_gprs_access_cancelled to accept GMM cause codes. These are then passed to the MS, unless gsm0408_gprs_access_cancelled is called with cause 0 (no error -> updateProcedure). Since gsm0408_gprs_access_denied uses GMM_CAUSE_GPRS_NOTALLOWED if the cause is not set, and the subscriber's error_cause is never set (and thus always 0), the SGSN's behaviour does not change with this patch. Sponsored-by: On-Waves ehf Conflicts: openbsc/include/openbsc/gprs_sgsn.h [hfreyther: Conflict due the removal of the unused authenticate flag]
2015-01-18gprs: Move protocol value_strings to gsm_04_08_gprs.cJacob Erlbeck1-111/+8
Currently the mapping between GSM 04.08 (GPRS) protocol specific numbers and their textual description was put into gprs_gmm.c and not exported. This commit moves the mappings to a new file gsm_04_08_gprs.c, renames some of them, and exports them via gsm_04_08_gprs.h. The following identifiers are renamed to match the corresponding type names: - gmm_cause_names -> gsm48_gmm_cause_names - gsm_cause_names -> gsm48_gsm_cause_names Sponsored-by: On-Waves ehf
2014-12-23sgsn: Be more tolerant with state and SUSPEND/RESUMEJacob Erlbeck1-2/+4
Currently, when a BSSGP SUSPEND is received and the corresponding MM context is already in the state GMM_REGISTERED_SUSPENDED, a SUSPEND_NACK is returned which is not covered by GSM 08.18, 7.4.1. The same goes for RESUME in the state GMM_REGISTERED_NORMAL. This commit changes gprs_gmm_rx_suspend and gprs_gmm_rx_resume to not complain (and thus answer a NACK) when the MM context is either in GMM_REGISTERED_SUSPENDED or GMM_REGISTERED_NORMAL. Note that GSM 08.18, 7.4.1 and 7.5.1 only mention to send an NACK if the MS is not known. Even with this patch, the SGSN returns a NACK if either the MS is unknown _or_ the MM context ist not in one of the state GMM_REGISTERED_SUSPENDED and GMM_REGISTERED_NORMAL. Sponsored-by: On-Waves ehf
2014-12-10sgsn: Integrate Auth & Ciph into gsm48_gmm_authorizeJacob Erlbeck1-1/+27
Currently the Authentication and Ciphering procedure is not yet invoked by the GMM layer. This patch starts this procedure from within gsm48_gmm_authorize when the mm->auth_state has been set to SGSN_AUTH_AUTHENTICATE and a call to gsm0408_gprs_authenticate has been issued directly or indirectly by the call to sgsn_auth_request. Sponsored-by: On-Waves ehf
2014-12-09sgsn: Add gsm0408_gprs_access_cancelledJacob Erlbeck1-0/+27
This function is called to delete an established MM context silently without invoking a detach procedure. It is called when a subscriber is cancelled by the HLR. This generally happens, when an MS has moved to another routing area and has to use another SGSN. Sponsored-by: On-Waves ehf
2014-12-08sgsn: Do authentication based on SRES valuesJacob Erlbeck1-2/+32
Currently the SRES value in the Auth & Ciph Response is ignored. This patch checks the SRES value in response against the value stored in mm->auth_triplet.sres. If they don't match, an Auth & Ciph Reject message is sent to the MS. If they match, the mm->is_authenticated flag is set. Note that the procedure will not be started yet. Sponsored-by: On-Waves ehf
2014-12-08sgsn: Change Auth&Ciph timer handlingJacob Erlbeck1-5/+13
Currently mmctx_timer_start is called from within gsm48_tx_gmm_auth_ciph_req which differs from the way e.g. the identification procedure is implemented. It also makes it more difficult to restart the procedure after timeout, which is not implemented yet. In addition, the timer is not properly stopped when an AUTH & CIPH response is received. This patch removes this timer start from gsm48_tx_gmm_auth_ciph_req, adds the retransmission of Auth & Ciph requests to the timer callback function, and properly stops the timer in gsm48_rx_gmm_auth_ciph_resp. Sponsored-by: On-Waves ehf
2014-12-08sgsn: Fix and enable auth/ciph message generationJacob Erlbeck1-5/+2
Currently gsm48_tx_gmm_auth_ciph_req/_rej are commented out. In addition, gsm48_tx_gmm_auth_ciph_req uses a wrong encoding (two byte TV instead of two nibbles TV) of the CKSN information element. This patch fixes the encoding of the CKSN IE and enables the functions mentioned above. Sponsored-by: On-Waves ehf
2014-11-14sgsn: Remove explicit sgsn_instance parametersJacob Erlbeck1-1/+1
Currently the function in sgsn_auth.c either have an sgsn_config or an sgsn_instance parameter. Since then global sgsn variable is already being used in that file and since other parts of the SGSN related code also rely on a global sgsn singleton, these parameters pretend to provide a flexibility that is not really supported. Therefore this patch removes these parameters except for the ACL related functions, which do not call code that uses the sgsn variable. Sponsored-by: On-Waves ehf
2014-11-14sgsn: Refactor sgsn_auth to separate request and authorizationJacob Erlbeck1-1/+1
Currently the authorization is done in sgsn_auth_request for ACL based authorization. This doesn't match the way remote authorization would work, so that there is a second call to sgsn_auth_state already present in sgsn_auth_update. This patch removes the autorization check completely from sgsn_auth_request which in turn calls sgsn_auth_update directly now. Sponsored-by: On-Waves ehf
2014-11-14sgsn: Don't assign a new P-TMSI if one is pendingJacob Erlbeck1-4/+10
Currently every time an RA Update Req or an Attach Req is processed, a new P-TMSI is allocated. When an MS issues another of these messages before it has completed the first procedure, old_ptmsi is replaced by ptmsi (and thus lost) and ptmsi is replaced by the newly allocated P-TMSI. This can confuse the gbproxy, which can loose track of the logical link then. At least a Blackberry emits a double set of RA Upd Req messages from time to time which may be just 20ms apart. This patch adds a check whether mm->ptmsi or mm->old_ptmsi are set. If both are set, the P-TMSI is not re-allocated. This is only the case, when the Complete message has not been received yet, since that message will reset old_ptmsi. Sponsored-by: On-Waves ehf
2014-11-14sgsn: Don't send XID reset after Detach AcceptJacob Erlbeck1-2/+2
Currently when a Detach Accept is received for an unknown TLLI (which is in general the case afer the SGSN has requested the detachment), an XID reset is sent to the BSS, causing a BSSGP Status message. This happens in gsm0408_rcv_gmm. This patch moves the corresponding call to gprs_llgmm_reset downwards so that it is not being called in that case. Addresses: SGSN->BSS TLLI: 0xd75b91d9 SAPI: LLGMM, UI (DTAP) (GMM) Detach Request BSS->SGSN TLLI: 0xd75b91d9 SAPI: LLGMM, UI (DTAP) (GMM) Detach Accept SGSN->BSS TLLI: 0xd75b91d9 SAPI: LLGMM, U, XID (Reset, IOV-UI) BSS->SGSN TLLI: --- BSSGP STATUS (Unknown MS) Sponsored-by: On-Waves ehf
2014-11-14sgsn: Cleanup after RA Update Reject / Attach RejectJacob Erlbeck1-9/+49
Currently, the LLME is not cleaned up after sending an RA Update Reject. This happens after entering a routing area from outside, since in that case the SGSN sends an RA Update Reject (implicitly detached) which causes the MS to restart the attach procedure. The LLME is also not updated if an Attach Request with message errors (encoding, invalid MI type) is received or if an MM context cannot be allocated. This patch changes gsm48_rx_gmm_ra_upd_req and gsm48_rx_gmm_att_req to unassign the LLME or free the MM context (if available) after a Reject message has been sent. Ticket: OW#1324 Sponsored-by: On-Waves ehf
2014-11-14sgsn: Make authorization asynchronousJacob Erlbeck1-18/+60
Currently the authorization of an IMSI is done by checking ACLs synchronously which is not feasible when the subscriber data has to be retrieved from an external source. This patch changes this by using a callback when the information is available. This is also done when only ACL are checked, in this case the callback is invoked from within sgsn_auth_request(). The callback function sgsn_update_subscriber_data calls sgsn_auth_update which in turn calls either gsm0408_gprs_access_granted or gsm0408_gprs_access_denied. gsm48_gmm_authorize is extended by a call to sgsn_auth_request when IMSI and IMEI are available but the auth_state is unknown. The change has been successfully tested with single phones (E71 and IPhone 5c). Sponsored-by: On-Waves ehf
2014-11-14sgsn: Move IMSI authorization to gsm48_gmm_authorizeJacob Erlbeck1-13/+22
Currently the IMSI is only checked immediately when an Attach Request is received that contains an IMSI IE. If it contains a P-TMSI instead, access is always granted. This commit moves the IMSI check to gsm48_gmm_authorize where it is applied when IMSI and IMEI have been acquired. This fixes the authorization when the Attach Accept doesn't contain an IMSI. Sponsored-by: On-Waves ehf
2014-11-14sgsn: Fix LLME leak when forcing a reattachJacob Erlbeck1-8/+10
Currently when forceing a reattach by sending a Detach Request (reattach), the SGSN waits for the Detach Accept until it frees the MM context (if present) and the LLME. If that message gets lost or isn't sent by the MS, the LLME is never freed if it isn't bound to an MM context. This patch adds code to free the MM context/LLME when forcing a reattachment. Sponsored-by: On-Waves ehf
2014-11-14sgsn: Split gsm0408_gprs_force_reattach into 2 functionsJacob Erlbeck1-6/+11
This patch replaces gsm0408_gprs_force_reattach(msg, mmctx) by two functions - gsm0408_gprs_force_reattach(mmctx) - gsm0408_gprs_force_reattach_oldmsg(msg) The old function basically consists of the code of the two new functions, where the code path selected depends on mmctx == NULL, which is harder to maintain, less obvious to use, and not consistent with many other SGSN functions. Sponsored-by: On-Waves ehf
2014-11-14sgsn: Call mm_ctx_cleanup_free to deregister MM contextJacob Erlbeck1-7/+3
Currently the MM context isn't always removed when it is de-registered (mmctx_timer_cb), mm_state is set to GMM_DEREGISTERED instead. This can lead to left-over MM contexts which are only cleaned up if the MS reattaches. This patch replaces all of these assignments by a call to mm_ctx_cleanup_free. Ticket: OW#1324 Sponsored-by: On-Waves ehf
2014-11-14sgsn: Cleanup GMM state transitionsJacob Erlbeck1-6/+10
Currently the GMM state is set to GMM-REGISTERED when an Attach Accept or a RA Update Accept message is sent, even if a new P-TMSI is included. In this case 04.08 requires (see 4.7.3.1.3 and 4.7.5.1.3), that the state is set to GMM-COMMON-PROCEDURE-INITIATED when the Accept is sent. When the Complete is received, the SGSN shall set the state to GMM-REGISTERED. This patch modifies the state updates accordingly. Sponsored-by: On-Waves ehf
2014-11-14sgsn: Reorganize and fix gsm48_gmm_authorizeJacob Erlbeck1-16/+42
Currently the order of the 'if' clauses in gsm48_gmm_authorize doesn't match the order in which the conditional parts are entered. This makes it difficult to maintain. In addition the t3350_mode is not stored in every path, so that this information is lost when the identification procedure is started. Since the default value coincidentally is GMM_T3350_MODE_ATT, this doesn't hurt for Attach Requests which are the only messages that initially trigger the authentication yet. This patch changes the order of the 'if' clause to match the processing order, it removes the t3350_mode parameter entirely and introduces a mm->pending_req field. The latter must be set when the request that causes the authorization before calling gsm48_gmm_authorize. The gprs_t3350_mode enum is extended by GMM_T3350_MODE_NONE (value 0, which is the default) to make it possible to detect related initialisation errors or race conditions. Sponsored-by: On-Waves ehf
2014-11-05sgsn: Unassign the LLME after GMM Status without mmctxJacob Erlbeck1-1/+5
Currently the LLME is not deleted when a GMM Status message is received for which a mmctx cannot be found. This can fill the LLME list with unneeded entries. This patch adds code to unassign the LLME in that case. Ticket: OW#1324 Sponsored-by: On-Waves ehf
2014-11-05sgsn: Remove unused static functions from gprs_gmm.cJacob Erlbeck1-14/+2
The following functions are not being used: - gsm48_tx_gmm_status_oldmsg - gsm48_tx_sm_status_oldmsg This patch removes the function definitions. Sponsored-by: On-Waves ehf
2014-10-27sgsn: Handle Detach Requests even when there is no mmctxJacob Erlbeck1-11/+30
Currently, when a Detach Request is received with an unknown TLLI, it is answered by another Detach Request (!), even when a power_off Type is used. This patch uses gsm48_rx_gmm_det_req to handle the message instead. So this function is changed to cope with a NULL mmctx. In that case it doesn't unassign the llme, so this must be done manually afterwards. Sponsored-by: On-Waves ehf
2014-10-27sgsn: Only send Detach Accept (MO) if power_off isn't setJacob Erlbeck1-2/+6
Currently, every time the SGSN received a Detach Request from the MS via an established logical link, it is answered by a Detach Accept. This violates the specification (GSM 04.08, 4.7.4.1.2 and .3), which states, that it should only be sent, if "the detach type IE value indicates that the detach request has not been sent due to switching off". This patch adds a conditional to limit the sending of Detach Accept accordingly. Sponsored-by: On-Waves ehf
2014-10-27sgsn: Moved IMSI ACL management to sgsn_auth.cJacob Erlbeck1-1/+1
Currently the ACL code is located in sgsn_vty.c. This commit moves this to a new file sgsn_auth.c as a first step to make authorization more flexible in order to implement remote acquisition on subsciber data. Sponsored-by: On-Waves ehf
2014-10-27sgsn: Avoid duplicated Attach Accept messagesJacob Erlbeck1-0/+10
Currently each received Ident Resp triggers an Attach Accept/Reject if IMSI and IMEI are known. This has led to duplicated Attach Accept messages when used with the gbproxy (IMSI acquisition active) and with certain mobile equipment (iOS). This patch modifies gsm48_rx_gmm_id_resp to discard Ident Resp messages if all required information (IMEI and IMSI) has been gathered. Ticket: OW#1322 Sponsored-by: On-Waves ehf
2014-10-27sgsn: Send detach(re-attach) instead of gmm status if TLLI unknownJacob Erlbeck1-11/+121
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 patch adds the initiation of an MT detach procedure to force a re-attach to set up a valid LLE context if an LLE or an MM context cannot be found. Since this can also be triggered by non-GMM SAPI messages, a GPRS application callback sgsn_force_reattach_oldmsg is added which in turn calls the GMM layer to generate the GSM 04.08 specific messages. Note that the MS can be left in REGISTERED state after initially wanting to detach itself, since it will receive a Detach Req (re-attach) when sending a DEACT PDP CTX REQ 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
2014-10-27sgsn: Delete PDP contexts properlyJacob Erlbeck1-24/+30
Currently the PDP contexts are hard freed (via sgsn_pdp_ctx_free) at some places in gprs_gmm.c on the reception of a Detach Req and on re-use of an IMSI that is already associated with an MM context. This can lead to segfaults when there is a pending request or a data indication at libgtp. This patch add a new function sgsn_pdp_ctx_terminate that de-associates the PTP context from the MM context, deactivates SNDCP, sets pdp->mm to NULL and then calls sgsn_delete_pdp_ctx. sgsn_libgtp is updated to check for pdp->mm being non-NULL before dereferencing it. The sgsn_pdp_ctx_terminate function will be called for each PDP context of an MM context before this context is going to be deleted via sgsn_mm_ctx_free. To ensure, that the ctx->llme (which is accessed during the deactivation of SNDCP) remains valid, the call to gprs_llgmm_assign is moved after the call to sgsn_mm_ctx_free. The handling of re-used IMSIs is changed to mimic the processing of a Detach Req. Addresses: <0002> gprs_gmm.c:654 MM(/f6b31ab0) Deleting old MM Context for same IMSI p_tmsi_old=0xc6f19134 <000f> gprs_sgsn.c:259 PDP freeing PDP context that still has a libgtp handle attached to it, this shouldn't happen! [...] SEGFAULT Ticket: OW#1311 Sponsored-by: On-Waves ehf
2014-10-09sgsn: Free MM context after receiving a Detach RequestJacob Erlbeck1-0/+4
On a Detach/Re-attach cycle the Address Sanitizer detected a use-after-free kind of problem. That is because we tried to destroy the LLME twice. The first time it is destroyed as part of the Detach handling ans the second time it is destroyed as part of destroying the old MM context. In case the GPRS GMM detach message is lost the SGSN needs to reply besides not having a MM entry. The alternative would have been to add NULL checks for all usages of ctx->llme which would not have helped with the readability. Sponsored-by: On-Waves ehf
2014-09-25gprs: Move log message about mm context after NULL checkDaniel Willmann1-3/+3
Fixes: CID#1240205
2014-09-22gprs: Improve loglevels and log messages for SGSNDaniel Willmann1-54/+53
Many log levels were DEBUG without any good reason. Also where possible the details of the MM or PDP context are now logged with LOGMM/PDPCTXP.
2014-07-22gprs: Use imsi field instead of imeiJacob Erlbeck1-1/+1
The wrong field has been use for the field length computation. This hadn't any impact so far, since sizeof(ctx->imei) == sizeof(ctx->imsi) This patch fixes the computation to use the right field. Sponsored-by: On-Waves ehf
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
2013-07-21sgsn: spelling fixes inside commentsHarald Welte1-2/+2