Age | Commit message (Collapse) | Author | Files | Lines |
|
Other similar commands already do it. This way we also get rid of
deprecated APIs, supporting search when more than one GSN is set up.
Related: OS#2873
Change-Id: I8357e20076348c8ded5e9f5b8e7252566b0fbfea
|
|
Fixes following ASan complaint during VTY "show running-config":
osmo-ggsn/ggsn/ggsn_vty.c:657:37: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
Change-Id: I2b8d163dbc108b0fb5a1e820dc23181835d12869
|
|
Replace calls to gtp_delete_context_req() with
gtp_delete_context_req2().
Related: OS#2741
Change-Id: Iecc8c5ac45207e7e20129559c4ac7f3c67dfb36a
|
|
This timer was added in osmo-ggsn.git
dda21ed7d4a897c9284c69175d0da598598eae40,
but it was never initially started since it was introducing, and as a
result retransmissions never being triggered.
Also as a consequence, gtp_retrans is never called. That function is
responsible from triggering retransmissions and to free old responses
waiting in the resp queue (to check for duplicates). Since it's never
called, the retransmit resp queue will grow over time.
Fixes: dda21ed7d4a897c9284c69175d0da598598eae40
Fixes: OS#3997
Change-Id: Ie4adc52829446539fbbb5e9e0cf75a04f91c7eea
|
|
Change-Id: I920679c7062d480c1cfaa3d89c90a0ed4a2ef58b
|
|
Instead of printing subscriber's MSISDN as a hex-string, let's
attempt to decode it using gsm48_decode_bcd_number2().
Change-Id: I3f3a105dc8d0d582f2b9d8e1ff6c5785369e569b
|
|
An actual APN can be different from the one that was requested by
user, e.g. when 'default-apn' VTY parameter is used. The one that
was requested is already being stored in the PDP context state.
Let's also store a chosen APN in create_context_ind().
Change-Id: I9cbe195f64e5b83d5158c175aad2e81ba2487850
|
|
Change-Id: I03d0eb266dca176f342e77a54f0291cc5bd7df43
|
|
Change-Id: Iad60de34c562803a1a1fc024287d1a60e071afab
|
|
Change-Id: I0a7f4b245c4664afdae83c660358acb1a5f88ce5
|
|
The existing PCO processing is implemented in a rather convoluted
way. We scan the list of PCO elements several times for different
PCO protocols. Let's change to a straight-forward model where we
simply do one iteration over the list of PCO elements and generate
responses step by step.
Change-Id: I4a7d09279b6b259e2b95f1f51159b16838b2d94c
|
|
When build_ipcp_pco() iterated over the PCO list, it didn't use
the "outer" pco length as an increment, but used the "inner" IPCP
length.
If an IPCP message with an invalid "inner" length was being processed
(see pcap file attached to OS#3914), the PCO iteration beyond that
broken IPCP would fail, possibly rendering false hits.
Let's make pco_contains_proto() return a pointer to the the pco_element,
so that the caller can use the outer length as an increment.
Change-Id: I8e9cffde092c8c5824abfaeecb742afcf949802c
Related: OS#3914
|
|
Let's remove some magic numbers and use a data structure instead.
Change-Id: I5b1abc6f403f85986407e9e8359924dfcb58031a
|
|
Change-Id: Ia0877988180ded4e3c033d7f1fb6e1c2acd60163
|
|
Let's remove some magic numbers and use a data structure to describe
the PCO element header.
Change-Id: I9871ffced677320aa82438332bfdb951ab129f04
|
|
Change-Id: I2a96b0fbe077c7c49342553de0880bfc58318669
|
|
Previously we've always returned error code from main() even in case of
regular expected shutdown. Let's not confuse it with actual error
shutdown and return 0 by default.
Change-Id: I7fe0d3e052953d5b87ce65649d88d83476fee3c0
|
|
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
|
|
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
|
|
Previosuly, the CTRL iface of osmo-ggsn was always bound to 127.0.0.1
Fixes: OS#3287
Change-Id: I9b2c1b310c7dc94ef09642f7f256ae259b41619d
|
|
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
|
|
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
|
|
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
|
|
Change-Id: I00cc8eb8c4d44532f975f78783ff4e12814b3416
|
|
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
|
|
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
|
|
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
|
|
Change-Id: Ic38fff17cc985238b91999c8acdd92d22fd28c72
|
|
This requires libosmocore with Change-Id
I43fc42880b22294d83c565ae600ac65e4f38b30d or later.
Change-Id: I460efff3a3dfa2c7d955871aca78b37552a29aff
|
|
Change-Id: I72602a78baa2a7e3412d8b69c1bf1b3ac0efa434
|
|
Change-Id: Ib3a87ec2b2d0014376295028a648750fa3124485
|
|
Change-Id: I4fc97f367ae615cdf0a9501f89419990c2fd4599
|
|
Change-Id: I0c57df17d91bade127027e03633494adb6f818c5
|
|
pdp_has_v4 only take into account IPv4 EUAs.
Change-Id: I1cf8d6548951e5732075beeea1412d12fb6bdec3
|
|
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
|
|
Closes: OS#2422
Change-Id: Ie658a7f161103bb6f631ab0508e45e55fb42a442
|
|
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
|
|
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
|
|
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
|
|
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
|
|
Change-Id: I18fb952514712ff30d18c7626f84309055d3efa1
|
|
Before this commit, when an MS requested an ipv4v6 context osmo-ggsn
returned an error stating the type was unknown, and this text was
printed in the log:
Processing create PDP context request for APN 'ims'
Cannot decode EUA from MS/SGSN: f1 8d
This patch has been tested with an MS running the 3 types of addresses:
- IPv4 and IPv6: no regressions observed, the context is activated and
packets are sent to the ggsn.
- IPv4v6: Wireshark correctly parses request and reponse, and then
ICMPv6 traffic from both sides. Finally I see the MS using the IPv4 and
IPv6 DNS addresses advertised and TCP traffic over IPv4 (because
probably my IPv6 network setup is not correct). I also checked I can
disable/enable data (pdp ctx delete and activate) several times without
any issue.
Change-Id: Ic820759167fd3bdf329cb11d4b942e903fe50af5
|
|
The existing code would abort iterating over the list of PCO TLVs
if a TLV of length zero was encountered. However, there's nothing
in the spec that would make a zero-length PCO invalid, so we should
continue to iterate over any PCO TLVs after the zero-length one.
This issue was discovered while writing test cases in
osmo-ttcn3-hacks.git
Change-Id: I36660566a8ee2ca80ae6ee99c86e167e7c208df2
|
|
... this probably didn't show up as 8.8.8.8 is dual-endian. doh!
The address was already in network byte order, but msgb_put_u32 "of
course" expects host byte order, ending up the wrong way in the actual
packets :/
Change-Id: Ia4bcac5fcebfc24760432eb66be258a01d78f65f
Closes: OS#2685
|
|
Change-Id: I6f7ce33f6585b2b78e2b8a5c0f7111f0316d6ddd
|
|
Change-Id: I7e226a12b074c96c572f90e3aaf62716d0cd47c5
|
|
Changes made as requested by the deprecation text.
Fixes warning below:
warning: ‘vty_install_default’ is deprecated: Now happens implicitly with install_node() [-Wdeprecat
ed-declarations]
vty_install_default(GGSN_NODE);
^~~~~~~~~~~~~~~~~~~
Change-Id: I5c6197129e0c251a4e8dd174027b011c8f6476c6
|
|
Change-Id: Iad0e7a9fa48fcddc31b8d555244581efdbd61b4e
|
|
This allows us to distinguish "add" from "del" operatons in the log
Change-Id: Ibe2e76a6eecc7b5fa5f44ab2c1578597138e30b9
|
|
SYS_ERR is for logging an error from the (operating) system including
the errno value. For general logging, we have DEBUGP/LOGP. Let's
convert the gtp-kernel logging over. This also fixes the related line
ending mess-up as SYS_ERR adds a LF while LOGP/DEBUGP don't.
Change-Id: Idb4069a28227b770e20d62bf306cd294f47146ae
|