[mpls-linux-general] (no subject)
Status: Beta
Brought to you by:
jleu
From: anish v. <ani...@re...> - 2002-03-22 09:11:50
|
hi, i am working on MPLS regarding that i want to open a file from kernel to store ip address of the destination of forwarded pkt.. for which i am using the code below in mpls_ouput function .. char *buffer = kmalloc(4096,GFP_KERNEL); oldfs = get_fs(); set_fs(KERNEL_DS); fd=open("/dev/test",O_RDWR,0); if(fd){ read(fd,buffer,BUFFSIZE); } close(fd); set_fs(oldfs); but as soon as i ping another m/c my PC hangs.. can u please tell what is wrong with the above code.. whether i should use some lock... or is there any other method of opening a file from kernel thanx in advance anish |