summaryrefslogtreecommitdiffstats
path: root/mtu.c
diff options
context:
space:
mode:
authorjunyulai <junyulai@google.com>2018-11-26 22:36:10 +0900
committerjunyulai <junyulai@google.com>2018-12-11 10:12:47 +0800
commitc4e591aa04552541a8ae63af00541baa9046858b (patch)
tree7f8d90d2ec6145679c647e8759bb47e509663d26 /mtu.c
parent3850bee1d5dd1eae3c28ce09f8e4bd0c7099c5a8 (diff)
downloadplatform_external_android-clat-c4e591aa04552541a8ae63af00541baa9046858b.tar.gz
platform_external_android-clat-c4e591aa04552541a8ae63af00541baa9046858b.tar.bz2
platform_external_android-clat-c4e591aa04552541a8ae63af00541baa9046858b.zip
Re-indent clatd code with clang-format
clang-format --style file -i *.{c,h,cpp} Bug: 118848635 Test: 1. browse over ipv6-only network 2. atest clatd_test 3. clang-format --style file -i *.{c,h,cpp} Change-Id: I7389426101df7745370d0ac5c55176cd8fe2b08b
Diffstat (limited to 'mtu.c')
-rw-r--r--mtu.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/mtu.c b/mtu.c
index 975bf0e..567d177 100644
--- a/mtu.c
+++ b/mtu.c
@@ -16,12 +16,12 @@
* mtu.c - get interface mtu
*/
-#include <string.h>
+#include <net/if.h>
#include <stdlib.h>
-#include <sys/types.h>
-#include <sys/socket.h>
+#include <string.h>
#include <sys/ioctl.h>
-#include <net/if.h>
+#include <sys/socket.h>
+#include <sys/types.h>
#include "mtu.h"
@@ -34,12 +34,12 @@ int getifmtu(const char *ifname) {
struct ifreq if_mtu;
fd = socket(AF_INET, SOCK_STREAM, 0);
- if(fd < 0) {
+ if (fd < 0) {
return -1;
}
strncpy(if_mtu.ifr_name, ifname, IFNAMSIZ);
if_mtu.ifr_name[IFNAMSIZ - 1] = '\0';
- if(ioctl(fd, SIOCGIFMTU, &if_mtu) < 0) {
+ if (ioctl(fd, SIOCGIFMTU, &if_mtu) < 0) {
return -1;
}
return if_mtu.ifr_mtu;