> > One question I've long had on this code is why we use copymsg() rather > > than dupmsg(). > > In the STREAMS model, I seem to recall that dupmsg() is used rather than > copymsg() (so db_ref > 1) leading to "snoop" recording NAT'd or half-NAT'd > packets rather than what comes from the wire unless you do a copymsg() > and freemsg() before doing any NAT.
Barring bugs, I don't see where that difference in behavior would come from. The only difference between copymsg() and dupmsg() is that the latter is equivalent to copy-on-write semantics. Of course, if there's code that modifies the buffer without first checking db_ref, then using dupmsg() would lead to problems -- but any such code would be a bug. -- meem _______________________________________________ networking-discuss mailing list [email protected]
