2000-12-08 12:48:50

by Alexander Riesen

[permalink] [raw]
Subject: PROBLEM: SO_DETACH_FILTER has no parameters, but is checked to have some

SO_DETACH_FILTER does not accept any parameter, but code in sock.c check for it.

Problem description:
Trying to remove attached filter i got EINVAL (and the filter was left
The code setsockopt(fd, SOL_SOCKET, SO_DETACH_FILTER, 0, 0) is correct,
but does work.
Looking in sock.c i have found that SO_DETACH_FILTER is set after checking
parameters of an option. It is not correct in this particular case
(it should be handled like SO_DONTLINGER).
Search for: SO_DETACH_FILTER in sock.c
The problem persists up to 2.4.0-test10.

int dummy;
setsockopt(fd, SOL_SOCKET, SO_DETACH_FILTER, &dummy, sizeof(int));

Keywords: networking filter setsockopt SO_DETACH_FILTER

-- Versions installed: (if some fields are empty or looks
-- unusual then possibly you have very old versions)
Linux ws018 2.2.17 #6 Thu Nov 16 12:30:28 CET 2000 i686 unknown
Kernel modules 2.3.11
Gnu C 2.95.2
Linux C Library 2.1.3
Dynamic linker ldd: version 1.9.11
Procps 2.0.6
Mount 2.10f
Net-tools 2.05
Console-tools 0.2.3
Sh-utils 2.0
Modules Loaded 3c59x nls_koi8-r ntfs smbfs vfat fat nls_iso8859-2 nls_iso8859-1 nls_cp866 binfmt_misc autofs nfs lockd sunrpc nbd

Sincerely yours,
Alexander Riesen