AgeCommit message (Collapse)AuthorFilesLines
2020-10-23Implement ICMP response for inactive IP address.keith/icmpKeith1-5/+84
Send ICMP Host Unreachable packets back on the tun device in reponse to a packet received for an IP address that is not active in our pool (No active pdp context) Only IPv4 implemented. Change-Id: Ia2c708feab14bb4cada00b0a90e0cb56d680d1aa
2020-10-18Use OSMO_FD_* instead of deprecated BSC_FD_*Harald Welte1-6/+6
Change-Id: Ib660cbbeafd8f4077c693d53127ecd1c15455455
2020-10-12contrib/jenkins: Enable parallel make in make distcheckPau Espin Pedrol1-2/+2
Change-Id: Id7d4e6682be1d4f77979e896089b42f35548ca98 Related: OS#4421
2020-10-12GTP: Replace recently introduced imsi_str2gtp()Keith4-16/+25
Replace with the version from osmo-sgsn, renamed so as not to collide with that version. Change-Id: I910d5339a823332277ce7b5854d5c943ed69ea81
2020-10-12sgsnemu: relax check on length of IMSI cmdline arg.Keith1-1/+1
Change-Id: I0374ff8773ae528c916fbee5f3f1efd89a5d2a08
2020-10-12Use imsi_str2gtp() in sgsnemuKeith1-16/+1
Change-Id: I94168c84dd613cfe51715e247b0d8b57308017d0
2020-10-12Minor: remove code duplicationKeith1-3/+1
Change-Id: Id18ebcd3b3c20ce28e383edf9354e9f8516e1e81
2020-10-12Prevent Crash in show pdp-context from vtyKeith1-1/+1
Fix test for return value from gtp_pdp_getimsi() so we do not call show_one_pdp() with an uninitialised pdp_t Change-Id: Ic40429939b185f97c020dd3904e054fe860b91e8
2020-10-12Fix vty PDP lookups by IMSIKeith3-1/+21
The PDP context is searched on the hash which is generated on context creation from the IMSI in gtp format. - A hash created from "human-readable" IMSI does not match. Check user input for length then convert the IMSI to gtp format before continuing. Change-Id: Icd2e2bc6068c06fbf5d5fe905ebcda8954f33f04
2020-08-18Support setting rt-prio and cpu-affinity mask through VTYPau Espin Pedrol6-4/+49
Change-Id: Ic8d38a5f64c661ce650004c68d73bd77149caef4 Depends: libosmocore.git Change-Id If76a4bd2cc7b3c7adf5d84790a944d78be70e10a Depends: osmo-gsm-masnuals.git Change-Id Icd75769ef630c3fa985fc5e2154d5521689cdd3c Related: SYS#4986
2020-08-18doc: Update VTY reference xml filePau Espin Pedrol1-5/+30
Change-Id: I2e8bebb67e63000c6f571a23baec04a68fc2974e
2020-08-18configure.ac: Fix trailing whitespacePau Espin Pedrol1-1/+1
Change-Id: Ia7b0ff11e58375842be15823d6b5dcaafc0f1f82
2020-08-13debian/control: change maintainer to the Osmocom team / mailing listVadim Yanitskiy1-1/+1
Change-Id: Ia93dd2bf84ebb2c4d11917021888d4c6a5085d50
2020-08-13Bump version: → Welte1-0/+57
Change-Id: I2248595ca11f4d808d38a9e25e7c3d3b64134427
2020-07-07gtp: queue_test: Fix printf gcc warn under ARMPau Espin Pedrol1-2/+3
queue_test.c:39:3: warning: format '%ld' expects argument of type 'long int', but argument 9 has type 'unsigned int' [-Wformat=] Change-Id: Ie9530cdd191386ca3f6c336684f81c4582c4d962
2020-05-23example config: use RFC1918 addresses for GGSN poolsHarald Welte1-4/+4
It's 172.16, not 176.16. Change-Id: I2d83ee747e8987f10c4960d42f3c3f2a723e3f4c
2020-05-22Makefile.am: EXTRA_DIST: debian, contrib/*.spec.inOliver Smith1-1/+9
Change-Id: Ie9cc3da87dea413408c82b721875e89735a47fcf
2020-05-19contrib: integrate RPM specOliver Smith3-6/+9
Remove OpenSUSE bug report link, set version to @VERSION@, make it build with CentOS 8 etc. Related: OS#4550 Change-Id: Iba04d5c7b9beee80baca83063f9cb2cd533a0003
2020-05-15contrib: import RPM specOliver Smith1-0/+123
Copy the RPM spec file from: https://build.opensuse.org/project/show/home:mnhauke:osmocom:nightly Related: OS#4550 Change-Id: I50a93d2cde429974b059bafd38befa9a189c0e8a
2020-05-15osmo-ggsn.spec.in: removeOliver Smith3-93/+1
Remove old osmo-ggsn.spec.in file from 2017 in favor of the one imported from mnhauke, which is currently used in openSUSE nightly builds (will be added in a follow-up commit). Related: OS#4550 Change-Id: I24794564f0d4d85d3955ab08f4e4c3c05f53a0cd
2020-05-12debug: use LOGL_NOTICE instead of LOGL_DEBUGPhilipp Maier1-1/+1
In debug.c the log category DICMP6 uses LOGL_DEBUG as default. This is way to verbose, lets use LOGL_NOTICE instead. Change-Id: I4c6a9165114d1240e7e2cfa98d30d571a3f4e9d2 Related: OS#2577
2020-04-28sgsnemu: use real tun device name after the device is up.Dmitri Kalashnik1-4/+4
The device name option could be empty, using it without checking would crash sgsnemu. Using the real device is better anyway. Change-Id: Ic3934281bfc2e433323e4ab72cf5be2cbd1c962a
2020-04-21sgsnemu: Fix assumption ipv6 Interface-Identifier of public addr == ↵Pau Espin Pedrol1-41/+53
announced Prefix Until now, sgsnemu was able to identify pdp contexts of incoming packets in the tun based on the assumption that the Interface-Identifier part of public IPv6 addresses in incoming packets was equal to the announced prefix path during Create Pdp Context Response (see changes in cb_tun_ind()). This assumption works fine with osmo-ggsn due to implementation details but breaks on other spec-conformant GGSNs. In order to fix it, a new placeholder struct pdp_peer_sgsnemu_ctx is introduced which will be assigned to each pdp_t "peer[0]" user-defined pointer. This way, each pdp_t ctx upgrades from having only 1 iphash_t item to 3 (hence being able to match against 3 different ip addresses). This way, in IPv6 we can match against 2 different IP addresses set on the tun iface: * link-local: "fe80::IfId", where IfId is the Interface-Identifier received during Pdp Context Resp and which can be used to communicate with the nearest router (the GGSN). * global: The global IPv6 addr set after SLAAC procedure, containing a the prefix announced by CreatePdpContextResp/RouterAdvertisement and an Interface-Identifier chosen by sgsnemu itself (currently ::ff). This change is also a step forward towards supporting IPv4v6 APNs in sgsnemu. Related: OS#4434 Change-Id: I0d36145250185e4cce699fdaedfe96bd969f5fa1
2020-04-21sgsnemu: Implement ping on IPv6 APNsPau Espin Pedrol3-51/+234
Related: OS#4434 Change-Id: If9ca7c37a1a397bbc3f8912d67bccdabc4968e0c
2020-04-21sgsnemu: Handle IPv6 SLAAC in tun iface manuallyPau Espin Pedrol6-118/+307
Disable IPv6 automatic SLAAC by linux kernel and handle it manually. This allows us gaining control on local address acquisition and set addresses and routing properly. It will also allow us to run in ping mode without a tun iface. Related: OS#4434 Change-Id: Iae59cf6ffb181357e10b3080a5c751bd454f4a1f
2020-04-19sgsnemu: Fix build/run against linux < 4.11 (no sysctl addr_gen_mode support)Pau Espin Pedrol2-5/+20
On older systems (like debian 8), the enum is not present in the header file and build will fail (as saw in osmocom's OBS instance). Furthermore, the sysctl to change the value was added at a later point in time, which means compiling can go fine but running may fail due to the sysctl not being available. This is a fix-up to Change-Id I1d51f3ca91edbb3b788939982ab63264182ec2ce Change-Id: I208970d5b16ea7148444d414b0a6f68c8d9a086c
2020-04-15Rename netdev_*route to end in route4Pau Espin Pedrol4-15/+19
Functions for IPv6 will be added soon afterwards. Also take the chance to check for address length in sgsnemu and only apply the route if the address matches. Change-Id: Ic6c1b3c11c56f047e6e8c6f1040257fd62afea0f
2020-04-15icmpv6.c: Move code generating ipv6 hdr to its own functionPau Espin Pedrol1-16/+25
It will be re-used in next commits. Change-Id: I3c108efad6461cd4e82ef435290005174bc8b30e
2020-04-15sgsnemu: tun_addaddr: Don't set local addr as dstaddrPau Espin Pedrol1-1/+1
That should be used for point-to-point destination address. Change-Id: Iead7e9c7570ba6a9de3089a164997b1db81dc59a
2020-04-15sgsnemu: Get rid of duplicated options.netPau Espin Pedrol1-7/+4
It's not really set by any cmdline arg, and it always contains same content as options.netaddr. Change-Id: Id3cdca0975bdd2893b4b83944c5ebf29b2994622
2020-04-15sgsnemu: Get rid of duplicated options.destaddrPau Espin Pedrol1-6/+3
It's not really set by any cmdline arg, and it always contains same content as options.netaddr. Change-Id: I5a4e3c4b5ae43a89a7d0af62fb396311dcb6ebae
2020-04-15icmpv6.c: Mark internal function as staticPau Espin Pedrol1-1/+1
Change-Id: Ib38907c3a05c1651faa86ef57381ee22643e0d53
2020-04-15cosmetic: icmpv6.c: fix typo in commentPau Espin Pedrol1-1/+1
Change-Id: I2217dfb0b0a1e6e029ac817902e80c771ed219c3
2020-04-15sgsnemu: Fix ping transmitted statistics outputPau Espin Pedrol1-1/+1
Change-Id: I6e23e024ee30d6049c6b8b614c50d062d80a5260
2020-04-15sgsnemu: Avoid adding extra autogenerated local link ipv6 addr to tun ifacePau Espin Pedrol1-0/+47
It's not needed because a link-local address will be added as a result of Create Pdp Context Response. Morevoer, it fools sgsnemu ip addr verifications since it gets used on some scenarios by applications. Change-Id: I1d51f3ca91edbb3b788939982ab63264182ec2ce
2020-04-14doc: use instead of as bind ip.Philipp Maier1-1/+1
The example config for osmo-sgsn suggests to use as bind ip. (the ip-address where the SGSN tries to connect) Lets use instead to match the default config of osmo-sgsn. Change-Id: I513ab64896dee47fd92dbc5ef495fe1c6e734ec3
2020-04-14lib/netns: Fix up error pathsHarald Welte1-20/+54
The error handling in the code was doing exactly what one would not expect. If we switch to a netns and then encounter an error, we obviously have to switch back to the original netns before returning. Likewise, if we temporarily change the signal mask, we need to switch back to the original one before returning. Change-Id: I9ff5ae7bffc5bd7629dae0af1b72cfea548f9039
2020-04-14netdev_addaddr6: Use prefixlen argPau Espin Pedrol1-1/+1
The parameter was simply unused until this change was made. An Ipv6 can have a prefix length between 48 and 64 bits. Change-Id: I4b1512d5a4d7bbc2516221ea6808565eac0eb18f
2020-04-14lib/netns: OSMO_ASSERT() if user doesn't call init_netns()Harald Welte1-1/+13
It is vital that init_netns() is called first in order to initialize default_nsfd. Change-Id: Ic16646fa7d60c578056b17351c5fe2090a81dff0
2020-04-14lib/netns.c: Add comments to the code, including doxygen API docsHarald Welte1-0/+45
Change-Id: I0b20e4870bf62df0a459a621a64a4e2795340ceb
2020-04-14Move icmpv6 and checksum files from ggsn/ dir to lib/Pau Espin Pedrol7-6/+6
They will be required by sgsnemu to implement ICMPv6 Router Soliciations. Change-Id: Ie878604f0fc0169cc98a1e9eee64b14d76be2c45
2020-04-14sgsnemu: Set its default loglevel category to INFOPau Espin Pedrol1-1/+1
sgsnemu is a testing program and doesn't have a VTY iface to configure its log levels, so let's simply enable INFO as a default. Change-Id: I2a577f547b57fb0ab7b83de5c12da088697f3904
2020-04-14sgsnemu: Rename sgsnemu's libgtp cb_confPau Espin Pedrol1-2/+2
It makes it easier to understand where the function is called. Change-Id: Ibf32b416c3247d1415aa9c1a88755076dcd606f4
2020-04-14sgsnemu: Pass array of in64_addr to in46a_from_eua()Pau Espin Pedrol1-30/+34
Let's avoid buffer-overflow writing into out-of-bounds memory in the event the GGSN sends us 2 EUAs in Create PDP Context Respose. It should theoretically happen since we don't yet support ipv4v6 APNs in sgsnemu, but who knows. Change-Id: I8becd90ce1f0e8bb6e21438c04da4a9cab845492
2020-04-14configure.ac: fix libtool issue with clang and sanitizerEric1-0/+5
As pointed out at https://github.com/libexpat/libexpat/issues/312 libtool does not play nice with clang sanitizer builds at all. For those builds LD shoud be set to clang too (and LDFLAGS needs the sanitizer flags as well), because the clang compiler driver knows how linking to the sanitizer libs works, but then at a later stage libtool fails to actually produce the shared libraries and the build fails. This is fixed by this patch. Addtionally LD_LIBRARY_PATH has no effect on conftest runs during configure time, so the rpath needs to be set to the asan library path to ensure the configure run does not fail due to a missing asan library, i.e.: SANS='-fsanitize=memory -fsanitize-recover=all -shared-libsan' export CC=clang-10 ASANPATH=$(dirname `$CC -print-file-name=libclang_rt.asan-x86_64.so`) export LDFLAGS="-Wl,-rpath,$ASANPATH $SANS $LDFLAGS" Change-Id: Icc09c9d09bfa01264ddf867356d068e50d97c5a0
2020-04-08sgsnemu: cmdline: Drop unused function cmdline_parser_params_create()Pau Espin Pedrol2-15/+0
Change-Id: I7d5d69f104d24aafd4aa0b7289bb8b3fa1d77ed4
2020-03-25doc: do not use random ip address for dns in default confPhilipp Maier1-4/+4
The default configuration has a random ip-address as first DNS server. This might cause unnedessary trouble for people who try osmo-ggsn the first time. Lets have some public DNS here, just to be sure. Change-Id: I5876a806185bb3aea356fb6996d1925b8d0d1758
2020-03-03lib/netns: fix open_ns(): return fd from open()Vadim Yanitskiy1-1/+1
Looks like a bug introduced by I9b9c8fd6eeaaa7d190b8e2a34ca82088904c7708. Change-Id: I38caf5541ca90638ed10714adfbb08120e5397b9 Fixes: CID#208656
2020-03-02netns: Improve error checkingPau Espin Pedrol3-65/+132
Change-Id: I9b9c8fd6eeaaa7d190b8e2a34ca82088904c7708
2020-02-26add Linux network namespace support for TUN deviceAndreas Schultz7-12/+294
Change-Id: Idd0ad8fa9c8e7ba0aeec1b52947598d4d297b620