我正在开发没有设备的IPv6
linux设备驱动程序.所以我现在试图用假的路由器广告消息欺骗内核.
unsigned char c[] = {0x33,0x33,0x00,0x02,61,0x86,0xdd,//IPv6 type 0x60,//Version,... 0x00,24,//payload length 58,//next header 255,//hop limit 0xfe,0x80,0xff,0xfe,0x3d,//source 0xff,0x01,//destination 134,//type 0,//code,0x7a,0x2c,//checksum 255,//current hop limit 0x80,//flag 0xff,//reachable timer 0x00,//source link-layer address };
我试图使用Tcpdump来抓取我发送给内核的这个数据包.我发现内核确实得到了这个数据包.
13:32:59.989851 00:00:00:00:00:3d (oui Ethernet) > 33:33:00:00:00:02 (oui Unknown),ethertype IPv6 (0x86dd),length 78: (hlim 255,next-header ICMPv6 (58) payload length: 24) fe80::200:ff:fe00:3d > ip6-allnodes: [icmp6 sum ok] ICMP6,router advertisement,length 24 hop limit 255,Flags [managed],pref medium,router lifetime 65535s,reachable time 0s,retrans time 0s source link-address option (1),length 8 (1): 00:00:00:00:00:3d 0x0000: 0000 0000 003d
但之后我使用ip -6 neigh来检查内核是否在邻居表中有假节点.我找不到它了.
我的问题是什么?任何的想法?