chiark / gitweb /
site: Negotiate (configurable) MTU
[secnet.git] / tun.c
diff --git a/tun.c b/tun.c
index b0bde38ea7405057fe448ac84e4a2d5e593c9bbc..40bf6dd91d8de62c5474f7552d77acd4b2d3e3b7 100644 (file)
--- a/tun.c
+++ b/tun.c
@@ -116,8 +116,8 @@ static void tun_afterpoll(void *sst, struct pollfd *fds, int nfds)
     }
     if (fds[0].revents&POLLIN) {
        BUF_ALLOC(st->buff,"tun_afterpoll");
-       buffer_init(st->buff,st->nl.max_start_pad);
-       l=read(st->fd,st->buff->start,st->buff->len-st->nl.max_start_pad);
+       buffer_init(st->buff,calculate_max_start_pad());
+       l=read(st->fd,st->buff->start,st->buff->len-calculate_max_start_pad());
        if (l<0) {
            fatal_perror("tun_afterpoll: read()");
        }