File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -281,15 +281,14 @@ func (d *readVDispatcher) io(fds *fds) (bool, tcpip.Error) {
281
281
}
282
282
283
283
if settings .Debug {
284
- log .VV ("ns: tun(%d): dispatch: start iov: %d" , fds .tun (), len (iov ))
284
+ log .VV ("ns: tun(%d): dispatch: start; iov: %d" , fds .tun (), len (iov ))
285
285
}
286
286
287
287
start := time .Now ()
288
288
289
289
// github.com/google/gvisor/blob/d59375d82/pkg/tcpip/link/fdbased/packet_dispatchers.go#L186
290
290
n , errno := rawfile .BlockingReadvUntilStopped (fds .eve (), fds .tun (), iov )
291
291
292
- fds .read .Add (int64 (n )) // update read bytes
293
292
fds .lastRead .Store (time .Now ().UnixMilli ()) // update last read time
294
293
295
294
if settings .Debug {
@@ -304,6 +303,8 @@ func (d *readVDispatcher) io(fds *fds) (bool, tcpip.Error) {
304
303
return abort , tcpip .TranslateErrno (errno )
305
304
}
306
305
306
+ fds .read .Add (int64 (n )) // update read bytes
307
+
307
308
b , ok := d .buf .pullBuffer (n ) // not thread safe
308
309
if ! ok {
309
310
log .E ("ns: tun(%d): dispatch: pullBuffer err; n: %d" , fds .tun (), n )
You can’t perform that action at this time.
0 commit comments