kfree_skb gives oops
hello, I am checking some conditions in packet after IP header is removed and based on that want network stack to discard skbuff so i add it in ip_input.c . But it gives oops message that Warning: kfree_skb passed an skb still on a list and then prints oops Please help how to do that and correct me to use a way by which i will not face any kernel panic message? Thanks in advance. regards, linux_lover. __ Do you Yahoo!? Yahoo! Mail - Helps protect you from nasty viruses. http://promotions.yahoo.com/new_mail - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: Accessing data structure from kernel space
Hello sir, I successfully added linked list data structure in kernel in header file. Write a C source file and add it to kernel directory. then write 2 system calls that read and write to linked list from user space through that syscalls. recompile kernel. Now able to read/write that linked list. I want to write user data in that linked list and allow kernel to use that info in linked list. Is my approach to send data from user to kernel and store there as long as OS is not rebooted is right? Please reply me. Thanks in advance. regards, linux_lover. __ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
source file unable to export function to kernel
Hi, I have included this as myfile.c in /usr/src/linux-2.4.24/kernel. I included its entry in Makefile in export-objs. //sourcefile #define EXPORT_SYMTAB #include #include #include //contains prototypes for fun1 and fun2 #include char* fun1(char* str1) { } void fun2(char *str1,char *str2) { } EXPORT_SYMBOL(fun1); EXPORT_SYMBOL(fun2); But after recompiling kernel when i boot i am unable to see its entry in /proc/ksyms. Why?? my myhf1.h file is extern char* fun1(char *); extern void fun2(char*,char*); regards, linux_lover. __ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: Accessing data structure from kernel space
Hello linux-os, --- linux-os <[EMAIL PROTECTED]> wrote: > On Wed, 23 Mar 2005, linux lover wrote: > > > Hello all, > >I have one linked list data structure added > to > > a file in kernel source code which has some kernel > > info. I want to acess that linked list structure > from > > user space. Is that possible?? > >Also how to add own system call usable at > user > > level from kernel module?? > > regards, > > linux_lover. > > > > Many people will tell you to use the /proc > file-system. > I suggest you make a simple "character" driver and > access > your kernel structure using ioctl() or mmap(). > How can i access that linked list structure in kernel at user space say if i write character driver as /dev/readll then how to link that structure to device driver ? > You don't add your own system call __ever__, even if > you > are a long-time kernel developer. The current API > already > has lots of standard interface capabilities. > Thinking, even > for an instant, that you need more means that you > don't > understand Unix/Linux. > > Cheers, > Dick Johnson > Penguin : Linux version 2.6.11 on an i686 machine > (5537.79 BogoMips). > Notice : All mail here is now cached for review by > Dictator Bush. > 98.36% of all statistics are > fiction. > __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: Accessing data structure from kernel space
Hello sir, --- Jan Engelhardt <[EMAIL PROTECTED]> wrote: > >> Hello all, > >> I have one linked list data structure added > to > >> a file in kernel source code which has some > kernel > >> info. I want to acess that linked list structure > from > >> user space. Is that possible?? > > Yes!! So that mean i can read that linked list structure and print them in user space that will have some kernel internel info. > > >> Also how to add own system call usable at > user > >> level from kernel module?? > > !! > > > Many people will tell you to use the /proc > file-system. > > *cough* sysfs *cough* > err...(due to new horizons): > *cough* relayfs *cough* > > Whats that? Can you please elaborate to me as i am newbie to those words. Pleas. > > Jan Engelhardt > -- > Thanks in advance. regards, linux_lover. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Accessing data structure from kernel space
Hello all, I have one linked list data structure added to a file in kernel source code which has some kernel info. I want to acess that linked list structure from user space. Is that possible?? Also how to add own system call usable at user level from kernel module?? regards, linux_lover. __ Do you Yahoo!? Make Yahoo! your home page http://www.yahoo.com/r/hs - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
some /proc understandings
Hello, 1) I want to know how much can i write to /proc entry file?? Is there any limitation on file size??? 2)Also how can i call /proc entry files proc_read_myfile function on that file by another kernel module call? What parameters i require to pass and how? Say i have read functions as struct myfile_data_t { char value[8]; }; struct proc_dir_entry *myfile_file; struct myfile_data_t myfile_data; int proc_read_myfile(char *page, char **start, off_t off, int count, int *eof, void *data) { int len; /* cast the void pointer of data to myfile_data_t*/ struct myfile_data_t *myfile_data=(struct myfile_data_t *)data; /* use sprintf to fill the page array with a string */ len = sprintf(page, "%s", myfile_data->value); return len; } Then can it possible that i can call proc_read_myfile from another kernel module?? Instead read file from user level call? 3) Also Is following code valid of creating /proc files with different file name created by passing function cr_proc(fname)? struct proc_dir_entry *entnew; int cr_proc(char *fname) { if ((entnew1 = create_proc_entry(fname, S_IRUGO | S_IWUSR, NULL)) == NULL) return -EACCES; entnew1->proc_fops = &proc_file_operations; } static struct file_operations proc_file_operations = { open: proc_open, release:proc_release, read: proc_read, write: proc_write, }; What will happen if dynamic file names are going to use same all above 4 functions??? regards, linux_lover __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Which types of functions are exported by kernel source?
Hello, While browsing linux source code what i found that if function is defined as asmlinkage long sys_open(const char * filename, int flags, int mode) then its not exported to kenrel and thus not seen in /proc/ksyms. But if function in kernel source is not defined with asmlinkage then it is exported to kernel and seen in /proc/ksyms. Is that correct?? regards, linux_lover. __ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Kernel modules query
Hello, I want to know can a variable be exported by a linux kernel modules? How can i make a variable getting assigned in kernel module available to other kernel modules? regards, linux.lover. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
How to read file in kernel module?
Hello, I have written one /proc file creation kernel module. This module creates /proc/file and defied operations on it. Also i have written user program that will read & write to /proc files from user space. Now what i want is to use same bufproc_read & bufproc_write functions defined in /proc file handling kernel module to be used in another kernel module to read that /proc/file in kernel module.The second kernel module only used to read /proc file in kernel. I am not understanding how can i open that /proc/file in second kenrel module to read in kernel? regards, linux_lover. __ Do you Yahoo!? Yahoo! Mail - Helps protect you from nasty viruses. http://promotions.yahoo.com/new_mail - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
help me to know when ethernet header added to packet by eth_header function
Hello, Can anybody explain me how ethernet header is added to every packet outgoing? I check eth.c file and found eth_header that is used for adding ethernet header on skbuff packet. But does each packet calls this function? I think not as theres a cache header function used that cache ethernet header entry. So my main question is that when my machine first contacted to any other pc in LAN does it calls eth_header and when require to send any type of packet to same machine i thnik eth_cache_header is used is that right??? Then can it be possible that if my machine not contacted to any cached entry machine then eth_header will be called again to build eth header for that machine? In an all when functions in eth.c will be called/not called eth_header,eth_header_cache,eth_header_parse,eth_header_cache_update??? Please kindly help me to identify it. Thanks in advance. regards, linux_lover. __ Do you Yahoo!? Yahoo! Mail - You care about security. So do we. http://promotions.yahoo.com/new_mail - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Some kernel source questions...
Hello, I have some questions... 1)When data is copied to ICMP/UDP packets? when i trace kernel code in 2.4.26 kernel version is that in case of ICMP and UDP packets the packet gets its space allocated in ip_build_xmit function and then ip header is built. 2) What getfrag does? Does it copies actual data in packet? 3)Also can anybody explain me function int ip_build_xmit(struct sock *sk,int getfrag (const void *,char *,unsigned int, unsigned int),const void *frag, unsigned length, struct ipcm_cookie *ipc, struct rtable *rt, int flags) and its parameter usage??? regards, linux_lover __ Do you Yahoo!? Yahoo! Mail - Helps protect you from nasty viruses. http://promotions.yahoo.com/new_mail - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Analysing UDP packet building code in 2.6.10 kernel
Hello all, I am knowing all 2.4 kernel network stack packet buildup procedure. Now i am trying to analysing same in 2.6.10 kernel. What i found is many changes to 2.6 kernel compare to 2.4. Theres is no ip_build_xmit instead thers a new function that is ip_append_data. What i want to know is from udp.c file. Theres a udp protocol structure is defined struct proto udp_prot = { .name = "UDP", .owner =THIS_MODULE, .close =udp_close, .connect = ip4_datagram_connect, .disconnect = udp_disconnect, .ioctl =udp_ioctl, .destroy = udp_destroy_sock, .setsockopt = udp_setsockopt, .getsockopt = udp_getsockopt, .sendmsg = udp_sendmsg, .recvmsg = udp_recvmsg, .sendpage = udp_sendpage, .backlog_rcv = udp_queue_rcv_skb, .hash = udp_v4_hash, .unhash = udp_v4_unhash, .get_port = udp_v4_get_port, .slab_obj_size = sizeof(struct udp_sock), }; I want to know for what purpose udp_sendpage is used also whats significance of . in structure members? Also why .slab_obj_size = sizeof(struct udp_sock) defined in udp_prot? Also where's packet size/space is allocated for UDP packet? Please help me to analyze code. Thanks in advance. linux_lover. __ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/