Skip to content

Commit

Permalink
[ril] Don't limit MTU for non-MMS contexts
Browse files Browse the repository at this point in the history
Larger MTU means better throughput, and the original problem for which
this workaround was implemented was specific to MMS. There's no reason
to limit MTU for other data connections.
  • Loading branch information
monich committed Jun 3, 2021
1 parent cfb75f4 commit ea36baa
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions ofono/drivers/ril/ril_gprs_context.c
Expand Up @@ -29,7 +29,7 @@

#define CTX_ID_NONE ((unsigned int)(-1))

#define MAX_MTU 1280
#define MAX_MMS_MTU 1280

struct ril_gprs_context_call {
struct ril_data_request *req;
Expand Down Expand Up @@ -108,8 +108,15 @@ static void ril_gprs_context_set_active_call(struct ril_gprs_context *gcd,
if (call) {
ril_data_call_free(gcd->active_call);
gcd->active_call = ril_data_call_dup(call);
if (!gcd->mtu_watch) {
gcd->mtu_watch = mtu_watch_new(MAX_MTU);
if (ofono_gprs_context_get_type(gcd->gc) ==
OFONO_GPRS_CONTEXT_TYPE_MMS) {
/*
* Some MMS providers have a problem with MTU
* greater than 1280. Let's be safe.
*/
if (!gcd->mtu_watch) {
gcd->mtu_watch = mtu_watch_new(MAX_MMS_MTU);
}
}
mtu_watch_set_ifname(gcd->mtu_watch, call->ifname);
ril_data_call_grab(gcd->data, call->cid, gcd);
Expand Down

0 comments on commit ea36baa

Please sign in to comment.