On Mon, Nov 06, 2006 at 03:17:17PM -0800, Josh Carroll wrote: > >I suggest you use /etc/protocols rather than hard code the protocols. > >This will make the code future-proof. See getprotoent(3) for the > >correct way to read /etc/protocols. > > Thanks Peter, that's a great idea. Below is a new patch that uses > getprotoent(3). For now, to maintain backward compatibility, I've > defined a default list of protocols (tcp, udp, divert), in the event > -P is not specified. This should retain the normal command line > behavior. > > Thanks again for the suggestion. > > Dmitry - with this change, diver is now the default but can also be > specified as an argument to -P as well.
On other suggestion I'd have it to consider using strsep to parse the string. I'm pretty the code will be smaller and more readable. -- Brooks
pgpWuaE79OFf9.pgp
Description: PGP signature