having problem using net-tools lib

having problem using net-tools lib

Post by walt » Wed, 19 May 1999 04:00:00



Hi Folks,
  I'm trying to write a library that will change various network adapter
parameters, such as ip address.  I've grabbed
the source for net-tools and have used portions of it, but I'm having a
problem.  My lib opens a socket and gets back a
file descriptor (27).  When I try and do an  ioctl(fd, SIOCSIFADDR,
&ifr);  I always get an error
r = ioctl(fd, SIOCSIFADDR, &ifr);
if (r < 0 )
     perror("SIOCSIFADDR");

I always get  SIOCSIFADDR: Operation not supported by device
Here is the code block in my lib.  This lib is a C library that gets
called from Java.
The functions in here are in the libnet-tools lib.

when I run ifconfig, the fd it always gets for fd is always 4.  In my
lib its always a large #.
any ideas ?

   ife = lookup_interface(iface_name);
  resp = do_if_fetch(ife);

  if (resp >=0)
    {
      ap = get_aftype(DFLT_AF);
      if (ap == NULL)
        ap = get_aftype("inet");

      if (ap->input(0, ipaddr, &sa) <0) {
        ap->herror(ipaddr);
       }
      memcpy((char *) &ifr.ifr_addr, (char *) &sa, sizeof(struct
sockaddr));
        {
            int r = 0;          /* to shut gcc up */
            switch (ap->af) {
            case AF_INET:
                fd = get_socket_for_af(AF_INET);
                if (fd < 0) {
                    perror("No support for INET on this system.");
                    exit(1);
                }
                r = ioctl(fd, SIOCSIFADDR, &ifr);
                if (r < 0 )
                   perror("SIOCSIFADDR");
                break;
...
...

 
 
 

1. Permission and shared library problem after installing net-tools

Hello,

I recently installed Net-tools 1.51. After doing that I tried to use
Netstat but I just got Netstat : error in loading Shared libraries :
undefined symbol __register_ frame _info

And after rebooting, I get the same message during the boot messages.

And after that the domain localhost name which usually apppears to the
left of the invite is replaced by (none).

I looked at Nettools using RPM packet manager and it found permissions
problems with several items.

Anybody could tell how to fix things ?

Cedric the Heretic

"The power of accurate observation is commonly called cynicism by those who have not got it."
-- George Bernard Shaw

2. winmodem?

3. net-tools problem

4. Xs3 server problem on LGX Fall CDR

5. Problem with net-tools

6. Where can we evaluate Solaris X86?

7. problem compiling net-tools

8. Cisco Extreme

9. net-tools (route command) problem with kernel 2.1.105

10. list used shared libs tool

11. Net libs for Net-24e???

12. Net-Tools-1.1.93 networking tools uploaded

13. /usr/lib/gcc-lib/i386-linux and /usr/lib/gcc-lib/i486-linux