X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=tun.c;fp=tun.c;h=40bf6dd91d8de62c5474f7552d77acd4b2d3e3b7;hb=3abd18e85781e00e2b7fc641f29c99e130238abf;hp=b0bde38ea7405057fe448ac84e4a2d5e593c9bbc;hpb=779837e133a4740798015a1d7de6fbf6b4b1720f;p=secnet.git diff --git a/tun.c b/tun.c index b0bde38..40bf6dd 100644 --- 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()"); }