Set MTU too.
authorDavid Woodhouse <David.Woodhouse@intel.com>
Sun, 28 Sep 2008 08:17:54 +0000 (09:17 +0100)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Sun, 28 Sep 2008 08:17:54 +0000 (09:17 +0100)
From the server's response, rather than what we asked the server for.

tun.c

diff --git a/tun.c b/tun.c
index 497bb6c..9dffae8 100644 (file)
--- a/tun.c
+++ b/tun.c
@@ -79,6 +79,10 @@ int setup_tun(struct anyconnect_info *vpninfo)
                        addr->sin_addr.s_addr = inet_addr(cstp_opt->value);
                        if (ioctl(net_fd, SIOCSIFNETMASK, &ifr) < 0)
                                perror("SIOCSIFNETMASK");
+               } else if (!strcmp(cstp_opt->option, "X-CSTP-MTU")) {
+                       ifr.ifr_mtu = atol(cstp_opt->value);
+                       if (ioctl(net_fd, SIOCSIFMTU, &ifr) < 0)
+                               perror("SIOCSIFMTU");
                }
                cstp_opt = cstp_opt->next;
        }