LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 11-17-2015, 07:18 AM   #1
vjanandr85
LQ Newbie
 
Registered: Nov 2015
Posts: 3

Rep: Reputation: Disabled
IPV6_PKTINFO on GRE tunnel interfaces in linux


I am trying to know the interface a packet (multicast) is received on.
Setting the sockopt with IPV6_PKTINFO works well when the packet is received on the physical interface but the cmsg is empty when the packet is received on a GRE tunnel interface.

I have tried with individual sockets for each of the interface but in case of a multicast packet, the packet is received on all sockets and hence I need to identify exactly on which interface the packet was received on.
So the only option to me seems to be to get that information from ip6_pkt_info.

Please let me know how do I go about this.
 
Old 11-20-2015, 03:41 PM   #2
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,838

Rep: Reputation: 160Reputation: 160
What socket do you use, raw_socket?
 
Old 11-21-2015, 12:21 AM   #3
vjanandr85
LQ Newbie
 
Registered: Nov 2015
Posts: 3

Original Poster
Rep: Reputation: Disabled
This is on a UDP socket, AF_INET6.
 
Old 11-24-2015, 03:29 PM   #4
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,838

Rep: Reputation: 160Reputation: 160
It is better to use raw socket if you just want to monitor traffic.
 
Old 11-25-2015, 04:10 AM   #5
vjanandr85
LQ Newbie
 
Registered: Nov 2015
Posts: 3

Original Poster
Rep: Reputation: Disabled
this is not monitor network traffic, this is part of the protocol implementation I am working on. I need to know what interface the packet was received on, so that I can update my datastructures and construct a tree.
 
Old 11-25-2015, 03:50 PM   #6
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,838

Rep: Reputation: 160Reputation: 160
If you don't use RAW socket, no way to know what interface the packet was received on for tunnel frame. Original header is gone.
 
  


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
GRE tunnel nima0102 Linux - Networking 1 07-28-2009 02:12 PM
GRE tunnel between two Linux boxes fjunibel Linux - Networking 0 04-07-2009 01:57 AM
Trasmitting data through 2 GRE tunnel interfaces on the same IP, with equal weightage chirag2121 Linux - Networking 0 05-07-2008 12:42 AM
Gre Tunnel Questions mhunter Linux - Networking 2 07-18-2007 01:17 PM

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

All times are GMT -5. The time now is 10:05 PM.

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