sk_buff extraction problem

will fitzgerald (william.fitzgerald6@beer.com)
Mon, 20 May 2002 16:16:55 +0100


hi all,

i'm having trouble extracting a packets source and destination
address from the sk_buff. i want to be able to see if a packet does
in fact pass through my router.

for no particular reason i choose dev.c and a function called
netif_rx to do this.

at the beginning of netif_rx() i added the lines:
int this_cpu = smp_processor_id();
........
char *p;
int i;

// p= (char *) (skb->mac.ethernet);
p= (char *) (skb->h.uh);

then just before return softnet_data[this_cpu].cng_level;
i added this:

for( i=0; i<8;i++){
printk(KERN_DEBUG"netif_rx() ->ethernet: %02x ",*(p+i));
}

it complies but as soon as i pass a packet through it the router
freezes up.

am i even on the rigth track?

regards will.

Beer Mail, brought to you by your friends at beer.com.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/