aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGjermund Hodnebrog <gjermund.hodnebrog@stericsson.com>2011-04-20 15:34:15 +0200
committerSverre Vegge <sverre.vegge@stericsson.com>2011-05-19 09:07:03 +0200
commit88b2023fc964c0b5fd047e9902683647cb20e37c (patch)
tree248463e6ce0036b9fea03962c5e4468c6d7bad46
parent60a1ed44f39659c5f75facdffb7bb722039258cb (diff)
downloadu300-88b2023fc964c0b5fd047e9902683647cb20e37c.tar.gz
PDP: Introduce flag to limit MTU
Setting flag RIL_MAX_MTU will limit MTU to specified value, the unit is bytes and the default value is 1500. Signed-off-by: Sverre Vegge <sverre.vegge@stericsson.com>
-rwxr-xr-xAndroid.mk6
-rw-r--r--u300-ril-pdp.c9
2 files changed, 12 insertions, 3 deletions
diff --git a/Android.mk b/Android.mk
index d32fd79..043b58b 100755
--- a/Android.mk
+++ b/Android.mk
@@ -85,6 +85,12 @@ ifneq ($(USE_EARLY_NITZ_TIME_SUBSCRIPTION),)
LOCAL_CFLAGS += -DUSE_EARLY_NITZ_TIME_SUBSCRIPTION
endif
+ifneq ($(RIL_MAX_MTU),)
+LOCAL_CFLAGS += -DRIL_MAX_MTU=$(RIL_MAX_MTU)
+else
+LOCAL_CFLAGS += -DRIL_MAX_MTU=1500
+endif
+
ifneq ($(USE_LEGACY_SAT_AT_CMDS),)
LOCAL_CFLAGS += -DUSE_LEGACY_SAT_AT_CMDS
endif
diff --git a/u300-ril-pdp.c b/u300-ril-pdp.c
index cd73d8a..a0b03ad 100644
--- a/u300-ril-pdp.c
+++ b/u300-ril-pdp.c
@@ -1106,8 +1106,11 @@ void requestSetupDataCall(void *data, size_t datalen, RIL_Token t)
int mtu = 0;
mtu = atoi(mtuStr);
- if (mtu > 1500)
- mtu = 1500;
+ /* Default value of RIL_MAX_MTU is 1500, see Android.mk for details */
+ if (mtu > RIL_MAX_MTU) {
+ mtu = RIL_MAX_MTU;
+ LOGI("%s(): MTU is overridden and limited to %d!", __func__, mtu);
+ }
if (mtu > 1) {
struct ifreq ifr;
@@ -1124,7 +1127,7 @@ void requestSetupDataCall(void *data, size_t datalen, RIL_Token t)
}
if (ioctl(ifc_ctl_sock, SIOCSIFMTU, &ifr)) {
- LOGE("%s() failed to set MTU to %s!", __func__, mtuStr);
+ LOGE("%s() failed to set MTU to %d!", __func__, mtu);
goto error__deactivate_pdp;
}