aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2017-10-13ippool: Implement and use blacklist instead of blindly using IPPOOL_NOGATEWAYpespin/ippoolPau Espin Pedrol10-40/+438
Commit dda21ed7d4a897c9284c69175d0da598598eae40 modified previous calls to ippool_new() removing the pass of flags to avoid allocating certain problematic IPs from the pool to MS, such as the network, gateway and broadcast IPs. Today I did some unsucessful tests with osmo-ggsn with a pool "ip prefix dynamic 176.16.222.0/24", and thus IP 176.16.222.0 was being assigned to the MS. De-capsulated DNS packets were received in the tun interface, but the Linux system in there was unable to correctly forward the packets to the gateway interface connected to the Internet. However, adding a second MS which got 176.16.222.1 had its packets forwarded correctly. However, previous implementation relies on flag IPPOOL_NOGATEWAY flag to blindly blacklist first IP after the network ip (ie, .0 and .1 are removed), which limits the IP reserved for the tun device to be .1. If a different IP in the range is assigned, it may cause issues. As a result, a blacklist is introduced in this commit to dynamically fetch the tun IP address and exlucde it from the pool of available IPs. Change-Id: I8e91f7280d60490c858a769dd578c1c8e54e9243
2017-10-13lib/ippool: Fix listsize calculated 1 elem too smallPau Espin Pedrol3-16/+21
Take the chance this commit is changing test output to also remove use of IPPOOL_NOGATEWAY which is going to be removed soon, and instead test IPPOOL_NOBROADCAST. Change-Id: I95c24bc690490155bec9e3933d678e4668d7745f
2017-10-13Remove trailing whitespacePau Espin Pedrol6-16/+16
Change-Id: I8e24f95a88bef3a59006a89c219871e6156963d7
2017-10-13tests: Makefile.am: Add missing osmocom includedirPau Espin Pedrol1-0/+2
Change-Id: Ibc2f98fe06366c94342831205fc741675dc2dda6
2017-10-13lib/tun.c: tun_ipv6_linklocal_get(): fix memory leak with getifaddrs()Pau Espin Pedrol1-0/+2
From getifaddrs(3) man: "The data returned by getifaddrs() is dynamically allocated and should be freed using freeifaddrs() when no longer needed" Change-Id: If6300d1c8d36fcafef294a4c11bbda31a158bb9c
2017-10-13tests: in46a_test: Add missing expected output filePau Espin Pedrol1-0/+6
Change-Id: I542f7a201df169b703519e800b1aab8deb95ea77
2017-10-13tests: Remove Makefile.inPau Espin Pedrol1-0/+0
Change-Id: Ie21e8bfab7cda52aa696dd26280efc05c4b51bba
2017-10-13add Unit test for lib/in46_addr.c codeHarald Welte3-2/+111
Change-Id: Id032c330405e5dca8ecfc0970d128341ed75c675
2017-10-13update .gitignoreHarald Welte1-12/+30
Change-Id: I030bd616dd27d49e55b5bdcc7c0b4fa3eb523da4
2017-10-13Add ippool unit-test for 'make check' runsHarald Welte9-1/+66755
This test creates a variety of v4 (and one v6) pool and performs allocations until the pool is full, then frees a random number of randomly distributed addresses, re-allocates them and again checks that they're all available and finally once the pool is full allocations fail. Change-Id: Ibf4588e8f3ae71684e5262c0caaa2689aee73a94
2017-10-11create_context_ind(): Fix crash on apn not foundPau Espin Pedrol1-2/+2
Program terminated with signal SIGSEGV, Segmentation fault. 0 create_context_ind (pdp=0xb6b391b0 <pdpa>) at /usr/src/debug/osmo-ggsn/1.0.0+gitrAUTOINC+ab5e160937-r0/git/ggsn/ggsn.c:453 453 if (!apn->started) (gdb) bt 0 create_context_ind (pdp=0xb6b391b0 <pdpa>) at /usr/src/debug/osmo-ggsn/1.0.0+gitrAUTOINC+ab5e160937-r0/git/ggsn/ggsn.c:453 1 0xb6b225e0 in gtp_create_pdp_ind (gsn=gsn@entry=0x74f28, version=version@entry=1, peer=0x0, peer@entry=0xbee6ead4, fd=-1092167056, fd@entry=8, pack=pack@entry=0xbee6eae4, len=len@entry=179) at /usr/src/debug/osmo-ggsn/1.0.0+gitrAUTOINC+ab5e160937-r0/git/gtp/gtp.c:1591 2 0xb6b245e4 in gtp_decaps1c (gsn=0x74f28) at /usr/src/debug/osmo-ggsn/1.0.0+gitrAUTOINC+ab5e160937-r0/git/gtp/gtp.c:2986 3 0x41d770c0 in osmo_select_main () from /usr/lib/libosmocore.so.8 4 0x000121b8 in main (argc=4, argv=0xbee70e54) at /usr/src/debug/osmo-ggsn/1.0.0+gitrAUTOINC+ab5e160937-r0/git/ggsn/ggsn.c:897 Fixes: dd266066c7cc96c797034da352cc9d72177c5780, b16c46b4c36383368eb1581e40d0a8ca751ddc53 Change-Id: Ie4ec74e87aaf1d067dd1717d986673be56c4d6ed
2017-10-10sgsnemu: Add IPv6 support via tun device and "-t v6 --createif"Harald Welte1-12/+61
The idea is to only implement the GTP-C plane and configure the right link-local source address on the tun-device and let the regular (Linux) kernel take care of sending router solicitations and accepting/processing the related router advertisement. This avoids a lot of complexity in sgsnemu. For this to work, you must have /proc/sys/net/ipv6/conf/$tun/accept_ra set to either 1 (works only if no IPv6 forwarding/routing configured on your sgsnemu-running system) or 2 (works even if forwarding/routing is configured). Change-Id: I57e4c53ee648e1efecfba3eea592d1129849557c Closes: OS#2518
2017-10-01Merge "create_context_ind(): ignore a non-started default APN"Harald Welte1-0/+5
2017-10-01create_context_ind(): ignore a non-started default APNHarald Welte1-0/+5
If the default APN has not been started, it is not eligible to be used in starting of new PDP contexts. Change-Id: I93b5c205c033f275824ee8bc8cdcf1428fb086df
2017-10-01sgsnemu: Allow specification of PDP (EUA) Type IPv4 or IPv6Harald Welte4-2/+44
This just adds the capability to sgsnemu to request a certain PDP EUA type. It doesn't mean it actually handles anything beyond the existing IPv4 yet. Change-Id: I157f9157a7ff2ea56c37a4a902d4706de4c7d35d
2017-10-01Replace EUA magic numbers for IETF, IPv4 and IPv6 with #definesHarald Welte4-12/+17
Change-Id: I33f65e404217e717bd795e5229c8d9456a7b3739
2017-10-01apn_start(): Extend error message when setting IPv6 address failsHarald Welte1-1/+2
Tell the user about possible causes of failure to set the IPv6 address of the tun device, such as general lack of IPv6 support in the kernel/OS, or the use of /proc/sys/net/ipv6/conf/default/disable_ipv6 Change-Id: I5ff812425ee12b8386bb66521e05c93e825a4506
2017-10-01apn_stop(): Print tun device name when closing tun deviceHarald Welte1-1/+1
Change-Id: If981cc0696122cb69c01ceac6f54ae01bcbf4a2d
2017-10-01create_context_ind(): ignore any non-started APNsHarald Welte1-0/+3
If we receive a GTP-C CREATE PDP CONTEXT for an APN that we were unable (or not configured) to start, ignore that APN. Change-Id: I8011a9ccc1d5effd3779f184c9055af46838ccaf
2017-10-01apn_start(): fix clean-up after errors bringing up APNHarald Welte1-3/+0
When there's an interim error (e.g. in resolving the link-local address or setting up the tun device), apn_start() simply calls apn_stop() on the not-yet-fully-started apn_ctx. This only works if apn_stop() doesn't bail out early in case of a not-started apn_ctx, so let's remove the related check at the start of the function. Change-Id: I2917a6258cb73cc12fd9d81296ff0eaa616890b9
2017-09-27contrib: osmo-ggsn.service: Use expected suffix for cfg filePau Espin Pedrol1-1/+1
files in doc/examples/ dir end with .cfg, as well as all configuration files present in all projects. Change-Id: I361c67809d095dd08b0f400de2a6f84f981411c5
2017-09-25Move extended PDP logging macro to headerMax3-2/+5
It might be useful for any user of libgtp who uses libosmocore so let's make generalized version of it available as part of installable header. Change-Id: I79aba10ef989384a28f059c30899e65c771ae5e1 Related: SYS#3610
2017-09-24Merge "sgsnemu: Add --no-tx-gpdu-seq option to suppress transmission of ↵Harald Welte4-1/+39
G-PDU sequence numbers"
2017-09-24Merge "ggsn: Add per-APN VTY configuration option on G-PDU sequence numbers"Harald Welte3-0/+31
2017-09-24sgsnemu: Add --no-tx-gpdu-seq option to suppress transmission of G-PDU ↵Harald Welte4-1/+39
sequence numbers Related: OS#2519 Change-Id: Idc650d896f0f72329090b56a37d9c16359294860
2017-09-24libgtp: Allow each PDP context to specify if it transmits G-PDU sequence numbersHarald Welte4-6/+23
GTP sequence numbers on GTP-U are optional for G-PDU type messages (i.e. user-ip messages). Let's allow the user to specify this behavior by a new pdu_t.tx_gpdu_seq flag. The flag is enabled by default to stay compatible with the prior behaviour. Related: OS#2519 Change-Id: Icf22a2ddd5c4a968ef5bda7c202b921d93fb49e6
2017-09-24ggsn: Add per-APN VTY configuration option on G-PDU sequence numbersHarald Welte3-0/+31
This per-APN vty option determines if we are transmitting GTP sequence numbers in downlink G-PDU messages. This behavior is optional as per GTP spec. The default behavior is "true", like before this change. Related: OS#2519 Change-Id: Ibf0de261f83951309b01b4feae998b6656c77664
2017-09-24Merge "ggsn: Fix double whitespace in writing "ifconfig" lines"Harald Welte1-2/+2
2017-09-24ggsn: Fix config file writing of IPv6 DNS settingsHarald Welte1-1/+1
There was a copy+paste mistake that created syntax errors during the write of a config file that contained IPv6 DNS server settings. Change-Id: Ida40c32c72dba8155f8294b93484e46e8bd27739
2017-09-24ggsn: Fix double whitespace in writing "ifconfig" linesHarald Welte1-2/+2
This is merely a cosmetic issue, no functional change. Change-Id: I8663ee633524eedeed5ddd45ddb65a06825052ac
2017-09-24ICMPv6: Send router advertisement from own link-local addressHarald Welte6-10/+59
I'm not quite sure how I ended up doing this, but for some strange reason the code before this commit is sending the ICMPv6 Router Advertisements from some weird non-standard source address. This is a violation of RFC4861 which clearly states that the source address of router advertisements "MUST be the link-local address assigned to the interface from which this message is sent." Change-Id: Ib444af70fc8f0b433d371281601fd5a37b29039e
2017-09-24gtp: Avoid magic numbers when operating on GTP header flagsHarald Welte2-26/+40
Let's introduce a couple of #defines that make the code much more readable. Change-Id: I3635d679fd54507274b46e99a02bdbbe41d7684e
2017-09-24libgtp: Avoid extra memcpy() in gtp_data_req() by using sendmsg()Harald Welte1-29/+20
Adresses two "TODO Should be avoided" comments about an extra memcpy() before sendto() that can be replaced by a single sendmsg() call with an iovec array: 1 record for the GTP header + 1 record for the user payload. Change-Id: Ie332a6b15972330fcf540753898eb84ecb84fe24
2017-09-24sgsnemu: Fix gengetopt package nameHarald Welte3-8/+5
gengetopt by default picks the program name from PACKAGE (autotools), which is osmo-ggsn and is obviously wrong in case of sgsnemu. After this patch, "sgsnemu --help" no longer shows "osmo-ggsn" but "sgsnemu" at the top of the help text. Change-Id: Ifabc2435a503ef71aa5a002ca46833f329068b37
2017-09-24sgsnemu: Re-generate cmdline.[ch] using gengetoptHarald Welte4-1400/+1419
This will replace the manual additions to cmdline.[ch] with auto-generated code from gengetopt. We need to fix-up the RAT Type in sgsnemu.c as the manually-added code diverged from what gengetopt generates. Change-Id: Ia687e13d5cec1655a57078a767d2123aa022842c
2017-09-24sgsnemu: Fix up gengetopt file for --norecoveryHarald Welte1-0/+1
In commit 3a4c67b4bf0067c4949a60bc750d01e0576c5e08 we introduced the --norecovery command line option, but this was apparently done by manually editing the C source code rather than adding it to the .ggo and letting gengetopt do its magic. Let's fix this up. Change-Id: I1698280a699b17cea65651c3736ef149aba7e432
2017-09-24sgsnemu: Fix up gengetopt file for RAIHarald Welte1-0/+1
In commit 41af5691ef08fb70e2c65aba03c8b9e6c20983a6 we introduced the --rai command line options, but this was apparently done by manually editing the C source code rather than adding it to the .ggo and letting gengetopt do its magic. Let's fix this up. Change-Id: Iaab404c3bcfc0c3943764f6616763f4f407d5644
2017-09-24sgsnemu: Fix up gengetopt file for rattype, userloc, mstz, imeisvHarald Welte1-0/+4
In commit 944dce3e66f3bc5b74f24dfbbee2370a231a39a9 we introduced various command line options, but this was apparently done by manually editing the C source code rather than adding it to the .ggo and letting gengetopt do its magic. Let's fix this up. Change-Id: Ib8e7ef1cad5fc4423a1a4af628950aa93a4e073a
2017-09-24sgsnemu: Fix up gengetopt file for QoS Extensions of 24.008Harald Welte1-1/+5
In commit 11a398fbc3ad9b655d8ba947bea7012f7ce81604 we introduced the --qose{1,2,3,4} command line options, but this was apparently done by manually editing the C source code rather than adding it to the .ggo and letting gengetopt do its magic. Let's fix this up. Change-Id: I4cd827a96ac17f6eb9f824342f195727426d0e20
2017-09-24sgsnemu/cmdline.ggo: Remove 'unsigned' which is no longer supportedHarald Welte1-3/+3
It seems like modern gengetopt no longer supports 'unsigned int' argument types, and we need to use 'int' instead. tested with 2.22.6 Change-Id: I34ca86cb3cc482400a7c4b3bf77c8668aaef562e
2017-09-15Fix leftovers after renameMax3-4/+4
* Use proper name in jenkins test * Fix naming in systemd service * Fix git-review config Change-Id: I934f897002215d7d4e610cbd312383181bbe97c9
2017-09-06ggsn: Add ability to specify local IP addresses for GTP-C and GTP-UHarald Welte3-4/+50
In case the GGSN is behind some kind of DNAT, the public GTP-C and GTP-U IP addresses as exposed inside the GTP payload information elements are different from the (internal, behind-nat) IP address to which it listens/binds. Change-Id: I548c9011c9abd66d46f963b1def61575f3dabb89
2017-09-06Bump version: 0.94.34-23e4 → 1.0.01.0.0Harald Welte1-2/+2
Change-Id: I00a00a7d537fd3c1ff8f8fe128c5bf82d39bda76
2017-09-06libgtp: Bump major LIBVERSION for recent API/ABI breakageHarald Welte1-1/+1
in Change-Id I68ae49a765828fa681054c68bf7f5e74dbe48ad2 we introduced a new struct member that breks ABI and API. Change-Id: Ie631880155513b1b78d1e9dd473dc5dc50e05943
2017-09-06clarify relationship of OsmoGGSN to OpenGGSN.Harald Welte1-2/+2
Change-Id: If0e18fb02a7dcc472f5f5fbfaf53a107382ef7e5
2017-09-06debian: fix name of config fileHarald Welte1-1/+1
Change-Id: I9e563d41b74c334fd98bb71fad946e93f214fa34
2017-09-06debian: Remove no longer existing NEWS file from 'docs'Harald Welte1-1/+0
Change-Id: Ieb319ea29179ed97d746e13a9e63b3ceea2b917a
2017-09-06debian: Fix debian/copyright syntaxHarald Welte1-5/+5
Change-Id: I819ca05440cca041f26e7800821f4763f887c08b
2017-09-06Move examples to doc/examples and include them in DISTHarald Welte8-4/+28
Change-Id: I0846e21ac63774939934ab629c6d7212269be9a6
2017-09-06remove bogus 'version' scriptHarald Welte1-24/+0
Change-Id: I3977cd4777aa4cf37a1d6e21eba0bc37d61421f3