tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: tap(4) interface management



>>> Whether the mode applies to the fd or to the tap device is an open
>>> question.  The former makes more sense; I would expect the latter
>>> to be easier to do.  In practice I don't expect there's much
>>> difference.
> I think there is no difference because there can be only one fd per
> device with tap anyway

Not quite; consider dup() and fork().

However, there actually are three places the mode could, in principle,
be kept: (1) the fd; (2) the open file entry; (3) the tap device.
dup() and fork() and friends create new fds referring to the same open
file entry (the difference between fds and open file entries is not
very visible; the commonest case I can think of where it's visible is
that a seekable fd's lseek pointer is kept in the opne file entry
rather than the fd).

If tap control devices are exclusive-open, then assuming there is at
most one open file entry per tap device is reasonable, in which case
not worrying about the distinction between (2) and (3) is equally
reasonable.

/~\ The ASCII                             Mouse
\ / Ribbon Campaign
 X  Against HTML                mouse%rodents-montreal.org@localhost
/ \ Email!           7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B


Home | Main Index | Thread Index | Old Index