aboutsummaryrefslogtreecommitdiffstats
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2019-05-07Bump version: 1.0.1.143-cc72c → 1.1.01.1.0Pau Espin Pedrol5-5/+5
Change-Id: I351411ca5913c8b40f23287ec7c9ebfe11bd2bb0
2019-05-07add osmo_stat_item_inc/osmo_stat_item_dec to set it relativeAlexander Couzens1-0/+24
Change-Id: Id2462c4866bd22bc2338c9c8f69b775f88ae7511
2019-05-05add gsm0808_create_handover_request_ack2 to add AoIP RTP addrNeels Hofmeyr2-9/+37
osmo-bsc so far omits the AoIP Transport Layer Address from its Handover Request Acknowledge message, which breaks inter-BSC Handover for AoIP. Allow fixing that. One quirk I really don't like about this: I would prefer to directly use struct sockaddr_storage as a member of the struct gsm0808_handover_request_ack. Even though struct sockaddr_storage appears in various function signatures, the gsm0808.c actually also gets built on embedded systems that lack arpa/inet.h (for me indicated by the ARM build job on jenkins). Compiling gsm0808.c works only because the actual coding of struct sockaddr_storage is implemented in gsm0808_util.c, which (apparently) does not get built on embedded and hence, even though there are undefined references to e.g. gsm0808_enc_aoip_trasp_addr() it works. Related: I4a5acdb2d4a0b947cc0c62067a67be88a3d467ff (osmo-bsc) Change-Id: Ia71542ea37d4fd2c9fb9b40357db7aeb111ec576
2019-05-05osmo_gsup_decode(): properly check IMSI, avoid deprecationNeels Hofmeyr1-3/+5
In osmo_gsup_decode(), call gsm48_decode_bcd_number2() to avoid deprecation warning, and also actually check the return value to detect invalid IMSI IEs. Change-Id: Iaded84d91baad5386c8f353c283b6b9e40a43b05
2019-05-05gsm48_decode_bcd_number2(): allow avoiding deprecationNeels Hofmeyr1-23/+25
gsm48_decode_bcd_number() is marked as deprecated, so gsm48_decode_bcd_number2() will cause deprecation warnings as long as it calls gsm48_decode_bcd_number(). Hence move the code to gsm48_decode_bcd_number2(). Change-Id: I81925e9afb3451de9b8a268d482f79ee20ca14d6
2019-05-05gsm48_decode_bcd_number2(): fix input len checkNeels Hofmeyr1-2/+3
The input_len argument for gsm48_decode_bcd_number2() includes the BCD length *and* the length byte itself, so add the missing +1. Also clarify the API doc for the input_len argument. Change-Id: I87599641325c04aae2be224ec350b1a145039528
2019-05-03add vty_is_active()Neels Hofmeyr1-0/+10
For async callbacks it is useful to determine whether a given VTY pointer is still valid. For example, in osmo-msc, a silent call can be triggered by VTY, which causes a Paging. The paging_cb then writes to the VTY console that the silent call has succeeded. Unless the telnet vty session has already ended, in which case osmo-msc crashes; e.g. from an osmo_interact_vty.py command invocation. With this function, osmo-msc can ask whether the vty pointer passed to the paging callback is still active, and skip vty_out() if not. Change-Id: I42cf2af47283dd42c101faae0fac293c3a68d599
2019-05-03add gsm48_decode_bcd_number2() from osmo-mscNeels Hofmeyr2-1/+28
gsm48_decode_bcd_number() is unable to provide proper bounds validation of input and output data, hence osmo-msc's vlr.c introduced a static decode_bcd_number_safe() a long time ago. Move to libosmocore. I need to use the same function to decode an MSISDN during inter-MSC Handover, instead of making it public in osmo-msc, rather deprecate the unsafe function and provide a safer version for all callers. Mark the old one deprecated. Change-Id: Idb6ae6e2f3bea11ad420dae14d021ac36d99e921
2019-05-03BSSMAP: add messages for inter-BSC and inter-MSC HandoverNeels Hofmeyr2-0/+175
Change-Id: I9dac375331f6bea744769e973725d58e35f87226
2019-04-26BSSMAP: tweaksNeels Hofmeyr1-2/+2
Change two instances of Speech Version values to enum gsm0808_permitted_speech. It is often not trivial to find the right values for a uint8_t member, giving the enum name makes it a lot easier/safer to use. In gsm0808_create_handover_required(), use msgb_tv_put() so that the enum's storage size doesn't matter. (Already used for handover_performed) Fix typo in doc of gsm0808_create_handover_required(). Change-Id: I6387836bab76e1fa42daa0f42ab94fc14b70b112
2019-04-26GSUP: add inter-MSC handover related msgs and IEsOliver Smith1-0/+127
Based on a draft created by Neels, which is the result of reading a MAP trace of two MSCs negotiating inter-MSC handovers, and of reading the TS 29.002, TS 29.010 and related specs: https://lists.osmocom.org/pipermail/openbsc/2019-January/012653.html I figured out that the "Handover Number" mentioned in the specifications is the same as the MSISDN IE that we already have, so we can use that instead of creating a new IE (example usage in tests/gsup/gsup_test.c). Create a new OSMO_GSUP_MSGT_E_ROUTING_ERROR message type, which the GSUP server uses to tell a client that its message could not be forwarded to the destination (see [1]). MAP has no related message. [1]: Change-Id: Ia4f345abc877baaf0a8f73b8988e6514d9589bf5 (osmo-hlr.git) Related: OS#3774 Change-Id: Ic00b0601eacff6d72927cea51767801142ee75db
2019-04-25bitcomp.c: fix missing Doxygen group closing tagVadim Yanitskiy1-1/+1
Change-Id: I01f837ac4c8644c0851c77c3f42eb44353cef0d7
2019-04-25application.c: drop wrong \references of osmo_init_ignore_signals()Vadim Yanitskiy1-1/+1
Change-Id: Ib08e15dd5d811662de46a1dfdb676b9a5b66b529
2019-04-13GSUP: add Message Class IENeels Hofmeyr2-0/+19
osmo-msc and osmo-hlr have distinct subsystems handling incoming GSUP messages. So far we decide entirely by message type which code path should handle a GSUP message. Thus no GSUP message type may be re-used across subsystems. If we add a GSUP message to indicate a routing error, it would have to be a distinct message type for subscriber management, another one for SMS, another one for USSD... To allow introducing common message types, introduce a GSUP Message Class IE. In the presence of this IE, GSUP handlers can trivially direct a received message to the right code path. If it is missing, handlers can fall back to the previous switch(message_type) method. Change-Id: Ic397a9f2c4a7224e47cab944c72e75ca5592efef
2019-04-12gsm/gsm_utils.c: indicate intentional fall-throughVadim Yanitskiy1-0/+1
Change-Id: Ica7d2d1884b745fe30234d6c50d93828c4930680 Fixes: CID#57700
2019-04-12gb/gprs_ns_sns.c: fix incorrect sizeof() calculationVadim Yanitskiy1-1/+1
Calling sizeof() on a pointer would result in getting size of the pointer (usually 4 or 8 bytes) itself, but not the size of the memory it points to. Change-Id: I83f55a9638b75d9097d37992f7c84707791f10f6 Fixes: CID#194266
2019-04-12Fix incorrect buffer size calculationVadim Yanitskiy3-11/+16
Calling sizeof() on a pointer to dynamically allocated memory would result in getting size of the pointer (usually 4 or 8 bytes) itself, but not the size of allocated memory. Change-Id: I8ffda4dea2b7f9b4b76dfeecad1fab6384c5a62c Fixes: CID#197629, CID#197628, CID#197627 Fixes: CID#197626, CID#197625, CID#197624
2019-04-12add identifier sanitation for setting FSM instance idsNeels Hofmeyr2-2/+51
We often compose FSM instance IDs from context information, for example placing an MSISDN string or IP:port information in the FSM instance id, using osmo_fsm_inst_update_id_f(). This fails if any characters are contained that don't pass osmo_identifier_valid(). Hence it is the task of the caller to make sure only characters allowed in an FSM id are applied. Provide API to trivially allow this by replacing illegal chars: - osmo_identifier_sanitize_buf(), with access to the same set of illegal characters defined in utils.c, - osmo_fsm_inst_update_id_f_sanitize() implicitly replaces non-identifier chars. This makes it easy to add strings like '192.168.0.1:2342' or '+4987654321' to an FSM instance id, without adding string mangling to each place that sets an id; e.g. replacing with '-' to yield '192-168-0-1:2342' or '-4987654321'. Change-Id: Ia40a6f3b2243c95fe428a080b938e11d8ab771a7
2019-04-12add osmo_{escape,quote}_str_buf2() for standard args orderingNeels Hofmeyr1-39/+95
To be able to append an escaped or quoted string using OSMO_STRBUF_APPEND_NOLEN(), the function signature must have the buf and len as first args, like most other *_buf() functions. Add osmo_escape_str_buf2() and osmo_quote_str_buf2() to match this signature. A recent patch [1] has changed the return value of osmo_escape_str_buf() to char*, removing the const. However, the functions may return const strings, hence re-add the const. The new signatures always return the non-const buffer. To avoid code duplication, implement osmo_quote_str_buf() and osmo_escape_str_buf() by calling the new functions. I decided to allow slight changes to the behavior for current osmo_escape_str() and osmo_escape_str_buf(), because impact on callers is minimal: (1) The new implementation uses OSMO_STRBUF_*, and in consequence osmo_quote_str() no longer prints an ending double quote after truncated strings; Before, a truncated output was, sic: "this string is trunca" and now this becomes, sic: "this string is truncat I decided to not keep the old behavior because it is questionable to begin with. It looks like the string actually ended at the truncation boundary instead of the reason being not enough space in the output buffer. (2) The new osmo_escape_str_buf2() function obviously cannot pass-thru an unchanged char* if no escaping was needed. Sacrifice this tiny optimization feature to avoid code duplication: - it is an unnoticeable optimization, - the caller anyway always passes a string buffer, - the feature caused handling strings and buffers differently depending on their content (i.e. code that usually writes out strings in full length "suddenly" truncates because a non-printable character is contained, etc.) I considered adding a skip_if_unescaped flag to the osmo_quote_str_buf2() function signature, but in the end decided that the API clutter is not worth having for all the above reasons. Adjust tests to accomodate above changes. [1] 4a62eda225ab7f3c9556990c81a6fc5e19b5eec8 Ibf85f79e93244f53b2684ff6f1095c5b41203e05 Change-Id: Id748b906b0083b1f1887f2be7a53cae705a8a9ae
2019-04-11add osmo_str_startswith()Neels Hofmeyr2-11/+15
Move from a static implementation in tdef_vty.c to utils.c, I also want to use this in osmo-msc. The point is that the telnet VTY allows unambiguous partly matches of keyword args. For example, if I have a command definition of: compare (apples|oranges) then it is perfectly legal as for the vty parser to write only compare app One could expect the VTY to then pass the unambiguous match of "apples" to the parsing function, but that is not the case. Hence a VTY function implementation is faced with parsing a keyword of "app" instead of the expected "apples". This is actually a very widespread bug in our VTY implementations, which assume that exactly one full keyword will always be found. I am now writing new commands in a way that are able to manage only the starts of keywords. Arguably, strstr(a, b) == a does the same thing, but it searches the entire string unnecessarily. Change-Id: Ib2ffb0e9a870dd52e081c7e66d8818057d159513
2019-04-11make osmo_sockaddr_str_is_set() NULL-safeNeels Hofmeyr1-1/+2
Obviously a NULL pointer should return false instead of segfaulting. Change-Id: Iac025cf4d556cbed99f3924cd9ca05a05881cd9a
2019-04-11fsm: support graceful osmo_fsm_inst_term() cascadesNeels Hofmeyr1-6/+142
Add global flag osmo_fsm_term_safely() -- if set to true, enable the following behavior: Detect osmo_fsm_inst_term() occuring within osmo_fsm_inst_term(): - collect deallocations until the outermost osmo_fsm_inst_term() is done. - call osmo_fsm_inst_free() *after* dispatching the parent event. If a struct osmo_fsm_inst enters osmo_fsm_inst_term() while another is already within osmo_fsm_inst_term(), do not directly deallocate it, but talloc-reparent it to a separate talloc context, to be deallocated with the outermost FSM inst. The effect is that all osmo_fsm_inst freed within an osmo_fsm_inst_term() cascade will stay allocated until all osmo_fsm_inst_term() are complete and all of them will be deallocated at the same time. Mark the deferred deallocation state as __thread in an attempt to make cascaded deallocation handling threadsafe. Keep the enable/disable flag separate, so that it is global and not per-thread. The feature is showcased by fsm_dealloc_test.c: with this feature, all of those wild deallocation scenarios succeed. Make fsm_dealloc_test a normal regression test in testsuite.at. Rationale: It is difficult to gracefully handle deallocations of groups of FSM instances that reference each other. As soon as one child dispatching a cleanup event causes its parent to deallocate before fsm.c was ready for it, deallocation will hit a use-after-free. Before this patch, by using parent_term events and distinct "terminating" FSM states, parent/child FSMs can be taught to wait for all children to deallocate before deallocating the parent. But as soon as a non-child / non-parent FSM instance is involved, or actually any other cleanup() action that triggers parent FSMs or parent talloc contexts to become unused, it is near impossible to think of all possible deallocation events ricocheting, and to avoid running into freeing FSM instances that were still in the middle of osmo_fsm_inst_term(), or FSM instances to enter osmo_fsm_inst_term() more than once. This patch makes deallocation of "all possible" setups of complex cross referencing FSM instances easy to handle correctly, without running into use-after-free or double free situations, and, notably, without changing calling code. Change-Id: I8eda67540a1cd444491beb7856b9fcd0a3143b18
2019-04-11fsm: add flag to ensure osmo_fsm_inst_term() happens only onceNeels Hofmeyr1-0/+6
To prevent re-entering osmo_fsm_inst_term() twice for the same osmo_fsm_inst, add flag osmo_fsm_inst.proc.terminating. osmo_fsm_inst_term() sets this to true, or exits if it already is true. Update fsm_dealloc_test.err for illustration. It is not relevant for unit testing yet, just showing the difference. Change-Id: I0c02d76a86f90c49e0eae2f85db64704c96a7674
2019-04-11gsm_utils.c: fix Doxygen description for gsm_get_octet_len()Vadim Yanitskiy1-4/+4
Change-Id: Id6fd2cd33be1cb7cd7ff6a43bfcfb1f368304522
2019-04-11vty/talloc_ctx_vty.c: use REG_NOSUB flag of regcomp()Vadim Yanitskiy1-1/+1
We don't need to know position of matches: just yes or no. This change would save some computation power. Change-Id: Id55ffe64cc1a35dd83f61dbb0f9828aa676696f9
2019-04-11vty/talloc_ctx_vty.c: allocate walk_cb_params on stack, not heapVadim Yanitskiy1-43/+15
There is no need to allocate struct 'walk_cb_params' dynamically. Change-Id: I96f25f1ddb36b19b12055deaeeb6f58e59180e72
2019-04-10Add _c versions of functions that otherwise return static buffersHarald Welte14-11/+419
We have a habit of returning static buffers from some functions, particularly when generating some kind of string values. This is convenient in terms of memory management, but it comes at the expense of not being thread-safe, and not allowing for two calls of the related function within one printf() statement. Let's introduce _c suffix versions of those functions where the caller passes in a talloc context from which the output buffer shall be allocated. Change-Id: I8481c19b68ff67cfa22abb93c405ebcfcb0ab19b
2019-04-08add osmo_use_count APINeels Hofmeyr2-0/+280
Provide a common implementation of use counting that supports naming each user as well as counting more than just one use per user, depending on the rules the caller implies. In osmo-msc, we were originally using a simple int counter to see whether a connection is still in use or should be discarded. For clarity, we later added names to each user in the form of a bitmask of flags, to figure out exactly which users are still active: for logging and to debug double get / double put bugs. This however is still not adequate, since there may be more than one CM Service Request pending. Also, it is a specialized implementation that is not re-usable. With this generalized implementation, we can: - fix the problem of inadequate counting of multiple concurrent CM Service Requests (more than one use count per user category), - directly use arbitrary names for uses like __func__ or "foo" (no need to define enums and value_string[]s), - re-use the same code for e.g. vlr_subscr and get fairly detailed VLR susbscriber usage logging for free. Change-Id: Ife31e6798b4e728a23913179e346552a7dd338c0
2019-04-08add osmo_sockaddr_str APINeels Hofmeyr2-1/+381
For handling RTP IP addresses and ports, osmo-mgw, osmo-bsc and osmo-msc so far have their own separate shims and code duplication around inet_ntoa(), htons(), sockaddr conversions etc. Unify and standardize with this common API. In the MGW endpoint FSM that was introduced in osmo-bsc and which I would like to re-use for osmo-msc (upcoming patch moving that to osmo-mgw), it has turned out that using char* IP address and uint16_t port number types are a convenient common denominator for logging, MGCP message composition and GSM48. Ongoing osmo-msc work also uses this for MNCC. This is of course potentially useful for any other IP+port combinations besides RTP stream handling. Needless to say that most current implementations will probably stay with their current own conversion code for a long time; for current osmo-{bsc,msc,mgw} work (MGW endpoint FSM) though, I would like to move to this API here. Change-Id: Id617265337f09dfb6ddfe111ef5e578cd3dc9f63
2019-04-08gsm_utils: fix use buf_len instead of sizeof in osmo_dump_gsmtime_bufPhilipp Maier1-1/+1
The function osmo_dump_gsmtime_buf gets a pointer *buf and a parameter buf_len. The pointer *buf is a string buffer and the function places an \0 at the end of the buffer before it exists. However it uses sizeof(buf) as part of the index calculation, which is incorrect. Lets correct this by using buf_len instead. Change-Id: Id24263aa7c9a53544f1639b6ceb09ce5615d5114
2019-04-03Add _buf() functions to bypass static string buffersHarald Welte13-117/+337
We have a number of static buffers in use in libosmo*. This means the related functions are not usable in a thread-safe way. While we so far don't have many multi-threaded programs in the osmocom universe, the static buffers also prevent us from calling the same e.g. string-ify function twice within a single printf() call. Let's make sure there's an alternative function in all those cases, where the user can pass in a caller-allocated buffer + size, and make the 'classic' function with the static buffer a wrapper around that _buf() variant. Change-Id: Ibf85f79e93244f53b2684ff6f1095c5b41203e05
2019-03-29osmo_escape_str_buf: Always copy, don't return input string pointerHarald Welte1-19/+8
osmo_escape_str_buf() used to have the somewhat odd semantics that if no escaping was needed, it would return the original pointer without making any copy to the output buffer. While this seems like an elegant optimization, it is a very strange behavior and it works differently than all of our other *_buf() functions. Let's unify the API and turn osmo_escape_str_buf() into a strlcpy() if no escaping is needed. Change-Id: I3a02bdb27008a73101c2db41ac04248960ed4064
2019-03-28ipa: Fix ipa_ccm_id_resp_parse on big endian systemsPau Espin Pedrol1-2/+2
Change-Id: Iedc46ab53a4f76bbd98741c065fad3d9042a34a4
2019-03-28ipa: Document ipa_ccm_idtag_parse_off and fix ipa_ccm_idtag_parsePau Espin Pedrol1-1/+11
ipa_ccm_idtag_parse_off is broken, and can only be used with len_offset=1 on ID Request messages, otherwise won't work correctly. Modify ipa_ccm_idtag_parse to at least parse those correctly, and document the limitations. Those two functions are already deprecated and only used in openbsc by 3 callers: * ipa_ccm_idtag_parse in ussd_read_cb(): Broken, that function can only work for Requests and it's used to parse a Response. * ipa_ccm_idtag_parse_off in forward_sccp_to_msc (NAT): Broken, it can only be used to parse Requests and it's used to parse a Response. Furthermore, len_offset=2 is passed which makes no sense and most probably it fails always, or can even make the program crash. * ipa_ccm_idtag_parse_off in (answer_challenge): This one is fine and could actually be replaced with ipa_ccm_id_get_parse after this commit is merged. Change-Id: I6efc852dfc041192f554e41a58290a0f63298021
2019-03-28src/gsmtap_util.c: fix possible memleak in gsmtap_source_init()Vadim Yanitskiy1-0/+1
In gsmtap_source_init() we dynamically allocate a gsmtap_inst struct, but don't free it if the subsequent call to osmo_fd_register() fails. Change-Id: I970b493f3a64fbe9c3f68fcfba5097ee3ff72960
2019-03-28BSSGP: use variable for NSEIMax1-26/+27
Handle NSEI the same way as BVCI is handled: assign it to variable instead of repetitive calls to msgb_nsei() - this simplifies log update in follow-up patches and makes code slightly easier to read. Change-Id: I919a717ca22646849d6ec7f62c677c536db0ed31
2019-03-27logging_gsmtap.c: document all params of log_target_create_gsmtap()Vadim Yanitskiy1-0/+4
Change-Id: Id7bd6b4fb4be571af351f77aa4a59b9e1076434f
2019-03-27Doxygen: fix documentation of osmo_timer_setup()Vadim Yanitskiy1-2/+2
This change fixes the following Doxygen warnings: timer.c:69: warning: argument 'callback' of command @param is not found in the argument list of osmo_timer_setup(struct osmo_timer_list *timer, void(*cb)(void *data), void *data) timer.c:69: warning: argument 'pointer' of command @param is not found in the argument list of osmo_timer_setup(struct osmo_timer_list *timer, void(*cb)(void *data), void *data) core/timer.h:70: warning: The following parameters of osmo_timer_setup(struct osmo_timer_list *timer, void(*cb)(void *data), void *data) are not documented: parameter 'cb' parameter 'data' Change-Id: If5668f40a7bfde2f4f22329a071c8c6eff23b99e
2019-03-27src/rate_ctr.c: drop some incorrect \ref referencesVadim Yanitskiy1-3/+3
rate_ctr.c:411: warning: unable to resolve reference to `handle_group' for \ref command rate_ctr.c:208: warning: unable to resolve reference to `talloc' for \ref command Change-Id: I24a80ff6cf11ce0455529515d1ecb9900f0271a8
2019-03-27Doxygen: fix documentation of rate_ctr_for_each_counter()Vadim Yanitskiy1-1/+1
Doxygen was confused by duplicated documentation for both definition and declaration of rate_ctr_for_each_counter(). Moreover, both variants contained some mistakes. Let's avoid this duplication and keep the only (corrected) one. Change-Id: Icca2d4a95bd5f96ae85a86909ec90fb8677cacf3
2019-03-27src/msgb.c: fix Doxygen documentation for msgb_printf()Vadim Yanitskiy1-2/+3
This change fixes the following Doxygen warnings: src/msgb.c:479: warning: argument 'msg' of command @param is not found in the argument list of msgb_printf(struct msgb *msgb, const char *format,...) core/msgb.h:708: warning: The following parameters of msgb_printf(struct msgb *msgb, const char *format,...) are not documented: parameter 'msgb' parameter 'format' As a bonus, it dot-terminates all sentences. Change-Id: Ib708664336eef06f748d408ae02a13c754b6647a
2019-03-27src/logging.c: fix syntax errors in Doxygen documentationVadim Yanitskiy1-7/+7
This change should fix the following warnings: logging.c:956: warning: unable to resolve reference to `talloc' for \ref command logging.c:203: warning: argument 'in' of command @param is not found in the argument list of log_level_str(unsigned int lvl) logging.c:194: warning: argument 'in' of command @param is not found in the argument list of log_parse_level(const char *lvl) logging.c:708: warning: argument 'print_catname' of command @param is not found in the argument list of log_set_print_category(struct log_target *target, int print_category) logging.c:687: warning: argument 'print_filename' of command @param is not found in the argument list of log_set_print_filename2(struct log_target *target, enum log_filename_type lft) logging.c:729: warning: argument 'print_catname' of command @param is not found in the argument list of log_set_print_level(struct log_target *target, int print_level) logging.c:893: warning: argument 'in' of command @param is not found in the argument list of log_target_destroy(struct log_target *target) Change-Id: I85f6c70216b7574b49b90bb1469869a47f721713
2019-03-25Revert "ipa_ccm_idtag_parse*: Fix reported length value"Oliver Smith1-1/+1
This reverts commit 1261db15058cfa94615f26c1083bb8a38d09218b. The patch broke openbsc's external tests, and currently it is unclear whether it is just an error in the test or if openbsc makes wrong assumptions about the length value. Let's revert the patch to unblock the master-openbsc jenkins job. Related: OS#3851 Change-Id: I9adea35ff6de36c1611c7f85dde1b15bc1c0e786
2019-03-25Doxygen: fix incorrect / missing parameter descriptionVadim Yanitskiy2-4/+4
Change-Id: Ibc63a5d4442a192efab8b5b30e0beb3545642ecc
2019-03-22Revert "signal.c: Make non-exported tall_sigh_ctx static"Oliver Smith1-1/+1
This reverts commit cff2242e686be9ac19ba5757a710bc769a9201ec. The patch broke openbsc: ../../src/libcommon/libcommon.a(talloc_ctx.o): In function `talloc_ctx_init': /build/openbsc/src/libcommon/talloc_ctx.c:50: undefined reference to `tall_sigh_ctx' See also: https://lists.osmocom.org/pipermail/openbsc/2019-March/012843.html Change-Id: Ib4cb31427a1cad063bc9f1a10b9c3182b314a9f2
2019-03-21signal.c: Make non-exported tall_sigh_ctx staticHarald Welte1-1/+1
As indicated in the commitlog of Id58ca18eb826b8f4183a7cf0dbb2b38cba702a09, the symbol was never exported in a header file, so it should be safe to mark it as static. Change-Id: I7132ffe9a7efcab226cc639d1b2357f7115bcadf
2019-03-21signal.c: Fix osmo_signal_talloc_ctx_init()Harald Welte1-1/+1
This function is broken ever since it was added back in 2018 in commit Id58ca18eb826b8f4183a7cf0dbb2b38cba702a09 Rather than allocating from the user-supplied 'root_ctx', it is allocating from the context that it's trying to create (which is NULL at that time, rendering the entire operation more or less a no-op. For sure you will not see osmo_signal structures never in any talloc report. Change-Id: I922d26815a3baa5be74bd3ee89d498555882d62f
2019-03-21select: Rename BSC_FD_* constants to OSMO_FD_*Harald Welte8-32/+32
The naming of these constants dates back to when the code was private within OpenBSC. Everything else was renamed (bsc_fd -> osmo_fd) at the time, but somehow the BSC_FD_* defines have been missed at the time. Keep compatibility #defines around, but allow us to migrate the applications to a less confusing naming meanwhile. Change-Id: Ifae33ed61a7cf0ae54ad487399e7dd2489986436
2019-03-20src/signal.c: cosmetic: use talloc_zero()Vadim Yanitskiy1-3/+1
Change-Id: I55c6249b0c4c82d5a181001e945ff2eca6e9ca36
2019-03-20gprs_ns_sns: Properly initialize sockaddr_in in gprs_nsvc_create_ip4()Harald Welte1-0/+2
When putting together a sockaddr_in, we must not only set the IP address and port, but also set the address family to AF_INET. And while at it, let's zero-initialize the entire 'struct sockdadr_in'. Change-Id: I1c8d8fe7f79a2ec737baa7800247269c3271983e