Commit Graph

51 Commits

Author SHA1 Message Date
FlUxIuS 95007dad00 Patch for Ubuntu 22.04 2023-01-04 17:36:34 +01:00
Michael Iedema 76b71d509b Revert "common: Restrict UDP binding to localhost only"
This reverts commit 29ef2c82db.
2016-07-13 05:34:14 -07:00
Michael Iedema 8f57dd84b3 revert cbb5d790e5 2016-07-06 12:19:56 -07:00
Tom Tsou cbb5d790e5 common: Add mandatory length field to UDP receive calls
Current UDP receive reads up to MAX_UDP_LENGTH bytes into the
passed in buffer, which may lead to buffer overflow if the
write buffer is of insufficient size.

Add mandatory length argument to UDP socket receive calls.

Reported-by: Simone Margaritelli <simone@zimperium.com>
Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2016-05-06 18:09:46 +02:00
Tom Tsou 29ef2c82db common: Restrict UDP binding to localhost only
Reported security vulnerability where control and data UDP
packets can be injected into the transceiver externally due
to socket binding to all interfaces using INADDR_ANY.

Existing socket interface does not allow specifying local
address; only the local port and remote address/port are
arguments.

Restrict socket bind to localhost with INADDR_LOOPBACK. If
external interfaces do need to be used, the API should be
modified to allow specifying the local socket address.

Reported-by: Simone Margaritelli <simone@zimperium.com>
Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2016-05-06 18:09:44 +02:00
Michael Iedema 11d8baa826 also ignore LockTest 2014-12-04 21:16:43 +01:00
Michael Iedema cc62ca4bb7 sync from commercial 270263e2437d5105b36fec2015176cfddec48ffb 2014-12-04 19:50:34 +01:00
Michael Iedema 3ad343b97b ignore new test progam binaries 2014-07-16 06:13:19 +02:00
Michael Iedema 88311c0670 merge 5.0 preview from commercial 2014-07-16 04:32:22 +02:00
Scott Van Gundy 00d91e90bb No real code changes only to comments and logging for GPRS
(upstream r8287)
2014-04-18 11:02:18 +02:00
Pat Thompson 7e87828c3b Allow an empty log level to mean use the default level.
This allows the CLI command "unconfig" on Log.Level.* or Log.Group.* to work as expected.
(upstream r8227)
2014-04-18 10:59:46 +02:00
dgotwisner d45cfa5ab5 Bug 1707 related changes - convert timestamps to use ISO date/time format.
(upstream r8170)
2014-04-18 10:55:44 +02:00
Shaddi Hasan df638854db Allow IP:PORT in address lists
Signed-off-by: Michael Iedema <michael.iedema@rangenetworks.com>
2014-04-18 10:24:25 +02:00
pat.thompson 6494b28899 Add trivial SimpleKeyValue::getNum() 2014-03-31 12:35:27 +02:00
svangundy 7c1ebc3899 Fixed zero length sms message in both text and 3gpp mode. Fixed many crahses along the way. Changes were made in openbts and smqueue. Fixed issue with loading smqueue from back up file. All cases of plain text and 3gpp are working now. Improved logging in smqueue. Fixed error where data was be sent in 3gpp mode when text was selected. 2014-03-31 12:34:00 +02:00
pat.thompson 778aa50799 Add some trivial new routines to class SimpleKeyValue. 2014-03-31 12:29:21 +02:00
pat.thompson 2f92ebc717 Change LOGHEX to use long instead of unsigned type so it will compile on 64 bit machines. 2014-03-31 12:28:39 +02:00
pat.thompson 6ee4814b7e The socket code throws errors, but since those are usually uncaught, it causes the containing program to end.
So added a devassert in these cases so we can catch how this happens if the Log.Level is DEBUG.
I did this to track down a bug, but of course, now the bug no longer occurs.
2014-03-31 12:27:55 +02:00
pat.thompson 3560e43d9d Fixes: Calling LOG from sqlite3util when the database cannot be accessed causes infinite recursion when the LOG message attempts to access the database.
Fixes ticket #1733
2014-03-31 12:27:00 +02:00
olga.bobrova 1b7ea66cf9 typo in text output 2014-03-31 12:26:00 +02:00
pat.thompson 0dc6d369e8 Back out r6976, r6977, r6980, r6981, which were namespace removals.
There is nothing wrong with namespace, and these changes generated 1700 lines of
irrelevant diff output making it difficult to compare various revisions of CommonLibs.
2014-03-31 12:17:26 +02:00
pat.thompson c17e42bd8e Result of merging features/dev -r7759:7824 to trunk.
Dont crash at shutdown.

