ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi
I need to insert some data to IP packet.
We have TCP option field in TCP header which some option kind is reserved.
Can i use option kind of 31 (it is reserved) for my purpose?
Dear sundialsvcs
It is simple, i have a linux box.
The problem is how can I write into tcp option my custom data or how can write into IP option field my custom data ?
Ok
My linux box acts as a router and I need to insert some data into Option field of the IP packet.
And for this purposes I need to perform it in kernel for performance considerations.
Assume i want to insert origin source IP address of the packets in option field.
Dear NevemTeve
Think the IP address is spoofed and i want to insert closest router IP address into the option field.
I know the routers just have to forward packets but i want to insert the IP address of the closest router to the source of packets into the option field for experimental purposes.
can I do that ?
No it can't
We can change the TTL and QoS by iptables (i think).
It can't help for my purpose.
just can u tell me what IP option number 10 do ?
the link :
I've never said there is a complete solution to this problem, only that it has something to do with mangling; most likely you have to hack the kernel and/or (most likely and) create new iptables module(s).
Incidentally, routers very often strip unrecognized information from headers. Use of an IP option-number (31) which is not in the published spec would almost certainly cause that element to be removed.
Dear NevemTeve
Thanks to answer.
I've studied the solution you mentioned.
Dear sundialsvcs
At the first post i have mentioned TCP option-number (31) which is exist and it is reserved.
Then i mentioned to IP header option-number (10) which is for experimental measurement.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.