LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Closed Thread
  Search this Thread
Old 01-19-2009, 04:09 PM   #1
ycli
LQ Newbie
 
Registered: Jan 2009
Posts: 2

Rep: Reputation: 0
Question how to tcp seq from skb


I am trying to write a kernel program which needs to get tcp's seq value from sk_buff struct (skb). I did it with the following code:

struct tcphdr * mytcphdr = (struct tcphdr *) tcp_hdr(skb);
if(mytcphdr)
{
unsigned long tcpseq = ntohl(mytcphdr->seq);
}

However, the tcpseq values obtained this way are incorrect (I got the true values from "wireshark" program). Please let me know where it is wrong with the code? Thank you very much in advance.

By the way, I am with kernel 2.6.27.


ycli
 
Old 01-19-2009, 04:22 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,417
Blog Entries: 55

Rep: Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread should be closed because it is a duplicate of http://www.linuxquestions.org/questi...om-skb-698442/.

Next time please use the edit button or ask a moderator to modify your post if you can't, OK?
 
  


Closed Thread


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
touch test{seq 10 10 1000)} lipun4u Programming 10 09-16-2008 03:41 PM
how to put an alphabet in seq command silverhand Programming 3 10-05-2007 02:57 PM
group the outgoing skb's into single skb and then send grouped skb. venkatesh111 Linux - Networking 0 04-27-2006 01:05 AM
Unable to process skb in my own handler imransadat Programming 4 03-04-2005 12:18 PM
snd-seq-oss problem CuteAndFluffy Linux - Hardware 1 01-16-2003 10:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:10 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