From 8a70eedfc5d35e3aee9137ee6a31564dc88ec187 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Thu, 28 May 2020 14:15:29 +0200 Subject: [PATCH] Raspbian MTU setting --- README.md | 9 +++++++++ TAP.c | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b3bc628..813861c 100644 --- a/README.md +++ b/README.md @@ -111,3 +111,12 @@ tnc0: flags=4305 mtu 400 TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 ``` +## Known Issues + +The utility fails to set the interface MTU on some Raspbian versions. After attaching the TNC, check that the correct MTU has been set on the interface with ifconfig or similar. If not, you can set it manually with a command like: + +```sh +# Attach interface +ifconfig tnc0 mtu 478 + +``` \ No newline at end of file diff --git a/TAP.c b/TAP.c index 77e432c..7b5c834 100644 --- a/TAP.c +++ b/TAP.c @@ -50,7 +50,7 @@ int open_tap(void) { cleanup(); exit(1); } else { - if (ioctl(inet, SIOCGIFFLAGS, &ifr) < 0) { + if (ioctl(inet, SIOCGIFMTU, &ifr) < 0) { perror("Could not get interface flags from kernel"); close(inet); cleanup();