sk_buff

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello all

I have a problem with putting some data into a sk_buffer.
How can I put the ICMPv6 header into the packet ?
 
I want to create a ICMPv6 Router Advertisement message with a sk_buff. After 
using skb_put I can not read the ICMPv6 header.
For this I use the following code. 
********************************************************************************************************+
	struct nd_msg *msg;		/*Neighbour discovery message*/

	skb = allock_skb( len , GFP_ATOMIC);

	/*pack the ip6 header*/
	ip6_nd_hdr( sk, skb, dev, saddr, &maddr, IPPROTO_ICMPV6, msg_len);
	
	msg = (struct nd_msg *)skb_put(skb, len);

	/*pack the icmpv6 header */
	msg->icmph.icmp6_type = NDISC_ROUTER_ADVERTISEMENT;	/*Type = 134*/
	msg->icmph.icmp6_code = 0;
	msg->icmph.icmp6_cksum = 0;
*********************************************************************************************
And if I call another output function (e.g. the function below) I get always 
different output values and not the values I put inside the message.

*********************************************************************************************
 	void printk_skb(struct sk_buff *skb){

		 struct nd_msg *msg = (struct nd_msg *) skb->h.raw;
		 
		printk("MHO: ICMP Type = %d \n",msg->icmph.icmp6_type);
		printk("MHO: ICMP Code = %d \n",msg->icmph.icmp6_code);
		printk("MHO: ICMP Checksum = %d \n",msg->icmph.icmp6_cksum);
		}
************************************************************************************************
The packet was currently not sent. 
Is it possible that the sending functions change something on the skb because 
some receiving functions use the same format to get the ICMPv6 header from 
the skb. 

I hope there is anybody who can help me. 

Ok thank you in advance for all help.

Jörg
 
--------------------------------------------------------
Joerg Eggink
Network Laboratories Heidelberg NEC Europe Ltd.
Adenauerplatz 6 
D-69115 Heidelberg, Germany

email: joerg.eggink@ccrle.nec.de
http://www.ccrle.nec.de
-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux