Age | Commit message (Collapse) | Author | Files | Lines |
|
Make gtpie_gettlv() return an error if gtpie_getie() returned an error.
Previously, openggsn would fail to complain about certain missing elements.
Technically, a missing IE could be detectable from the *length value, but the
code in gtp.c relies on the return value to detect missing elements, which did
not work prior to this commit. For example:
if (gtpie_gettlv(ie, GTPIE_EUA, 0, &pdp->eua.l,
&pdp->eua.v, sizeof(pdp->eua.v))) {
gsn->missing++;
GTP_LOGPKG(LOGL_ERROR, peer, pack,
len, "Missing mandatory information field\n");
return gtp_create_pdp_resp(gsn, version, pdp,
GTPCAUSE_MAN_IE_MISSING);
}
If an EUA were missing in this code path, openggsn would fail to issue an error
message. Since pdp and hence pdp->eua.l is initialized as all-zero, it would
probably not do much harm besides failing to issue an error.
I haven't checked all callers though.
|
|
|
|
Sponsored-by: On-Waves ehi
|
|
Fix spelling/punctuation and one numbering in comments.
Remove an opening brace from a comment to not mix up cindent in vim.
Sponsored-by: On-Waves ehi
|
|
Fix spelling dublicate -> duplicate in comments and in (apparently only
statically used) gtp_dublicate().
Sponsored-by: On-Waves ehi
|
|
Fix: the code handles fd1u but prints fd1c.
|
|
Fix spelling dublicate -> duplicate.
This is potentially breaking API compat, but currently, no users of
gsn_t.dublicate are known.
|
|
It would print the memory location of the address buffer. Instead, print the
human readable host address and port.
The current code base supports only IPv4, and thread safety is apparently not
required, hence just use inet_ntoa(). (The IPv6 and thread capable version is 4
times longer and harder to read.)
|
|
|
|
|
|
Make libgtp depend on libosmocore and use the generic logging
infrastructure for it.
|
|
|
|
Encapsulate code to handle the teid with GTPv0.
|
|
This field needs to be in network byte order as well.
|
|
struct gtp0_header needs __attribute__((packed)) to make sure that
gcc doesn't add a hole of 4 bytes to align the 64-bits teid, resulting
in 24 bytes instead of 20 bytes. This was breaking gtpv0 in my gprs
testbed with my x86_64 laptop.
While at it, add also attribute packed to other headers just to
make sure that gcc doesn't pad the structures with holes.
|
|
This is fixing various compiler warnings:
In file included from sgsn_libgtp.c:49:0:
include/gtp.h:397:48: warning: ‘struct ul66_t’ declared inside parameter list [enabled by default]
include/gtp.h:397:48: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default]
include/gtp.h:398:49: warning: ‘struct ul66_t’ declared inside parameter list [enabled by default]
include/gtp.h:399:53: warning: ‘struct ul16_t’ declared inside parameter list [enabled by default]
include/gtp.h:400:53: warning: ‘struct ul16_t’ declared inside parameter list [enabled by default]
include/gtp.h:397:48: warning: ‘struct ul66_t’ declared inside parameter list [enabled by default]
include/gtp.h:397:48: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default]
include/gtp.h:398:49: warning: ‘struct ul66_t’ declared inside parameter list [enabled by default]
include/gtp.h:399:53: warning: ‘struct ul16_t’ declared inside parameter list [enabled by default]
include/gtp.h:400:53: warning: ‘struct ul16_t’ declared inside parameter list [enabled by default]
|
|
|
|
|
|
|
|
|
|
This makes it a bit more explicit about what is the 'user API' of the
code and what is just used internally.
|
|
|
|
this fixes some compiler warnings
|
|
After so many years of silence, we don't expect the original author to
return to the project. To make things a bit simpler for us, we convert
the coding style to what we are used to (Linux style).
The conversion was made using the 'Lindent' script which is part of the
Linux kernel.
|
|
According to 3GPP TS 29.060 recovery is optional, add command line option --norecovery to remove this field in sgsnemu
Signed-off-by: Yann BONNAMY <yann_bonnamy@yahoo.fr>
Signed-off-by: Harald Welte <laforge@gnumonks.org>
|
|
Routing Area Information is an optional Field described in 3GPP TS 29.060 7.7.3
it can be added with command line option rai, in the dot separated format MCC.MNC.LAC.RAC
example : --rai 208.10.65535.255
Signed-off-by: Yann BONNAMY <yann_bonnamy@yahoo.fr>
Signed-off-by: Harald Welte <laforge@gnumonks.org>
|
|
fix ggsn handling of create pdp context when RAI is included and Recovery field is absent
Signed-off-by: Yann BONNAMY <yann_bonnamy@yahoo.fr>
|
|
I use OpenGGSN to create/update/delete PDP context and I found a bug
in the implementation: when the sgsnemu sends an "update PDP context"
request, it receives back a "create PDP context" response. Below is
the correction I made, I hope it helps.
|
|
The cb_recovery() callback enables the user application to detect
a change in the restart counter and thus start the appropriate
recovery procedures.
|
|
This adds support for the followng new GTP Information Elements:
RAT_TYPE, USER_LOC, MS_TZ, IMEI_SV
Furthermore, it allows to specify those fields as sgsnemu command line
arguments.
|
|
Relevant output of make:
gtp.c: In function ‘log_restart’:
gtp.c:697: warning: ignoring return value of ‘fscanf’, declared with
attribute warn_unused_result
Signed-off-by: Emmanuel Bretelle <chantra@debuntu.org>
|
|
|
|
Pointers are not always 4 bytes in size...
|
|
|
|
in front of Cisco and Alcatel GGSN's, we meet the following error :
5 packets transmitted
Disconnecting PDP context #0
openggsn[24940]: gtp.c: 2417: Unexpected cause value received: 193. Packet from 172.29.5.130:2123, length: 14, content: 32 15 00 06 00 00 00 01 04 02 00 00 01 c1
it is because in the sgsnemu requests packet, the teardown field is after the NSAPI field :
No. Time Source Destination Protocol Info
24 10.940094 172.21.5.1 172.29.5.130 GTP Delete PDP context request
Frame 24 (58 bytes on wire, 58 bytes captured)
Ethernet II, Src: HewlettP_55:23:8d (00:11:0a:55:23:8d), Dst: Alcatel-_f6:8e:32 (00:d0:95:f6:8e:32)
Internet Protocol, Src: 172.21.5.1 (172.21.5.1), Dst: 172.29.5.130 (172.29.5.130)
User Datagram Protocol, Src Port: gtp-control (2123), Dst Port: gtp-control (2123)
GPRS Tunneling Protocol
Flags: 0x32
Message Type: Delete PDP context request (0x14)
Length: 8
TEID: 0x00000739
Sequence number: 0xbc02
N-PDU Number: 0x00
Next extension header type: No more extension headers (0x00)
[--- end of GTP header, beginning of extension headers ---]
NSAPI: 0
Teardown Indicator: True
[Response In: 25]
Taken from http://sourceforge.net/tracker/index.php?func=detail&aid=2865662&group_id=68956&atid=522957
|
|
Mostly signed/unsigned and typecasting issues
Taken from http://sourceforge.net/tracker/index.php?func=detail&aid=1811517&group_id=68956&atid=522957
|
|
This is taken from http://sourceforge.net/tracker/index.php?func=detail&aid=1811511&group_id=68956&atid=522957 and http://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg402969.html and addresses a DoS:
The problem lies in the parsing of information elements in GTP messages, which
is implemented in the gtpie_decaps function of gtp/gtpie.c file.
The implementation has a bug that does not check if there are too many
information elements in the message thus causing the software to loop
infinitely in the while-loop.
In addition, handling routine for the error situation had to be implemented
outside the while-loop.
|
|
All those will be re-generated by "autoreconf -i" anyway, so
there's no point in keeping them in the repository.
Also, the 'bootstrap' script is no longer working with recent
autotools versions anyway.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|