aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2018-08-31New version for On-Wavesdaniel/onwavesDaniel Willmann1-2/+9
2018-08-31Merge remote-tracking branch 'origin/master' into daniel/onwavesDaniel Willmann4-107/+192
2018-08-06debian/rules: Don't overwrite .tarball-versionHarald Welte1-4/+0
The .tarball-version file should contain the *source version* uniquely identifying the git commit, and not the Debian package name. With https://gerrit.osmocom.org/#/c/osmo-ci/+/10343/ there is a correct .tarball-version file in the .tar.xz of the nightly source packages. Change-Id: I1466936033c2f60edd1078eb41f3508d87da4402 Related: OS#3449
2018-07-23gtp: Add new replacement cb_recovery2 for cb_recoveryPau Espin Pedrol2-12/+45
Sometimes the originating pdp ctx causing the Recovery Procedure is required, in order to drop all pdp ctx but this one, which specs specify should be handled as valid: """ The SGSN receiving the Recovery information element shall handle it as when an Echo Response message is received but shall consider the PDP context being created as active if the response indicates successful context activation at the GGSN. """ Change-Id: I53e92298f2f6b84d662a3300d922e8c2ccb178bc
2018-07-21gtp: Add new API to avoid freeing pdp contexts during DEL CTX REQPau Espin Pedrol2-37/+73
With this API, user is expectd to free the PDP ctx when the confirmation for the release has been received (cb_conf time). This way user can maintain the pdp ctx alive during all this time. Extra code is added to gtp_delete_pdp_resp() since it's now possible to match it and push it up to the user cb_conf. This way, cb_conf() can be used for locally-initiated DEL CTX REQ, while delete_context() cb is left for remotely-initiated DEL CTX REQ. In this later case, when the DEL CTX RESP is sent the ctx is deleted and the delete_context() is called, where the user can do related actions or trigger consequence events (in the case of SGSN, it will drop all related GGSN bits for that PDP ctx and forward the DEACT PDP CTX to the MS). Change-Id: I29d366253bb98dcba328c7ce8aa3e4daf8f75e6c
2018-07-19fix support for multiple IPCP in PDP protocol configuration optionsStefan Sperling1-36/+41
Parse multiple IPCP IEs embedded in Protocol Configuration Options, and return IPCP responses for all of them. Makes the associated TTCN3 GGSN test pass. Depends: Ia1410abb216831864042f95679330f4508e1af3d Change-Id: I51ecab4e35f3ee638e68ca773b0da90cc0294ab0 Related: OS#3319
2018-07-19fix unaligned access in build_ipcp_pco()Stefan Sperling1-20/+31
IPCP data can begin at any byte location in the pco_req->v array. Casting to a 'struct ipcp_hdr' pointer could lead to unaligned access. Parse IPCP data with u_int8_t pointers instead to avoid this problem. Add some length checks while here. pco_contains_proto() and ipcp_contains_option() now receive the minimum size of the data the caller is looking for, and only return pointers to items of sufficient size. Also fix an inifinite loop in ipcp_contains_option() by refusing IPCP options with length small than 2. Previously, a zero length option would trigger an infinite loop in the parser. Change-Id: Ia1410abb216831864042f95679330f4508e1af3d Related: OS#3194
2018-07-13gtp: Log ignore CTX DEL REQ due to no teardown and only 1 ctx activePau Espin Pedrol1-0/+3
Change-Id: Ic950c04d309d5686bfbeab332f79c48678e743ae
2018-07-13gtp: Allow recv DEL CTX REQ in sgsn and DEL CTX RSP in ggsnPau Espin Pedrol1-8/+4
According to 3GPP TS 29.060 section "7.3.5 Delete PDP Context Request", both directions are valid in both GSNs. This allows osmo-sgsn receive delete ctx indication (cb_delete_context) in order to implement GGSN initiated requests. Change-Id: I6927c07be4ddf74defe338d01d947056e15cd14d
2018-07-13gtp: Log type name of unexpected signalling messagePau Espin Pedrol1-4/+8
Change-Id: Iae0f045e4128cf97aa7824d7d774b59bf966cbe8
2018-06-26Release new versionDaniel Willmann1-0/+7
2018-06-19ggsn: ctrl iface: listen on IP configured by VTYPau Espin Pedrol1-1/+2
Previosuly, the CTRL iface of osmo-ggsn was always bound to 127.0.0.1 Fixes: OS#3287 Change-Id: I9b2c1b310c7dc94ef09642f7f256ae259b41619d
2018-05-31Bump version: 1.2.1.3-6a28 → 1.2.21.2.2Pau Espin Pedrol1-0/+11
Change-Id: Idbc183ca37196082e95a107901bea53d37aa2ff3
2018-05-28ggsn: make sure ipcp_option_hdr and and ipcp_hdr are packedPhilipp Maier1-2/+2
struct ipcp_option_hdr and struct ipcp_hdr are not declared as packed explicitly, but they are used to parse memory blobs by casting pointers. Add __attribute__((packed)) to ensure that those structs are stored packed. Change-Id: I14e10bb3ce482347b3f0c4d3a75168a55df15f20 Related: OS#3288
2018-05-28ggsn: fix misinterpreted length field in ipcp_contains_option()Philipp Maier1-1/+1
The abort condition of the while loop in ipcp_contains_option() is accessing ipcp->len directly. Unfortunately this field is an uint16_t which as to be interpreted as little endian value. If it is used without prior conversion the value may appear larger than actually intended and the loop will then not stop at the end of end of the buffer. This can cause unpredictable results when the value given with the parameter enum ipcp_options opt is not found. The loop will then eventually cause a segmentation fauld or is likely to hang as soon as cur_opt->len points to a zero byte in memory. - Make sure that ipcp->len interpreted correctly by accessing it through ntohs() Change-Id: Icffde89f9bc5d8fcadf6e2dd6c0b4de03440edd5 Related: OS#3288
2018-05-09ggsn_vty.c: fix: use CONFIG_NODE as parent by defaultVadim Yanitskiy1-0/+4
There are some configuration nodes, which are handled by extenral libraries, such as libosmoctrl. So, when switching back to the parent node, this should be kept in mind. Change-Id: I65be7910dc46166caa34a0984a6763e1477dec99
2018-05-04Bump version: 1.2.0.1-36c4 → 1.2.11.2.1Pau Espin Pedrol1-0/+6
Change-Id: I4a8bdcbee300296496f039b90795ff981018e17d
2018-05-04debian/rules: Fix debian packaging after 1.2.0 releasePau Espin Pedrol2-1/+3
The 1.2.0 release bumped lib version to 3 and updated the debian package file accordingly, but forgot to increase dh_strip line in debian/rules. Change-Id: Ib54f231943348c06acecd6f413b2c96b24f6db28
2018-05-03Bump version: 1.1.0.90-5468-dirty → 1.2.01.2.0Pau Espin Pedrol5-13/+116
Change-Id: I2af8c8ff75d5153456b814b9dfe4fbddafe5af7a
2018-04-25ggsn: don't use gtp_kernel_tunnel_{add,del}() for userspace tunHarald Welte1-4/+6
Change-Id: I00cc8eb8c4d44532f975f78783ff4e12814b3416
2018-04-25Move kernel GTP support from ggsn/ to lib/Harald Welte9-148/+151
This way, the IP address / route handling between TUN devices and kernel GTP can be shared, which will provide not only a unified codebase but also a more consistent behavior. This also paves the road for to use kernel GTP from sgsnemu in the future. Related: OS#3214 Change-Id: Ic53a971136edd0d8871fbd6746d7b0090ce3a188
2018-04-25lib/tun: Remove tun_setaddr() API, as everyone is using tun_addaddr() nowHarald Welte2-17/+0
Change-Id: I02e057d30b6773c17ea6bc31094e53587971e9e7
2018-04-25sgsnemu: Convert from tun_setaddr() to tun_addaddr()Harald Welte1-2/+1
This converts the last caller of tun_setaddr() outside of lib/tun.c to use tun_addaddr(). Change-Id: Ia301d6a4ee3d02c1af1c85f2fe1041d3013268b0
2018-04-25ggsn: Don't explicitly use tun_setaddr() API anymoreHarald Welte1-2/+2
tun_addaddr() internally contains a fallback to tun_setaddr() for the first address, so we can unify the API usage a bit and use tun_addaddr() from all call sites Change-Id: I34de003a1a040254bd38b29e48caea34cb0c88d2
2018-04-25lib/netdev.c: Cosmetic changes (coding style / cleanups)Harald Welte1-49/+10
Change-Id: I60cbca616a4f727e2374c52715f9286a0f4c5e4b
2018-04-25lib/tun: split generic network device related stuff to lib/netdevHarald Welte5-755/+842
Change-Id: Ib021e392637a43d5cf1b40e0d50621fe7e854ba5
2018-04-25lib/tun.c: Generalize tun_{set,add}addr*() functionsHarald Welte1-51/+98
There's nothing really tun-specific about the adding and removing of addresses to network devices. Let's generalize the related code. Change-Id: I139a950dd81a4b1199953be1608cd109a060f562
2018-04-25lib/tun.c: generalize tun_*route() to netdev_*route()Harald Welte3-17/+10
There's nothing specific to tun devices in adding a route to the kernel. Change-Id: Ib077934aa5f3c9bed06e2cf16a980c965a7a046d
2018-04-25lib/tun.c: Generalize tun_sifflags() to netdev_sifflagsHarald Welte1-7/+7
There's nothing "tun" specific about that function, let's clarify that. Change-Id: Iae7ced700245d6c1ac7e9807ab80d12fde8da116
2018-04-25fix segfault in case of kernel gtp-uHarald Welte1-0/+8
There's a problem during the initial start-up of osmo-ggsn in case of kernel gtp-u: apn->ggsn->gsn is not yet set while parsing the 'apn' nodes from the config file. This member is only set after the last 'apn' node has been parsed at the end of the 'ggsn' node. Closes: OS#3217 Change-Id: I022a5e5ebc1f155e8f94938856d310462f79bbe8
2018-04-17use osmo_init_logging2Pau Espin Pedrol5-5/+18
Change-Id: Ic38fff17cc985238b91999c8acdd92d22fd28c72
2018-03-20remove the -f option from osmo-ggsn.serviceStefan Sperling1-1/+1
This option was removed in dda21ed7d4a897c9284c69175d0da598598eae40 and the behaviour previously implied by -f has since been the default. Change-Id: Iba13df713af03771739a4feff4b222a0c3352394 Related: OS#3044
2018-03-05jenkins.sh: use --enable-werror configure flag, not CFLAGSNeels Hofmeyr1-1/+1
Change-Id: I64e542ad4da34a7ac3bc1b599a122ecff47e892d
2018-03-05configure: add --enable-werrorNeels Hofmeyr1-0/+21
Provide a sane means of adding the -Werror compiler flag. Currently, some of our jenkins.sh add -Werror by passing 'CFLAGS="-Werror"', but that actually *overwrites* all the other CFLAGS we might want to have set. Maintain these exceptions from -Werror: a) deprecation (allow upstream to mark deprecation without breaking builds); b) "#warning" pragmas (allow to remind ourselves of errors without breaking builds) As a last configure step before generating the output files, print the complete CFLAGS and CPPFLAGS by means of AC_MSG_RESULT. Change-Id: Ifcde5a110cbed0eaa250dd946927e3b0f4f9bd13
2018-02-14Add talloc context introspection via VTYHarald Welte1-0/+3
This requires libosmocore with Change-Id I43fc42880b22294d83c565ae600ac65e4f38b30d or later. Change-Id: I460efff3a3dfa2c7d955871aca78b37552a29aff
2018-02-14build: Remove AC_PROG_CXX, C++ is never usedMartin Hauke1-1/+0
Change-Id: Ifda126ab2e5fdd98317e723aa6b10d964b4519c2
2018-02-14sgsnemu: listen param is a host, not an interfacePau Espin Pedrol3-6/+6
This param is parsed by gethostbyname() and it's confusing to document it as an interface, because users will then attempt to pass "lo" to it, which fails. Change-Id: Id8ef0e12ddcaf8bfd199a44de0ba4280f05d4431
2018-02-12sgsnemu: Fix bad ptr during context deallocationPau Espin Pedrol1-2/+2
Older commit switched pdp_t to have an array of 2 peers instead of only one in order to accomodate for ipv4v6 contexts, which can have 2 addresses assigned. The usage of peer field was not updated in sgsnemu accordingly, which means the wrong memory portion was being accessed. Fixes: 2d6a69e69a4b4cb2b8cc63c4810dae44e5a4d8f6 ("Add support for IPv4v6 End User Addresses") Change-Id: I9e563522173a82b265e93b1ef9dc93ced40fefa2
2018-02-12sgsnemu: fix: no outgoing GTP-U in "createif" modeViktor Tsymbalyuk1-1/+1
in "createif" mode uplink traffic not forwarding from tun interface into Gn, inside GTP-U. create_pdp_conf get iphash (ipm) with pdp == 0x0 Fix - in create_pdp_conf - instead of casting using already definned iphash in ipset function. Change-Id: Icd58450548b3a47cb933d70a2e3166c067552b2c
2018-02-09sgsnemu: created "pinghost" and "createif" modes for mutual exclusionViktor Tsymbalyuk3-26/+97
No warnings when used options from "pinghost" and "createif" groups in a same time. sgsnemu created tun0 interface and send pings inside G-PDU, but didn't calculate replys. Added options modes to avoid mutual exclusion options. Change-Id: I196df7838212dcddecd64a64a6cba613b6cfced0
2018-01-30ggsn.c: cb_tun_ind: Don't drop packets targeting pdp ctx ll addrPau Espin Pedrol1-2/+6
Change-Id: I72602a78baa2a7e3412d8b69c1bf1b3ac0efa434
2018-01-30ggsn.c: cb_tun_ind: log dst addr of packet without pdp ctxPau Espin Pedrol1-1/+4
Change-Id: Ib3a87ec2b2d0014376295028a648750fa3124485
2018-01-30ggsn.c: cb_tun_ind: Convert ifelse to switch statementPau Espin Pedrol1-3/+6
Change-Id: I4fc97f367ae615cdf0a9501f89419990c2fd4599
2018-01-26ggsn: Print all addresses on successful pdp ctx creationPau Espin Pedrol1-3/+11
Change-Id: I0c57df17d91bade127027e03633494adb6f818c5
2018-01-26ggsn: Parse PCO_IPCP for IPv4v6 pdp ctxPau Espin Pedrol1-10/+2
pdp_has_v4 only take into account IPv4 EUAs. Change-Id: I1cf8d6548951e5732075beeea1412d12fb6bdec3
2018-01-26ggsn: Parse PCO_IPCPPau Espin Pedrol1-15/+53
Improvements include: - Use Identifier received from request instead of using hardcoded id=0. - Don't add DNS to response if they were not included in request. Change-Id: Ic8aa5d634e526683b2ad8ed5d14088e171c41c98
2018-01-26ggsn: Validate packet src addr from MSPau Espin Pedrol2-1/+19
Closes: OS#2422 Change-Id: Ie658a7f161103bb6f631ab0508e45e55fb42a442
2018-01-26ggsn: encaps_tun: Avoid forwarding packet if EUA is unassigned, fix crashPau Espin Pedrol3-13/+47
Check (before forwarding received GTP packets into the tun) if the pdp ctx associated with the packet requested was assigned an EUA of the given IP version. This way we avoid for instance forwarding an IPv6 packet (or sending back a response to a Router Solicitation packet) in case the APN was configured without IPv6 support or if the MS/SGSN didn't ask for an IPv6 while requesting an EUA. As a side effect, this commit fixes an OSMO_ASSERT hit introduced in handle_router_mcast in 2d6a69e69a4b4cb2b8cc63c4810dae44e5a4d8f6 due to a deffective MS sending an icmpv6 Router Solicitation over IPv6 after having been requesting and assigned an IPv4 EUA (so no IPv6 packets expected). Before that commit, there was no crash but the message was being wrongly answered and used an uninitialized .v6 addr field from the peer struct. Fixes: OS#2843 Change-Id: Ib6d18a64c2b71f3bcf6cb7e3a978d2d3f9c7a79b
2018-01-26gtp/gtp.c: Use uint8_t for version param in static functionsPau Espin Pedrol1-13/+13
Change-Id: I9afc36e2304f1060615219e88dd28821fb74e300
2018-01-26gtp/gtp.c: Mark non exported functions as staticPau Espin Pedrol1-15/+15
Functions not exported in gtp.h should be static. There's no need to mark functions as extern in the .c file. Change-Id: Ie61d5c6e0ae45ef3885911cedf71c826ed1705d0