Hi , I am compiling 2.4.22 and on reboot I get the folowing error message: Loading sd.o Kernel requires old insmod, but couldnt run /bin/insmod.old (I did a make dep, make bzImage, make modules, make modules_install and make install after configuration) This led to a series of similar error messages and finally a kernel panic. help needed! Sai --- Bhaskar-ROCSYS <vbhaskar@xxxxxxxxxx> wrote: > Hi all, > > Is there any way to create a dynamic interface from > kernel space. > > Is it possible to change the parameters of an > interface from kernel > space? > > > All these can be done by using ifconfig. But I want > to do it from > kernel space. > I want to change the IP address from kernel space > and change the IP > address. I have written a small code to do this but > i am not able to > see the effect. > > The code I had written is: > > > > #define __KERNEL__ > #define MODULE > #include <linux/kernel.h> > #include <linux/module.h> > #include <asm/uaccess.h> > #include <asm/system.h> > #include <asm/bitops.h> > #include <linux/types.h> > #include <linux/kernel.h> > #include <linux/sched.h> > #include <linux/string.h> > #include <linux/mm.h> > #include <linux/socket.h> > #include <linux/sockios.h> > #include <linux/in.h> > #include <linux/errno.h> > #include <linux/interrupt.h> > #include <linux/if_ether.h> > #include <linux/inet.h> > #include <linux/netdevice.h> > #include <linux/etherdevice.h> > #include <linux/skbuff.h> > #include <linux/rtnetlink.h> > #include <linux/init.h> > #include <linux/notifier.h> > #include <linux/inetdevice.h> > #include <linux/igmp.h> > #ifdef CONFIG_SYSCTL > #include <linux/sysctl.h> > #endif > #include <linux/kmod.h> > > #include <net/ip.h> > #include <net/route.h> > #include <net/ip_fib.h> > > > int init_module() > { > struct in_device *in_dev; > struct in_ifaddr **ifap = NULL; > struct in_ifaddr *ifa = NULL; > struct net_device *dev; > > if((dev = __dev_get_by_name("eth0")) == NULL) > { > printk("<1>Cannot get info for eth0\n"); > return -1; > } > > if((in_dev = __in_dev_get(dev))!= NULL) > { > for (ifap=&in_dev->ifa_list; (ifa=*ifap) != NULL; > ifap=&ifa->ifa_next) > { > if ((strcmp("eth0", ifa->ifa_label) == 0)) > break; /* found */ > } > } > if(ifa) > { > ifa->ifa_local = htonl(0xac100f63); > > ifa->ifa_prefixlen = 24; > ifa->ifa_mask = > inet_make_mask(ifa->ifa_prefixlen); > if ((dev->flags&IFF_BROADCAST) && > ifa->ifa_prefixlen < > 31) > ifa->ifa_broadcast = > ifa->ifa_address|~ifa->ifa_mask; > } > else printk("<1>Could not find the device\n"); > > return 0; > } > > void cleanup_module() > { > printk("<1>MOd removed\n"); > } > > > The changes are made but when I am trying to send > packet its failing. > > Is there any other way to change the interface > parameters from kernel > space ? > > TIA > > Regards > bhaskar > > > > > -- > Kernelnewbies: Help each other learn about the Linux > kernel. > Archive: > http://mail.nl.linux.org/kernelnewbies/ > FAQ: http://kernelnewbies.org/faq/ > > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/