LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 04-23-2015, 07:25 AM   #1
nathan2225
LQ Newbie
 
Registered: Jun 2006
Posts: 27

Rep: Reputation: 0
Multicast filtering on socket level ?


I tried to distinguish between incoming multicast packets by creating different sockets, where at each socket I set
setsockopt (s, SOL_SOCKET, SO_REUSEADDR, ....) on all interfaces and then

setsockopt (fd, IPPROTO_IP, IP_ADD_MEMBERSHIP,
for just a single Multicast address
to allow only this multicast destination address to be received.
All packets arrive at the same port.

However this seems to do not work, all sockets receive all multicast packets given by the sum of added membership. So for me it looks like, the multicast filtering takes place on ip layer, not unique socket layer.

Does someone know a different solution ?

If know, I could use
setsockopt(fd, IPPROTO_IP , IP_PKTINFO , &enable, sizeof(enable));

and then walk over the attributes and filter for destination address, but this is rather big effort ...

Thank you

Last edited by nathan2225; 04-23-2015 at 08:02 AM.
 
Old 04-24-2015, 02:28 PM   #2
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,867

Rep: Reputation: 162Reputation: 162
At socket layer, the packet can't be filtered. If you want to filter packet, such as multicast, the net filter have to be used.
 
1 members found this post helpful.
Old 04-25-2015, 02:31 AM   #3
nathan2225
LQ Newbie
 
Registered: Jun 2006
Posts: 27

Original Poster
Rep: Reputation: 0
Wink

Oh well, i feared that, thanks 4 reply !
So let's parse attributes !
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
linux kernel level socket programming yethish Programming 1 07-05-2011 03:05 AM
Kernel doubles the size of requested buffer on a multicast socket for SO_RCVBUF madhavancha Linux - Kernel 1 03-28-2011 02:28 PM
Multicast socket with linux bridge helenalinux Linux - Networking 1 05-19-2010 12:37 AM
Testing Multicast Packet filtering linuxunix Linux - Newbie 3 03-31-2010 02:52 AM
MAC-Level Filtering Siva4Linux Linux - Wireless Networking 5 10-17-2006 02:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:16 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration