LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-25-2012, 04:39 AM   #1
sunayanaiyer@gmail.com
LQ Newbie
 
Registered: May 2012
Posts: 5

Rep: Reputation: Disabled
Angry error: ‘struct sk_buff’ has no member named ‘dst’


hi all...

i have some patch of code which use sk_buff structure.
//////////////////////
while (out_queue.count > 0) {
int rc;
Entry *e;

skb = out_queue.head;
BUG_ON(!skb);

e = lookup_table(&mac_domid_map, skb->dst->neighbour->ha);
BUG_ON(!e);

rc = xmit_large_pkt(skb, e->bfh->out);

if (rc < 0) {
bf_notify(e->bfh->port);
wake_up_interruptible(&pending_wq);
break;
}

dequeue(&out_queue);

kfree_skb(skb);
}

//////////////////////
while compliling i getting this erreo:error: ‘struct sk_buff’ has no member named ‘dst’
my linux kernel information is : 2.6.32.12

can somebody please help??
 
Old 05-25-2012, 06:57 AM   #2
jhwilliams
Senior Member
 
Registered: Apr 2007
Location: Portland, OR
Distribution: Debian, Android, LFS
Posts: 1,168

Rep: Reputation: 211Reputation: 211Reputation: 211
In the 3.2, at least, It's true, there is no dst member in struct sk_buff.

Look at the definition in ./include/linux/skbuff.h, and you can see this clearly.

There is a struct dst_entry, which has _neighbour field.

There is also a fucntion:

Code:
static inline struct dst_entry *skb_dst(const struct sk_buff *skb)
So, if you have a struct sk_buff, you can use that to get a dst_entry, and then you can access neighbor.

In other words,

Code:
skb->dst->neighbour->ha
would need to become:

Code:
skb_dst(skb)->_neighbour->ha
Or similar, for ~3.2 series kernels.
 
1 members found this post helpful.
Old 05-29-2012, 12:32 AM   #3
sunayanaiyer@gmail.com
LQ Newbie
 
Registered: May 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
thank you so much jhwilliams...

Ya u were correct, i modified my code and now i am able to compile it successfully.

Actually the source code which i have is supposed to run with 2.6.18.8 but my requirement is to make it done for 2.6.32-71.el6.i686. So i thought may be if i will modify the source code according to new kernel version the problem will be solved..but when i tried to load the .ko files (insmod ***.ko) it showing me this error:insmod: error inserting 'xenloop.ko': -1 Invalid module format
after checking the log (dmesg) i got this information->disagrees about version of symbol module_layout

I am new to handling kernel things can somebody please help me...

regards
sunayana.
 
  


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
[SOLVED] error: 'struct tty_struct' has no member named 'device' vlzj Programming 4 04-11-2012 07:58 PM
[SOLVED] struct sk_buff has no member named 'nh' vdx Linux - Kernel 2 05-25-2011 04:07 AM
error: ‘struct in6_addr’ has no member named ‘in6_u’ deb1513 Programming 1 12-02-2008 06:56 AM
error: 'struct SDL_SysWMinfo' has no member named 'info' TiDjY Linux - Desktop 4 11-24-2008 06:00 AM
error: ‘struct inode’ has no member named ‘u’ PankajDS Linux - Kernel 0 02-25-2008 11:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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