Init logger gPid locally so Logger can be used in other programs besides OpenBTS, and shorten the log format.
2014-03-31 12:15:14 +02:00
dgotwisner b21473440f Bug 242 (yes, that old).
Add date to alarms (and console/syslog messages through Logger). Timestamp
was already there.
2014-03-31 12:12:35 +02:00
dgotwisner 7b0e351a23 Remove smarts to cache thread id, as I believe there was a locking issue and
significantly added overhead dealing with locking each time than in just doing
the system call.
I expect that this will allow 1655 to work for Neel.
2014-03-31 12:11:05 +02:00
pat.thompson 9cf9130509 Use LOG(CRIT) when existing so a diagnostic message is printed to the console before exiting.
Also clean up code slightly.
2014-03-31 12:08:20 +02:00
pat.thompson 32d756c24c Add Log.Group SMS for easier SMS debugging. 2014-03-31 12:06:44 +02:00
dgotwisner 6129dbfbc2 Changed logging system to "cache" gettid() values, to avoid system calls at
runtime (ie, when logging).
The implementation is cludgy. This is because we create threads before main,
as a result of global thread objects (as opposed to pointers to thread objects
that get new'ed and started in main).
A view of the system through strace indicates one or two calls to gettid() per
thread (usually 1, occasionally 2). Changing the read lock in Log() to a write
lock deadlocks.
2014-03-31 12:04:56 +02:00
dgotwisner 73ef35474f Eliminate getpid() calls when logging. 2014-03-31 12:03:44 +02:00
dgotwisner 06343d3812 Changed logger to use getpid() and gettid() instead of pthread_self(), as
pthread_self() just returns a pointer to an opaque data structure used by
pthreads, and the other two give information that is useful to relate to top,
ps, etc.
Accidently changed indent in SelfDetect::Exit(). Sorry Michael.
Found as a result of working through bug 1608.
2014-03-31 12:02:24 +02:00
Michael Iedema 7f33081522 - remove need for 3rdParty include reference, libcoredump now can be built-from-scratch and installed as lib and -dev headers 2014-03-31 11:30:56 +02:00
dgotwisner 74ab41ae30 Add code to save various /proc files to a file when we crash (with core
generation). Tied to 2 configuration variables.
2014-03-31 11:16:25 +02:00
dgotwisner 9c17f09fe6 Add support to CommonLib? to support google core dumper. 2014-03-31 11:15:28 +02:00
dgotwisner 3a2602c75d Remove "hack" and put in correct signal number define. 2014-03-31 11:01:19 +02:00
Michael Iedema 414179aa82 - merging in Dave's selfDetect branch so we can limit our components to only a single instance
- small changes to log messages, passing signal information through to the log and also echoing failed starts to to cout
- a HACK was needed to avoid signal 17, Dave can smooth this out in a more intelligent way than my workaround
- ticket #1549
2014-03-31 10:59:57 +02:00
dgotwisner 4575b4d264 Fix more code with respect to bypassing "using namespace". Currently,
Utils.h still has a using namespace, to prevent non-CommonLibs? code from
breaking. All CommonLibs? code has been compiled with tue Utils.h "using
namespace" commented out, though.
2014-03-31 10:50:02 +02:00
dgotwisner 2b6d0c6fa7 Remove more "using namespace" from source files. 2014-03-31 10:32:27 +02:00
dgotwisner 66a47d9bff Eliminate more "using namespace" statements. 2014-03-31 10:31:29 +02:00
dgotwisner b8ca812fde Remove "using namespace std" from these source files, and fix the usage of
string, cout, etc. accordingly, to match both our coding convention (from
the wiki) and the typical C++ ruleset of never using "using namespace".
2014-03-30 19:26:54 +02:00
dgotwisner 00294a9fbd Change Vector constructor code from call to vConcat() to call to this->vConcat(). This allows us to compile under gcc 4.8.1 (Ubuntu 13.10's compiler). This is more consistent with the C++ language definition of calling a base construtor from inside a derived constructor. 2014-03-30 19:25:31 +02:00
Michael Iedema abec8dabb6 merged in commercial commonlibs 2014-03-24 22:57:31 +01:00
Michael Iedema bd94d0a988 ignore some things 2014-03-22 16:18:17 +01:00
Kurtis Heimerl 94d53215c1 allow EGSM
git-svn-id: http://wush.net/svn/range/software/public/CommonLibs/trunk@7155 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2013-12-31 19:55:16 +00:00
Michael Iedema b08981537f - ignoring some stuff
git-svn-id: http://wush.net/svn/range/software/public/CommonLibs/trunk@6494 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2013-09-18 08:58:36 +00:00
Kurtis Heimerl 7a7862c9d5 syncing CommonLibs, and including BSD-licensed A5/1 implementation.
git-svn-id: http://wush.net/svn/range/software/public/CommonLibs/trunk@6165 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2013-08-13 23:17:46 +00:00
Kurtis Heimerl 59515c11f0 Complete Configuration sync. While testing, I discovered what I think is a race condition: getStr("SIP.SMSC") returned another config key ("GSM.MS.TA.Damping") which I assume is a race condition in the config cache. However, I've been unable to replicate the issue and I think it may resolve itself quickly (as these things are successfully cached)
git-svn-id: http://wush.net/svn/range/software/public/CommonLibs/trunk@5656 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2013-05-31 21:47:42 +00:00
Kurtis Heimerl e6a48a3690 syncing commonlibs with Many thanks to Michael Iedema for these patches, makes config a lot better.
git-svn-id: http://wush.net/svn/range/software/public/CommonLibs/trunk@5655 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2013-05-31 21:47:25 +00:00
Kurtis Heimerl 9b8ad3802e Harvind found a bug in BitVector.cpp:
Basically the unpack method and fillField method assume MSB-first bit packing.   The unpack method calls fillField for each byte that needs to be unpacked.  The problem occurs on its final call to fillField when it has a partial byte to unpack; it uses the LSB bits instead of the MSB bits.

git-svn-id: http://wush.net/svn/range/software/public/CommonLibs/trunk@3288 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2012-03-08 07:13:15 +00:00
David Burgess 22c77a7c6a git-svn-id: http://wush.net/svn/range/software/public/CommonLibs/trunk@2583 19bc5d8c-e614-43d4-8b26-e1612bc8e597 2011-11-20 00:22:41 +00:00
David Burgess 3059c5a6a1 Fixed the license notices.
git-svn-id: http://wush.net/svn/range/software/public/CommonLibs/trunk@2305 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-10-12 01:23:28 +00:00
David Burgess a65961cef3 Removing some directories that should not have been checked in.
git-svn-id: http://wush.net/svn/range/software/public/CommonLibs/trunk@2255 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-10-07 19:21:41 +00:00