Created
April 12, 2013 15:02
-
-
Save pawitp/5372673 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From e289a7f5e1acf9557e7bc25c6f2642619c310849 Mon Sep 17 00:00:00 2001 | |
From: Pawit Pornkitprasan <p.pawit@gmail.com> | |
Date: Fri, 12 Apr 2013 11:40:15 +0700 | |
Subject: [PATCH] libnetutils: add ifc_set_mtu | |
Change-Id: I3031e9ee38583648350f2c46baa7a9a714b9ea1e | |
--- | |
libnetutils/ifc_utils.c | 16 ++++++++++++++++ | |
1 files changed, 16 insertions(+), 0 deletions(-) | |
diff --git a/libnetutils/ifc_utils.c b/libnetutils/ifc_utils.c | |
index 240b5f3..4741651 100644 | |
--- a/libnetutils/ifc_utils.c | |
+++ b/libnetutils/ifc_utils.c | |
@@ -985,3 +985,19 @@ int ifc_get_mtu(const char *name, int *mtuSz) | |
return -1; | |
} | |
+ | |
+// Required for Broadcom RILD | |
+int ifc_set_mtu(const char *name, int mtuSz) | |
+{ | |
+ struct ifreq ifr; | |
+ int ret; | |
+ ifc_init_ifr(name, &ifr); | |
+ ifr.ifr_mtu = mtuSz; | |
+ | |
+ ret = ioctl(ifc_ctl_sock, SIOCSIFMTU, &ifr); | |
+ if (ret < 0) { | |
+ printerr("ifc_set_mtu: SIOCSIFMTU failed: %d\n", ret); | |
+ } | |
+ | |
+ return ret; | |
+} | |
-- | |
1.7.3.4 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I m beginnier. Can u tell me how to do this..plz..