aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
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
2018-01-26gtp/gtp.c: Remove unused function char2ul_tPau Espin Pedrol1-9/+0
Change-Id: I0d7493404ea05ce2e795958041bbb6cb75a04d31
2018-01-26sgsnemu: sgsnemu stopped after recieving "Request accepted" from ggsnViktor Tsymbalyuk1-1/+1
"sgsnemu" stopped with the message "Received create PDP context response. Cause value: 128", but normaly at that poit it should continue working and create "user plane". Reason: Funtion "create_pdp_conf" checking result of "in46a_from_eua" and mistakenly returned EOF when more than 1 IP address provided by GGSN. Now function "create_pdp_conf" stopped with error when 0 IP provided or error code comes from "in46a_from_eua". Fixes: 2d6a69e69a4b4cb2b8cc63c4810dae44e5a4d8f6 ("Add support for IPv4v6 End User Addresses") Change-Id: I7881b8e1f27c432007cb6e5ff665a2ce55f103b5
2018-01-25gtp.c: gtp_gpdu_ind: Early return to avoid use of uninitialized varPau Espin Pedrol1-1/+2
If the version received is not known, pdp is then uninitalized so we should not be using it. Let's return an error to inform the caller. Change-Id: Ib3e23b61a3521bd3c9002d3165ca8eff4361a35e
2018-01-25gtp.c: gtp_gpdu_ind: Convert ifelse to switch statementPau Espin Pedrol1-3/+6
Change-Id: I99b73f7a6d4100789fa92021c6ec9117869c881b
2018-01-25gtp/pdp: Remove unused APIs pdp_ntoeua pdp_euatonPau Espin Pedrol2-20/+0
Change-Id: I00db99ba8de3f3d90e85bf593ed31555eedb439b
2018-01-25gtp/pdp: Fix trailing whitespacePau Espin Pedrol2-30/+30
Change-Id: I1bc65ef9af1144779ee91a2c9b9887233ad15671
2018-01-25gtp.c: Log unsupported GTP version numberPau Espin Pedrol1-10/+10
Change-Id: Idbc6e4c912b958bde5916b87ec53c3c4db70bee0
2018-01-25gtp.c: Determine GTP version from headerPau Espin Pedrol1-8/+14
Change-Id: I843071a090e877fd529e1e0b799df3585bf836d8
2018-01-25gtp.c: Fix trailing whitespacePau Espin Pedrol1-28/+28
Change-Id: I636c81d0c0ff53c97e6aedbc00f90c1325a3d607
2018-01-19README.md: Remove misleading sentence on sgsnemuHarald Welte1-2/+1
As reported by Viktor Tsymbalyuk, "Use the same LAN switch as the one your SGSN is connected to." is of course completely bogus. As long as you have IP routing in place, it doesn't matter at all which switch you are using. Change-Id: I748752337b863b317d2899017b1dc255ced2515d
2018-01-17Add GTP message namesMax2-0/+51
Change-Id: I65eb80db4bcdc6da4d267bef3b907d3f98942a2e
2018-01-16Fix stow-enabled jenkins build failureMax1-2/+2
The error is: CC gtp-kernel.o gtp-kernel.c:19:26: fatal error: libgtpnl/gtp.h: No such file or directory #include <libgtpnl/gtp.h> ^ compilation terminated. Fix it by using proper CFLAGS/LIBS for libgtpnl. Change-Id: I5a24076778ea3ce263ac27211a6f45f935155b33
2017-12-21Enable sanitize for CI testsMax1-1/+1
Change-Id: I7559807d54bec5da45ea5c41b10d396d992cb1b7
2017-12-15ggsn_vty.c: Print ipv6 link-local cmd when writing config to filePau Espin Pedrol1-0/+2
Previous commit added the ipv6 link-local vty cmd but forgot to add code to print its value in config_write_apn. Fixes: 37c45e3998fca240b5266abd3ac883d0a35bab50 Change-Id: I08aeaa98d6dc318b7e9740d837ba4ac48cd7051c
2017-12-14ggsn: Add 'ipv6 link-local' vty cmdPau Espin Pedrol3-1/+37
This vty cmd let's you set up a new link-local IP for a specific APN to be used during ICMPv6 Router Advertisement procedure. osmo-ggsn hence requires a link-local IPv6 address to be added to the tun interface, otherwise the apn will not be configured correctly and it won't be able to allocate addresses from the ipv6 pool later on. This feature is useful in case your OS doesn't support autoconfiguring link-local IPs when the interface is brought up (some linux versions are known to fail at this) or in case you configured your OS specifically to avoid automatic set up (sysctl net.ipv6.conf.*.autoconf). If "no ipv6 link-local" is provided (default), osmo-ggsn will rely on the OS or the ipup-script setting up the link-local IP for the tun interface at creation time, then fetching it after ipup-script time and using the first link-local ip found. On the other hand, if the "ipv6 link-local" cmd is provided, osmo-ggsn will add the link-local IP to the interface manually and use that one for later Router Advertisement procedures. Change-Id: I09ef27f54940d4c47150e5f9016d1cd4298c16b5
2017-12-14Set tun_addaddr ipv agnostic and add support for ipv6Pau Espin Pedrol3-18/+193
sgsnemu (the only user of this API so far) has been modified to use the new API with in46_addr. FreeBSD code for IPv6 has not been tested. Change-Id: Ie36afe6eaf393855a4a708000ef4ad0192bf4767
2017-12-14tun.c: tun_addaddr: Fix segfault and wrong usage of tun_nlattrPau Espin Pedrol1-2/+3
First of all, dstaddr can be NULL, avoid copying it in that case. Second, we want to copy the addr data, not the pointer. I tested it and the IP was not added (not shown in ip addr) until I copied the content instead of the address. Change-Id: I8da637b155f0e913cab6c5b0dde355c9f33375b5
2017-12-14ggsn.c: Improve logging info on link-local ipv6 addr not foundPau Espin Pedrol1-3/+5
Change-Id: I18fb952514712ff30d18c7626f84309055d3efa1