@@ -187,7 +187,7 @@ func (d *readVDispatcher) stop() {
187
187
d .stopFd .stop ()
188
188
// TODO: should close tun-fd before stopFd?
189
189
err := syscall .Close (d .fd )
190
- log .I ("ns: stop: fds closed event(%d) tun(%d); err? %v" , d .efd , d .fd , err )
190
+ log .I ("ns: dispatch: stop: fds closed event(%d) tun(%d); err? %v" , d .efd , d .fd , err )
191
191
}
192
192
193
193
const abort = false // abort indicates that the dispatcher should stop.
@@ -196,7 +196,7 @@ const cont = true // cont indicates that the dispatcher should continue delive
196
196
// dispatch reads one packet from the file descriptor and dispatches it.
197
197
func (d * readVDispatcher ) dispatch () (bool , tcpip.Error ) {
198
198
done := d .closed .Load ()
199
- log .V ("ns: dispatch: done? %t" , done )
199
+ log .V ("ns: tun(%d): dispatch: done? %t" , d . fd , done )
200
200
if done {
201
201
return abort , new (tcpip.ErrAborted )
202
202
}
@@ -208,7 +208,7 @@ func (d *readVDispatcher) dispatch() (bool, tcpip.Error) {
208
208
209
209
n , err := rawfile .BlockingReadvUntilStopped (d .efd , d .fd , iov )
210
210
211
- log .V ("ns: dispatch: got(%d bytes), err(%v)" , n , err )
211
+ log .V ("ns: tun(%d): dispatch: got(%d bytes), err(%v)" , d . fd , n , err )
212
212
if n <= 0 || err != nil {
213
213
if err == nil {
214
214
err = new (tcpip.ErrNoSuchFile )
@@ -235,7 +235,7 @@ func (d *readVDispatcher) dispatch() (bool, tcpip.Error) {
235
235
// IP version information is at the first octet, so pulling up 1 byte.
236
236
h , ok := pkt .Data ().PullUp (1 )
237
237
if ! ok {
238
- log .W ("ns: dispatch: no data!" )
238
+ log .W ("ns: tun(%d): dispatch: no data!" , d . fd )
239
239
pkt .DecRef ()
240
240
return cont , nil
241
241
}
@@ -245,13 +245,13 @@ func (d *readVDispatcher) dispatch() (bool, tcpip.Error) {
245
245
case header .IPv6Version :
246
246
p = header .IPv6ProtocolNumber
247
247
default :
248
- log .W ("ns: dispatch: unknown proto!" )
248
+ log .W ("ns: tun(%d): dispatch: unknown proto!" , d . fd )
249
249
pkt .DecRef ()
250
250
return cont , nil
251
251
}
252
252
}
253
253
254
- log .V ("ns: dispatch (from-tun) proto(%d) for pkt-id(%d)" , p , pkt .Hash )
254
+ log .V ("ns: tun(%d): dispatch: (from-tun) proto(%d) for pkt-id(%d)" , d . fd , p , pkt .Hash )
255
255
256
256
go func () {
257
257
d .e .InjectInbound (p , pkt )
0 commit comments