<div>Hi all:</div><div><br></div><div>I don't know if anyone have found out this before,but it's obviously a bug in file: linux/net/ipsec/ipsec_mast.c </div><div><br></div><div><br></div><div><div>1085 int</div><div>
1086 ipsec_mast_init_devices(void)</div><div>1087 {</div><div>1088 /*</div><div>1089 * mast0 is used for transport mode stuff, and generally is</div><div>1090 * the default unless the user decides to create more.</div>
<div>1091 */</div><div>1092 ipsec_mast_createnum(0);</div><div>1093 </div><div>1094 return 0;</div><div>1095 }</div><div><br></div>line 1092 set mast device num (mastdevices_max) to 0.</div><div><br>
</div><div>if we do a rmmod ipsec now ,in ipsec_mast_cleanup_devices</div><div><br></div><div><div>1098 int</div><div>1099 ipsec_mast_cleanup_devices(void)</div><div>1100 {</div><div>1101 int error = 0;</div><div>
1102 int i;</div><div>1103 struct net_device *dev_mast;</div><div>1104 </div><div>1105 for(i = 0; i <= mastdevices_max; i++) {</div><div>1106 if(mastdevices[i]!=NULL) {</div><div>
1107 dev_mast = mastdevices[i];</div><div>1108 //lzp add</div><div>1109 if (!dev_mast)</div><div>1110 printk(KERN_WARNING "dev_mast null");</div>
<div>1111 ipsec_dev_put(dev_mast);</div><div>1112 unregister_netdev(dev_mast);</div><div>1113 #ifndef alloc_netdev</div><div>1114 kfree(dev_mast->priv);</div>
<div>1115 dev_mast->priv=NULL;</div><div>1116 #endif</div><div>1117 ipsec_dev_put(mastdevices[i]);</div><div>1118 mastdevices[i]=NULL;</div><div>1119 }</div>
<div>1120 }</div><div>1121 return error;</div><div>1122 }</div><div><br></div><div>we will clean up mastdevices[0],which is not initialize yet.</div><div><br></div><div>change to this fix the problem</div>
<div><div>1085 int</div><div>1086 ipsec_mast_init_devices(void)</div><div>1087 {</div><div>1088 /*</div><div>1089 * mast0 is used for transport mode stuff, and generally is</div><div>1090 * the default unless the user decides to create more.</div>
<div>1091 */</div><div>1092 ipsec_mast_createnum(-1);</div><div>1093 </div><div>1094 return 0;</div><div>1095 }</div></div><div><br></div>-- <br>--ROMEO<br>
</div>