RAW socket and CONFIG_FILTER | Unix Linux Forums | Programming

  Go Back    


Programming Post questions about C, C++, Java, SQL, and other programming languages here.

RAW socket and CONFIG_FILTER

Programming


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 05-05-2007
yannifan yannifan is offline
Registered User
 
Join Date: May 2007
Last Activity: 8 May 2007, 5:25 AM EDT
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
RAW socket and CONFIG_FILTER

Hi,
Im doin a project on DHCp client-server setup. i have to use RAW sockets in the code for this. The call PF_PACKET, SOCK_RAW as the first two arguments. The code compiles but when i try to start the Dhcp client, I get an error saying "Make sure CONFIG_PACKET and CONFIG_FILTER is enabled". I tried to build the kernel using a source tree. I found CONFIG_PACKET=y but didnt find CONFIG_FILTER. So i added a line CONFIG_FILTER=y. I got the foll error
Heres a full snapshot of the error :
bash-3.1# make
HOSTLD scripts/kconfig/conf
scripts/kconfig/conf -s arch/i386/Kconfig
.config:384:warning: trying to assign nonexistent symbol FILTER
#
# configuration written to .config
#
CHK include/linux/version.h
UPD include/linux/version.h
CHK include/linux/utsrelease.h
UPD include/linux/utsrelease.h
SYMLINK include/asm -> include/asm-i386
ln: creating symbolic link `include/asm' to `asm-i386': Operation not permitted
make: *** [include/asm] Error 1
bash-3.1#
How else can i add it? Is there ne other way out. Im using Fedora 6 with 2.6.20 source tree.

Pls help
Thanks in advance
Sponsored Links
    #2  
Old 05-05-2007
cbkihong cbkihong is offline Forum Advisor  
Advisor
 
Join Date: Sep 2002
Last Activity: 4 May 2014, 6:22 AM EDT
Location: Hong Kong, China
Posts: 1,622
Thanks: 0
Thanked 9 Times in 8 Posts
CONFIG_FILTER has been removed in kernel 2.6.x. Your programs will need to be updated to use another mechanism to compile on a 2.6 kernel, or fallback to use kernel 2.4 if you absolutely want it.

The closest substitute:
http://www.netfilter.org/projects/li...eue/index.html
Sponsored Links
    #3  
Old 05-06-2007
yannifan yannifan is offline
Registered User
 
Join Date: May 2007
Last Activity: 8 May 2007, 5:25 AM EDT
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Hi
Is there ne other way i can use the foll socket call in kernel 2.6.18 without getting the error message saying "make sure CONFIG_PACKET and CONFIG_FILTER is enabled in the kernel" :
sock = socket(PF_PACKET, SOCK_RAW, htons((short)ETH_P_ALL)

Thanks
    #4  
Old 05-06-2007
porter porter is offline Forum Advisor  
Registered User
 
Join Date: Jan 2007
Last Activity: 8 January 2008, 6:50 PM EST
Posts: 2,965
Thanks: 0
Thanked 5 Times in 5 Posts
Quote:
Originally Posted by yannifan
Im doin a project on DHCp client-server setup. i have to use RAW sockets in the code for this.
Is this an educational project and you are supposed to be on the receiving end?

Last edited by porter; 05-06-2007 at 03:57 AM..
Sponsored Links
    #5  
Old 05-06-2007
yannifan yannifan is offline
Registered User
 
Join Date: May 2007
Last Activity: 8 May 2007, 5:25 AM EDT
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
@porter
A bit of both. Its my project for graduation hence educational, but i have to finish it. so...

I did try the packages from netfilter.org
When i run the DHCP client, i get the foll messages :
May 6 13:33:20 localhost dhclient: socket: Invalid argument - make sure
May 6 13:33:20 localhost dhclient: CONFIG_PACKET (Packet socket) and CONFIG_FILTER
May 6 13:33:20 localhost dhclient: (Socket Filtering) are enabled in your kernel
May 6 13:33:20 localhost dhclient: configuration!
May 6 13:33:20 localhost dhclient:

So does this mean, filtering is enabled and i can run my project?
Thanks
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Clarification - Setting socket options at the same time when socket is listening jake24 IP Networking 2 04-19-2011 02:19 PM
Error with socket operation on non-socket vin_pll Programming 1 04-02-2010 07:42 AM
socket function to read a webpage (socket.h) cyler Programming 3 04-01-2010 03:32 PM
which socket should socket option on be set blademan100 Programming 1 03-04-2009 01:31 PM
connect problem for sctp socket (ipv6 socket) - Runtime fail Invalid Arguments chandrutiptur UNIX for Advanced & Expert Users 0 02-26-2009 07:09 AM



All times are GMT -4. The time now is 02:57 AM.