Age | Commit message (Collapse) | Author | Files | Lines |
|
This allows better control on how the counters are ticked.
For instance, since nowadays the writing in ns2_udp is done
asyncrhonously, most probable failures occur at a later point and not
when returning to the caller.
Change-Id: I8109cee07f157ebf1806f82a071f58de3a2dcc9c
|
|
As a result libosmogb doesn't depend directly on libmnl anymore, but
through libosmocore.
Change-Id: Ib0e499e09c50135a5c4a361332d6120f660a1a45
|
|
The OS#4993 has nothing to do with AF_PACKET/ENOBUFS,
the proper ticket is OS#4995 as referenced later in the same file.
Change-Id: Icf13b351dc74508fc312c535d68b13b7ce9b7e1e
|
|
Fix typo and remove any reference to GRE from gprs_ns2_fr.c.
GRE code is in gprs_ns2_frgre.c
Change-Id: I51c756f3c9d918552591bf87861cb4799721ac37
|
|
The frame relay needs 2 byte for data packets.
Related: OS#5192
Change-Id: I02d4e81896a473aeb79ea2f2983e12324244048f
|
|
Ensure all nsvcs ids are unique as UDP ids might not be unique when
multiple NSVCs connect to the same remote endpoint (multiple binds).
Change the format of all ids to look similiar.
FR: NSE11-NSVC23-FR-fr0-DLCI13.
UDP: NSE11-NSVC-UDP-10.0.0.1:23000-192.168.1.1:24000
UDP: NSE11-NSVC23-UDP-10.0.0.1:23000-192.168.1.1:24000
UDP: NSE11-NSVC66-UDP-[fd01::1]:23000-[fd03::2]:24000
Change-Id: I618e263e73fcc64d4e46b57aa3a2cb2783837907
|
|
Generated with spatch:
"""
@@
expression E1, E2;
@@
- &E2->ctr[E1]
+ rate_ctr_group_get_ctr(E2, E1)
"""
"""
@@
expression E1, E2, E3;
@@
- E2->items[E1]
+ osmo_stat_item_group_get_item(E2, E1)
"""
Change-Id: I41297a8df68e28dfc6016330ac82b0ed5dd0ebc1
|
|
The binds also print a list of associated NSVC when
dumping the bind.
However the binds using their own representation of
printing the NSVC which is different to `show ns entities`.
Use the same function to print NS-VC.
Before:
NSVCI 00000: udp)[127.0.0.1]:23000<>[127.0.0.1]:22000
After:
NSVCI none: UNCONFIGURED DYNAMIC data_weight=1 sig_weight=1 udp)[127.0.0.1]:23000<>[127.0.0.1]:22000
Change-Id: If31ec6c1c07dc134ab1ddeb915bc89747c7be048
|
|
When the MTU of the frame relay device changes, update the bind
and notify all NSEs.
Related: OS#4889
Change-Id: I946f7655c9526ffd98dabdce219c6a419b71e00c
|
|
The BSSGP layer needs to know the MTU of the NS UNIDATA payload.
The MTU can be 0 if the NSE doesn't contain any NSVC.
Every status indication will contain the mtu value.
The MTU in the status indication contains the maximum transfer
unit of a BSSGP message. From NS side the maximum SDU.
Related: OS#4889
Change-Id: I5016b295db6185ec131d83089cf6c806e34ef1b6
|
|
<0026> gprs_ns2_fr.c:515 BIND(hdlcnet1) Can not create AF_PACKET socket. Are you root or have CAP_NET_RAW?
=================================================================
==3872359==ERROR: AddressSanitizer: heap-use-after-free on address 0x6130000030c0 at pc 0x7fef120aa92e bp 0x7ffebf6b5c20 sp 0x7ffebf6b5c18
READ of size 8 at 0x6130000030c0 thread T0
#0 0x7fef120aa92d in osmo_fr_link_free (/usr/local/lib/libosmogb.so.11+0x16992d)
#1 0x7fef1205105a in free_bind (/usr/local/lib/libosmogb.so.11+0x11005a)
Change-Id: I23c0f1697edd5734085fa18b0a2f253c0f206c53
|
|
The followign happens if osmo-gbproxy is started without CAP_NET_RAW:
<0026> gprs_ns2_fr.c:515 BIND(hdlcnet1) Can not create AF_PACKET socket. Are you root or have CAP_NET_RAW?
gprs_ns2_fr.c:176:2: runtime error: member access within null pointer of type 'struct msgb' AddressSanitizer:DEADLYSIGNAL
the second line is free_bind() iterating overr the backlog while
destroying the not-yet-fully-initialized bind.
Let's make sure the backlog llist_head is always initialized properly.
Change-Id: I4d2fa50955c5897cd469fee68d4ddc65a9f5688f
|
|
When writing to the AF_PACKET socket, we have to distinguish the
pseudo-errors like -ENOBUFS (where we do want to add to the backlog)
from real errors like -ENETDOWN, -EMSGSIZE, ... where we don't want
to add the failed packet to the backlog.
Change-Id: Ibbb6805da0f118466c4c91e458e62b63b84cb794
|
|
This patch improves the behavior of the newly-added backlog in
situations where the interface goes up/down.
* don't add new packets to the backlog while if_running == false
* flush the backlog on both ifup and ifdown events
Change-Id: Ib35d099526544fe2cff64566fd56147a906adab9
|
|
There's not really any point in storing multiple LMI messages,
and then transmitting them in inverse order, as the existing code
does. Instead, we shall store only the last (failed) LMI message
and try to transmit that at highest priority, before any NS messages
in the actual queue.
Change-Id: I5407a76a34d7e687966fe1a915febf3a87256593
|
|
Change-Id: I80f72ada15b477d735bf5aee36a5d67e80eb0136
|
|
All bind function should work in the same way.
Also fixing a null pointer assignment if no **result is giving.
Change-Id: Idd0c2190d2af39804c18c4786a997079db9a4330
|
|
There's no point in sending NS-RESET (or any other) messages to the
underlying FR layer if the FR DLC has not been marked as
available/active yet.
Change-Id: Id4e7565ba166ca1d12f8800c643d9f2bc4d66873
Closes: OS#4999
|
|
Change-Id: Iec19db4e48642c3fcb0aa11fa7787b8323fd0e5a
Related: Os#4999
|
|
The backlog length indicates the instantaneous length of the backlog.
Change-Id: I1c55b4619b1221d7e607ace58649323407faf86b
|
|
ENOSPC is used with non-volatile (disk) storage, while ENOMEM is
customarily used for RAM allocation failures.
Change-Id: Ia4c16d8278dc30c7cc69169b18428cda5272738d
|
|
Avoid code duplication between three different drivers by sharing
the "core" of the bind initialization in a new, shared ns2_bind_alloc().
Change-Id: I535fc68e94fcd695de827dd922706adc1c5a2cb7
|
|
When the FR code decides to drop a packet (ENOBUFS from the AF_PACKET
socket for non-signaling packet), let's report that back via the
frame_relay code into the generic NS2 code.
This way the generic NS2 code always knows if a packet was actually
successfully transmitted, or if it was dropped for some reason.
Change-Id: I4bb517fd04af69dbe6da628b132d57994ab3e5a4
|
|
AF_PACKET sockets cannot be written-to using select(), as they
will always return "writable" but then still fail with ENOBUFS.
This also means that we cannot use osmo_wqueue() as it assumes
that a writable socket can actually be written to.
As there's no way to figure out when exactly we can again perform
a successful write, we have no other option but to start a timer
and re-try at a later time.
We will scale that timer based on the estimated duration of transmission
for the just-failed PDU on the line rate of a 31TS E1 Line.
Furthermore, with this patch, we stop queueing anything but signaling
traffic (NS-BVCI=0) or Q.933 LMI. User data (NS-BVCI != 0) will
instead be dropped in order to avoid buffer-bloat.
Change-Id: I4f79a246236c94175ceffa5f3f556c8931c6bc62
Closes: OS#4995
|
|
Related: OS#4995
Change-Id: I2ba64e96c60e23d2e6c8ecdcab0b52b3833f092c
|
|
write_queue expects a -errno value on error, not '-1'.
Change-Id: I93c858facfe7e1c533df8dccc4502a574686bc8a
Related: OS#4995
|
|
All public enum should have the prefix GPRS_NS2_.
API change which must be synchronized with osmo-pcu,
osmo-gbproxy, osmo-sgsn.
Change-Id: I548ff12f7277cbb7e1a630a3dc02b738ce89be72
|
|
All functions which are exposed by gprs_ns2_internal.h should not contain
the public prefix gprs_. Internal function should only contain ns2_ prefix.
Change-Id: Icecc5a918902cd10efac72bbac20780d39aab272
|
|
Let's avoid open-coding the printing of log context and rather rely on
log macros to prefix each log line with the relevant context. This
helps log readability, log post processing whether by grep or more
sophisticated tools.
Change-Id: I946c0e77686d91efc5afb62031e1ac1033a9a586
|
|
Usually talloc_free() and other free functions in osmocom allows
to be called with NULL which is then ignored.
Change-Id: If7b0c6916a29d4611d0a40c388414076eb83e6b5
|
|
Add a OSMO_ASSERT to all bind calls which doesn't
check if the bind is from the expected type.
The only exception is rx and tx functions (hot path).
Change-Id: Ia4f8932263c60618c7f0dfc32d50ba5a8d57602b
|
|
Log output without a proper identifier is mostly useless.
Change-Id: Id9d5b0684584d03685900c6298fe70246793de14
Closes: OS#4876
|
|
gprs_sn2_fr_connect2() is the same as gprs_ns2_fr_connect() with
the lookup-and-create-on-demand of the NSE first.
Rather than copy+paste, they should simply invoke each other.
Change-Id: If835bf138f213e7f58205018e7efe3ecb772c624
|
|
Change-Id: Ie52bf8ac6d62e7f2d760294bf2fe90119cc96b4b
Related: CID#215869
|
|
Related: SYS#5153 OS#4835
Change-Id: Ia1046db9e0d50855bff9de670b612ffc57af9995
|
|
Reduce the required capabilities if the device is already
set up.
Change-Id: I72eb2567078758694c648a493324b212461ee735
|
|
When a dahdi device hasn't been set up yet, ioctl IF_GET_PROTO fails
with invalid argument.
Also fix the device check to skip ioctl's if the device is also in the
correct state.
Change-Id: I398d056546e35465a2944e1b4a86a8c93b3e5f7a
|
|
Change-Id: I8ce461ecc36a81a4221336e82a36a69f49f89a0a
|
|
gprs_ns2_fr.c:448:2: error: ‘strncpy’ specified bound 16 equals destination size [-Werror=stringop-truncation]
448 | strncpy(req.ifr_name, netif, IFNAMSIZ);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Change-Id: Ied9fd1bea091075fad266258da39e674d10d4dcb
|
|
A hdlc can be used in different modes. Also a FR device can be used
with lmi and certain settings as without it.
ns2 will use FR with no lmi in the kernel.
Related: SYS#5169
Change-Id: I04786d2b864860b08c2e1afdb199470f4b80cc3b
|
|
Related: SYS#5228
Change-Id: Id6eba04d5fb744f791b333c168729bbbd28cabd9
|
|
This use of strncpy() fails to account for the terminating nul
character. Use OSMO_STRLCPY_ARRAY() instead.
(Interestingly my compiler doesn't complain about this one, though it
failed on another similar use of strncpy().)
Change-Id: Id53e940c7a39ab154966548f4173a179c5bc9151
|
|
My gcc (Debian 8.3.0-6) 8.3.0 refuses to build this strncpy() use: it
issues the buffer length as n and thus potentially fails to account for
the terminating nul. The line after that fixes the problem, so it's not
an actual bug. Anyway, we have a policy to never use strncpy(), and have
osmo_strlcpy() and OSMO_STRLCPY_ARRAY() for this.
This strncpy() was introduced last month during first addition of
gprs_ns2_fr.c:
commit 841817ec52186029ca01f0c082ed84f2dc5ffcc5
ns2: add support for frame relay
Change-Id Id3b49f93d33c271f77cd9c9db03cde6b727a4d30
Change-Id: I494a6fb7ccd7938a39e8956f73ec4282da38d7fb
|
|
When a frame relay interface doesn't exist gprs_ns2_fr_bind() would
detect this but still return a success.
Change-Id: I815b6ef5c3df780ac94461a05975a2b70898b01e
|
|
Change-Id: I277b805e588ba68536789b4a64a428ea0b31728a
|
|
The nsvc isn't change. It can be const
Change-Id: Ie5052f02781d7fdc639456c6f02515a927cee1f3
|
|
Add gprs_ns2_fr_connect2() and change gprs_ns2_fr_connect() to
be similar to gprs_ns2_ip_connect() and gprs_ns2_connect2().
This is an API break but there wasn't yet a release with NS2.
Change-Id: I4e1374b0e979b3293302c5ed46a91a58f3a5a916
|
|
Every bind will have a unique name. Add a name argument
to all bind creating functions and require them to be unique.
This is an API break but there wasn't yet a release with NS2.
Change-Id: I8f1d66b7b3b12da12db8b5e6bd08c1beff085b3e
|
|
A NS dialect describes how the NS Entity interacts with
different virtual circuits. E.g. ipaccess use reset/block on udp
and is a dynamic connection.
A single NS Entity can only support one dialect. This can be later
used to protect a NS Entity against dynamic NS virtual circuits of a
different type.
It further allows a bind to support multiple dialects at the same time.
Change-Id: Ia118bb6f994845d84db09de7a94856f5ca573404
|
|
When opening the socket, use ETH_P_HLDC to restrict the socket to
packet received on HLDC interfaces. This avoids packets from random
other (ethernet, ...) interfaces to appear before we can bind()
it to the actual hdlc-net-device we're interested in.
We still are racing against other HLDC net-devices, but those have
lower PPS and throughput ratese as 1G/10G or even higher speed ethernet
devices that might exist on the same machine.
Change-Id: I6a556e6e2d012c17a2777cc8b30fed0f318db178
|