LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   How to set Hop by Hop header in ipv6 packet after queueing it in userspace? (https://www.linuxquestions.org/questions/programming-9/how-to-set-hop-by-hop-header-in-ipv6-packet-after-queueing-it-in-userspace-4175600637/)

NetworkNewbie 02-26-2017 02:36 PM

How to set Hop by Hop header in ipv6 packet after queueing it in userspace?
 
Hello everybody,


I try to write a C code in userspace which must check a ipv6 packet header. If the the ipv6 header contains a HOP by HOP options(meaning next header is hop by hop header ), i want to store this hop by hop options data else (no hop hop header) i want to include a stored options data in the ipv6 header.

I use libnetfilter_queue to intercept packet and nfq_verdict t send them after.

My current code can intercept packet, check it to get ipv6 header and print ipsrc, ipdst and ip6_nxt.(ifip6_nxt==0 the header contains hop by hop header, else no header).

But I don't understant how i can store a hop by hop options data or set them to another ipv6 header before sending the packets.

Can someone help me. Thank you in advance.
Code:



sundialsvcs 03-01-2017 04:05 PM

I suspect that userland can't do that sort of thing.

astrogeek 03-01-2017 04:29 PM

Please do not remove information from your posts which is necessary for others to understand your question.

Remember that your question and all replies will show up in search engines for a very long time and become part of a widely shared knowledge base. With vital information now missing from the post it greatly reduces the usefulness to others searching for similar answers.

Please review the Site FAQ for guidance on forum use.

And welcome to LQ! We look forward to your continuing participation!


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