aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2023-02-11add doc/charts/pfcp_msgs*.mscNeels Janosch Hofmeyr2-0/+151
(I used these while implementing libosmo-pfcp and osmo-upf, but never submitted them.) Change-Id: I8d2343224d02d728e2eee2090ee2d4c6bec79e78
2023-02-10clarify API doc for osmo_pfcp_endpoint_tx()Neels Janosch Hofmeyr1-1/+6
I recently discovered some use-after-free in osmo-upf by wrong API usage of osmo_pfcp_endpoint_tx(). Highlight this pitfall in API doc. Change-Id: I637e7bb5d1296b5ad8db8ab0b8151fdbb9e7be03
2023-02-07Bump version: 0.1.2.25-9c96-dirty → 0.2.00.2.0Pau Espin Pedrol9-22/+58
Change-Id: I44bb6b839a6aefaf269e124c990ff0f0b837588d
2023-01-02silence compiler warning in gtlv_dec_enc.cNeels Janosch Hofmeyr1-1/+1
This was reported with gcc version 12.2.0: /git/libosmo-pfcp/src/libosmo-gtlv/gtlv_dec_enc.c: In function 'osmo_gtlvs_decode_unordered': /git/libosmo-pfcp/src/libosmo-gtlv/gtlv_dec_enc.c:237:42: warning: 'presence_flag_p' may be used uninitialized [-Wmaybe-uninitialized] 237 | *presence_flag_p = true; | ^ /git/libosmo-pfcp/src/libosmo-gtlv/gtlv_dec_enc.c:113:23: note: 'presence_flag_p' was declared here 113 | bool *presence_flag_p; | ^~~~~~~~~~~~~~~ There is no actual code path that will use presence_flag_p uninitialized, but it doesn't hurt to init with NULL. Change-Id: I8f4c420f2182c607abb1ee5d1c8175eaeda904af
2022-12-08gtlv: decoding error: log size limited hexdump of IENeels Janosch Hofmeyr1-2/+6
When a decoding error is encountered, log the value part of the root cause as hexdump, but at most 16 bytes (16*3 chars as hexdump). Contrived example of the change: before this patch: <-tx- PFCP seq-4 ASSOC_SETUP_RESP: 0: Invalid FQDN (-22: Invalid argument) <-tx- PFCP seq-4 ASSOC_SETUP_RESP: 0: tag 0x3c = Node ID: Error while decoding this IE (-22: Invalid argument) after this patch: <-tx- PFCP seq-4 ASSOC_SETUP_RESP: 0: Invalid FQDN (-22: Invalid argument) <-tx- PFCP seq-4 ASSOC_SETUP_RESP: 0: tag 0x3c = Node ID: Error while decoding this IE. L=20 V=[ 02 07 65 78 61 6d 70 6c 65 03 63 6f 6d 01 02 03 ...] (-22: Invalid argument) Change-Id: Ie814a117db3dfea32cf3f01cf124a2e472cb869f
2022-12-08bitmask to string: shortenNeels Janosch Hofmeyr2-6/+8
Remove braces and spaces from PFCP bits to string conversion. Instead of "( FOO BAR BAZ )", print "FOO+BAR+BAZ". Instead of "( FORW )", print "FORW". Instead of "( )", print "-". The spaces tend to break up readability of strings logged by osmo-upf. In particular, this affects UP and CP capability bits, Apply Action, Outer Header Creation. Change-Id: I38426d6381e96d4a683e46eba1bdd29c73d3f027
2022-12-08fix coding of Node ID: FQDN typeNeels Janosch Hofmeyr2-7/+10
Decode FQDN type Node IDs into "human" dotted notation instead of storing the DNS type data in the FQDN string. Related: OS#5806 Change-Id: I25d0f9b095287aa30e24498d8361c0a326ded447
2022-12-08fix coding of Network Instance IENeels Janosch Hofmeyr7-8/+28
Network instance names should be coded like in DNS, where each label is preceded by a length byte. Related: SYS#6192 Change-Id: I9d67464ef0f92b0512cfd6e48d203f8828a82a19
2022-12-01pfcp coding errmsgs: drop extra newlinesNeels Janosch Hofmeyr1-6/+6
Change-Id: I4eea1efc9bd67676b6202e50d41974b2717a2511
2022-12-01tweak comment in pfcp_ies_custom.cNeels Janosch Hofmeyr1-1/+1
Change-Id: I1530939cc63369668d2f3e5a126912713c06d0c1
2022-12-01add osmo_pfcp_ie_outer_header_creation_to_str_*()Neels Janosch Hofmeyr2-2/+16
Make osmo_pfcp_enc_to_str_outer_header_creation() as osmo_pfcp_ie_outer_header_creation_to_str_*() functions. Used by I0d4d9edcfc94b61bdc74cfd4ff837f151d1c28ae (osmo-upf) Change-Id: I4ad1570485c8081b82284e4e6b4de4d7eed414b0
2022-11-26osmo_pfcp_ip_addrs_set(): do not set port numberNeels Janosch Hofmeyr1-0/+4
struct osmo_pfcp_ip_addrs uses an osmo_sockaddr for storing IP addresses. Even though osmo_sockaddr contains a port number, no port number gets encoded in PFCP messages. Hence always set the port to 0. I noticed that when osmo_pfcp_ip_addrs_set() is invoked with an osmo_sockaddr that incidentally has a port number set, subsequent logging of e.g. a PFCP F-TEID shows a port number, which is confusing. Change-Id: Ib29a123c06d459c99d7c1c0b9a7694fb78cd9fd8
2022-11-26add osmo_pfcp_ip_addrs_to_str_*()Neels Janosch Hofmeyr2-9/+33
Move static function ip_addrs_to_str_buf() to public API as osmo_pfcp_ip_addrs_to_str_buf() and osmo_pfcp_ip_addrs_to_str_c(). So far the static function was only used in places where it follows other strings, so that it made sense to always start with a comma. Move this comma out of the function to the callers. Sensibly handle a NULL pointer and an empty address set. Rationale: osmo-upf would like to print an osmo_pfcp_ip_addrs struct in logging. Change-Id: I5f67db8d347690cbb1ce273a2d072636859f1bf6
2022-11-23PFCP: add Network Instance IE in PDI IENeels Janosch Hofmeyr3-6/+23
So far the optional Network Instance IE in PDI IEs was not coded by libosmo-pfcp. Add it. Test it by adding Network Instance IEs in pfcp_test.c. osmo-upf needs this, because we are about to add support for Network Instance in PDI IEs, to determine which local interface to use for GTP tunnel mapping and encapsulation/decapsulation. Related: SYS#6192 Change-Id: I162299e70b4fb0c3fef8039d693ac7d3fe4df16a
2022-11-22pfcp_test: fix order of dependenciesNeels Janosch Hofmeyr1-1/+1
When LIBOSMOCORE_LIBS comes before locally built libs, for some reason libtool puts system lib/ first in LD_LIBRARY_PATH, leading to ABI breakage in pfcp_test when an older libosmo-pfcp is still installed. Change-Id: I63880c1b4f326687ce9a35584a55742c1016d72b
2022-11-22tests: use 'check_PROGRAMS' instead of 'noinst_PROGRAMS'Vadim Yanitskiy4-4/+4
When using 'check_PROGRAMS', autoconf/automake generates smarter Makefiles, so that the test programs are not being compiled during the normal 'make all', but only during 'make check'. Change-Id: I62a7b4d76c910b3fa90deb0d35a8fc36146d66e6
2022-11-21pfcp_test: add missing 'pdi_present = true'Neels Janosch Hofmeyr2-3/+4
test_enc_dec[8] includes a PDI IE in Update PDR. The PDI is optional here, so it requires setting a presence flag to true. This was missing, hence the PDI part was not being tested at all. Add this presence flag. This was probably a copy-paste error from testing the Create PDR IE, where the PDI is mandatory and has no presence flag. Change-Id: Idc70ae23f15d3af65f98557cc51a111f2e6d75c9
2022-11-21pfcp_test: init logging, for PFCP errorsNeels Janosch Hofmeyr1-0/+19
Initialize logging so that potential errors are shown by the test. Normally, pfcp_test does not cause any logging. However, I encountered a linking problem, which caused error logging from libosmo-pfcp, which was not shown because osmo logging aborted the program first. Change-Id: I32a99d27ff72edceacb2cf4f4cd996650bc10710
2022-11-11api doc: explain heartbeat handling in rx_msg_cbNeels Janosch Hofmeyr1-1/+4
Related: SYS#5599 Change-Id: I3849060d703494ea43773c0208203f1fc206067f
2022-11-04contrib/jenkins.sh: build with --enable-werrorVadim Yanitskiy1-1/+1
Change-Id: I5d22083e40b5c95b2412e1dcb4aba4f023f54e23
2022-11-03Add -Werror=implicit-int -Werror=int-conversion -Werror=old-style-definitionHarald Welte1-0/+1
... if --enable-werror is used Change-Id: I8e6cdc40cb77777677e5ffbbf3bf9e5c32555b2c
2022-11-03Support building with -Werror=strict-prototypes / -Werror=old-style-definitionHarald Welte6-15/+15
Unfortunately "-std=c99" is not sufficient to make gcc ignore code that uses constructs of earlier C standards, which were abandoned in C99. See https://lwn.net/ml/fedora-devel/Y1kvF35WozzGBpc8@redhat.com/ for some related discussion. Change-Id: I79c51b78d1b055361f9ef5434361847353791d0d
2022-08-24gtlv: test repeated IEIs to several struct membersNeels Hofmeyr2-46/+379
Test the behavior fixed by Ie37585178ff27306d425b75d8e407b71f92f1cdc Related: CID#275415 Related: SYS#5599 Change-Id: I994d0fb1f1435d2c27a8630a43fe106652ac6e41
2022-08-24gtlv: fix repeated IEIs to several struct membersNeels Hofmeyr1-20/+70
Coverity Scan has brought my attention to a problem with decoding repeated IEIs, where there are multiple struct members in the decoded struct that these are decoded to. Before this patch, gtlv aborts with an error as soon as the first struct member for a given tag is full, not parsing following IEIs into subsequent struct members. After this patch, gtlv continues to look whether subsequent entries in the message coding also decode the same tag, but to a different struct member. First commit without changing the gtlv regression test, to show that all current tests still succeed. The test for this particular issue follow in I994d0fb1f1435d2c27a8630a43fe106652ac6e41 Related: CID#275415 Related: SYS#5599 Change-Id: Ie37585178ff27306d425b75d8e407b71f92f1cdc
2022-08-24gtlv: check memory bounds 3/3: encoding to strNeels Hofmeyr6-23/+30
See Id8d997c9d5e655ff1842ec69eab6c073875c6330 Related: CID#275417 Related: SYS#5599 Change-Id: I63d52a4f5dba32d3a3887dd9c5e42e1695fb2aa3
2022-08-24gtlv: check memory bounds 2/3: decoding TLVNeels Hofmeyr4-30/+50
See Id8d997c9d5e655ff1842ec69eab6c073875c6330 Related: CID#275417 Related: SYS#5599 Change-Id: I841da89112ccf70fcd0f60eb902445fb1712eb48
2022-08-24gtlv: check memory bounds 1/3: encoding TLVNeels Hofmeyr4-14/+33
Introduce a maximum bound of memory access to the osmo_gtlv API. Properly pass const-ness within the gtlv implementation. This patch adds membof_const(). The following patch will add the non-const membof() equivalent, which is not needed in this patch, yet. Coverity CID#275417 drew my attention to the fact that the gtlv decoding and encoding does not actually guard against access past the end of the decoded struct. We have not yet officially released libosmo-gtlv; also, osmo-upf and osmo-hnbgw so far only use the libosmo-pfcp API, which "hides" the gtlv API. Hence just change the API without a backwards compat shim. Related: CID#275417 Related: SYS#5599 Change-Id: Id8d997c9d5e655ff1842ec69eab6c073875c6330
2022-08-24pfcp_msg: check use count correctnessNeels Hofmeyr1-2/+2
Related: CID#275414 Related: SYS#5599 Change-Id: I685855da8b6f373fdc62a3c75f7f2e0af2839617
2022-08-24Bump version: 0.1.1.1-2904 → 0.1.20.1.2Neels Janosch Hofmeyr1-0/+7
Fix packaging, only. Change-Id: I6ae6cf59e769214e11447107316d38fe5fad583d
2022-08-23pkgconfig: add missing 'Requires:'Neels Hofmeyr2-0/+2
Change-Id: I018caa584cb1f5fa1b2a7e6e6f9ec26e5b54eea7
2022-08-22Bump version: 0.1.0.32-823b → 0.1.10.1.1Oliver Smith1-0/+44
Tag a new release with all the packaging fixes, so building libosmo-pfcp for latest isn't failing anymore on obs.osmocom.org. Related: OS#5654 Change-Id: I9a7be8342754fdbc21b83281c8ebcbf38112c61b
2022-08-22packaging: depend on libosmocore >= 1.7.0Oliver Smith2-2/+2
Require the same libosmocore version in configure.ac and rpm spec as already set in debian/control. Change-Id: I701f1aacca22a697f35aba0041a71945c5aea107
2022-08-22debian/control: move -dev deps of libosmo-gtlv-devOliver Smith1-3/+3
Only the -dev package of libosmo-gtlv should depend on other -dev packages. Change-Id: I4a7ba317e54f7f19d0947e95f7ab0b4f1e8fd43a
2022-08-22rpm spec: use --disable-staticOliver Smith1-2/+1
Follow what we are doing in other Osmocom rpm packaging by not building and packaging static libraries. Fix for rpmlint errors when building for OpenSUSE: libosmo-gtlv-devel.x86_64: E: static-library-without-debuginfo /usr/lib64/libosmo-gtlv.a libosmo-pfcp-devel.x86_64: E: static-library-without-debuginfo /usr/lib64/libosmo-pfcp.a libosmo-gtlv-devel.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/libosmo-gtlv.a libosmo-pfcp-devel.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/libosmo-pfcp.a (If we wanted to build with static libraries, we would need to use -ffat-lto-objects to get rid of the second error.) Related: https://github.com/rpm-software-management/rpmlint/issues/458 Change-Id: I49dd454afd8bd3473bcadbc8cd8724574011f886
2022-08-21rpm spec: reduce summary line lengthHarald Welte1-1/+1
Fixes the following rpmlint error: [ 17s] libosmo-pfcp.src: E: summary-too-long (Badness: 200) libosmo-pfcp: PFCP protocol encoding and decoding, and generic PFCP endpoint implementation [ 17s] The 'Summary:' must not exceed 79 characters. also, coincidentally it fixes: [ 17s] libosmo-pfcp.src: E: summary-not-capitalized (Badness: 20) libosmo-pfcp: PFCP protocol encoding and decoding, and generic PFCP endpoint implementation [ 17s] Summary doesn't begin with a capital letter. and the non-critical warning: [ 17s] libosmo-pfcp.src: W: name-repeated-in-summary libosmo-pfcp [ 17s] The name of the package is repeated in its summary. Make the summary brief and [ 17s] to the point without including redundant information in it. Related: OS#5653 Change-Id: I293f77849d50e68753b82d7b5476c19217ecc2de
2022-08-19gitreview: fix projectOliver Smith1-1/+1
Change-Id: I97245dd141c185b35ccfb5b262c1057a18eef07e
2022-08-19RPM: fix configure and typo "gltv" in .spec.inNeels Hofmeyr1-2/+3
Change-Id: Ideff7942a3250fa6541cfa6252a1c2927afdfc45
2022-08-16configure.ac: do not require unused dlopenVadim Yanitskiy1-3/+0
Change-Id: Ic012f7b19a46ee38db0172b07bad2098567192b0
2022-08-13pfcp_cp_peer: check use count correctnessNeels Hofmeyr1-1/+1
Related: CID#275418 Change-Id: Id79a84312b3ff8d562e26a525866b8bb09f9d0bf
2022-08-13doc: minor fix in pfcp_cp_peer_fsm.dotNeels Hofmeyr1-0/+1
Change-Id: I0de10d5331df128081d6b875e3ba9c0c3c32bd9f
2022-08-12.gitignore fixes: generated sources, .spec fileNeels Hofmeyr1-1/+12
Change-Id: Id8f6c80f13a09a3dedd4577fd1460f2f72faa8f8
2022-08-12fix warnings: 'uninitialized'Neels Hofmeyr2-3/+3
Though these can never be used uninitialized, initialize to NULL to avoid compiler warnings like: pfcp_msg.c:188:66: warning: 'h_no_seid' may be used uninitialized Change-Id: Icb338b200fe3186ccd7fd3f502c1723f60947190
2022-08-12libosmo-gtlv.pc.in: tweak DescriptionNeels Hofmeyr1-1/+1
Change-Id: Idcdffe4528370b8580a30fbdde6645ec5d814021
2022-08-12debian: fix missing dep gtlv0 <- pfcp0Neels Hofmeyr1-2/+4
Change-Id: I8af60305543b06b74859e83b840b171d29af1abd
2022-08-12debian/control: fix confusion in descriptionNeels Hofmeyr1-2/+2
Change-Id: I380b1dd626b3e6a35f17ae09a6758bef59f51c84
2022-08-12debian: add missing *-dev.install filesNeels Hofmeyr2-0/+10
Change-Id: I6b03624f3d93ad6b2551fb3ff673e7c7cb246f4c
2022-08-12RPM: fix .spec fileNeels Hofmeyr2-7/+77
Change-Id: Ie2fa0770b94af8637483434068b7c0df4b4272c6
2022-08-12configure.ac: drop dependencies on vty and ctrlNeels Hofmeyr1-2/+0
Change-Id: Idea223e9b039241dd35c735922b8794573730fc3
2022-08-10README.md: tweak clone URLNeels Hofmeyr1-1/+1
Change-Id: Idcfd4421189c711f95926f7e66da3402c059dfff
2022-08-10debian packaging of libosmo-gtlv and libosmo-pfcpNeels Hofmeyr8-32/+95
Fix debian packaging, so far a copy-paste from osmo-upf.git crept in here by accident. Related: SYS#5895 Change-Id: Id7169fc67b4f8f77dfbeff9f199e6557ced67a53