Hi,
I was wondering if one may indeed have a version of diald that
works on both 2.0.x and 2.1.x kernels simultaneously. I think we can
do this using constructs like this:
#include <sys/utsname.h>
struct utsname myutsname;
int
main (argc, char **argv)
{
int retval = 0;
...
retval = uname(&myutsname);
if (retval) {
... error handling ...
}
...
}
filter.c
...
if (strcmp(myutsname.release, "2.1.0") > 0) {
if ((snoopfd = socket(AF_PACKET, SOCK_PACKET, htons(ETH_P_ALL))) < 0) {
syslog(LOG_ERR, "Could not get socket to do packet monitoring: %m");
die(1);
}
}
else {
if ((snoopfd = socket(AF_INET, SOCK_PACKET, htons(ETH_P_ALL))) < 0) {
syslog(LOG_ERR, "Could not get socket to do packet monitoring: %m");
die(1);
}
}
...
I think this would work for either 2.0.x kernels or 2.1.x ones. I
think that 0.16.6 should try to work with both versions, rather than
just working for one set of kernels.
comments?
manoj
--
Beware of a tall dark man with a spoon up his nose.
Manoj Srivastava <[EMAIL PROTECTED]> <http://www.datasync.com/%7Esrivasta/>
Key C7261095 fingerprint = CB D9 F4 12 68 07 E4 05 CC 2D 27 12 1D F5 E8 6E
-
To unsubscribe from this list: send the line "unsubscribe linux-diald" in
the body of a message to [EMAIL PROTECTED]