SIOCSIFFLAGS: Cannot assign requested address

SIOCSIFFLAGS: Cannot assign requested address

Post by phil-news-nos.. » Fri, 11 Feb 2000 04:00:00



I get the error message:

    SIOCSIFFLAGS: Cannot assign requested address

when doing the command:

    ifconfig eth0:0 inet up 192.168.1.19 netmask 255.255.255.0 broadcast 192.168.1.255

I've explored several sequences of executing ifconfig commands and found
the one way to avoid the message (and everything works despite the message)
and found that if I leave off the "up" option, there is no message.

In "man ifconfig" I read:

       up     This  flag  causes  the  interface  to be activated.  It is
              implicitly specified if an address is assigned to the interface.

The reason I was putting in was just to be explicit.  But since the message
goes away when I leave it off, it is clear that something _different_ happens
when "up" is included.

I can't find the source to ifconfig at the moment, but I looked around in
the kernel and looked in net/ipv4/devinet.c in function devinet_ioctl() at
line 398 in 2.2.14.  Apparently this code is being invoked:

                case SIOCSIFFLAGS:
#ifdef CONFIG_IP_ALIAS
                        if (colon) {
                                if (ifa == NULL) {
                                        ret = -EADDRNOTAVAIL;
                                        break;
                                }
                                if (!(ifr.ifr_flags&IFF_UP))
                                        inet_del_ifa(in_dev, ifap, 1);
                                break;
                        }
#endif
                        ret = dev_change_flags(dev, ifr.ifr_flags);
                        break;

Earier in the code it searched for something not specifically obvious to
fill in "ifa".  So I guess in this case it didn't find it and returned the
EADDRNOTAVAIL status.  If I execute the same command again, with the "up"
option, for an alias that exists, the error message does not come out.  So
I'm guessing that it then finds whatever it was looking for.

Strange.

Anyone have an explanation for this?  Why is an explicit "up" and an
implicit "up" option different?  Is the ifconfig command perhaps doing
it wrong?

--
| Phil Howard - KA9WGN | for headlines that | Just say no to absurd patents |

| Dallas - Texas - USA | linuxhomepage.com  | Shop http://bn.com/ instead   |

 
 
 

SIOCSIFFLAGS: Cannot assign requested address

Post by Charles Blackbu » Fri, 11 Feb 2000 04:00:00



>    ifconfig eth0:0 inet up 192.168.1.19 netmask 255.255.255.0 broadcast 192.168.1.255

you may find that the ip address is already being used by an interface on your
server.

--
Charles Blackburn -=- Remove NOSPAM to email a reply.
Summerfield Technology Limited - SuSE Linux Reseller & Birmingham L.U.G sponsor


 11:50am  up 3 days, 17:16,  1 user,  load average: 0.06, 0.02, 0.00

 
 
 

SIOCSIFFLAGS: Cannot assign requested address

Post by Steve Housem » Fri, 11 Feb 2000 04:00:00


I'm guessing, but the IP-Alias mini howto just uses

ifconfig eth0:1 192.168.1.33

and I think the reason is that there is only one device there
although with several addresses and it is already up .

I'm guessing (again) but I think that the ioctl SIOCSIFFLAGS
is for bringing the interface up or down (and the check is whether
that address exists on the dev) , whereas the aliasing
ioctl is SIOCSIFADDR and it creates the alias in the dev.
Probably the 'up' makes it into a SIOCSIFFLAGS (plus maybe
the netmask and broadcast).

Cheers,

Steve Houseman

--

currently  steve.houseman at * net      

 
 
 

SIOCSIFFLAGS: Cannot assign requested address

Post by phil-news-nos.. » Mon, 14 Feb 2000 04:00:00



| I'm guessing, but the IP-Alias mini howto just uses
|
| ifconfig eth0:1 192.168.1.33
|
| and I think the reason is that there is only one device there
| although with several addresses and it is already up .

Since the man page says that "up" is implied, then it should do the same
action either way.  But that clearly is not the case, at least for aliases.
So the man page must be wrong.

| I'm guessing (again) but I think that the ioctl SIOCSIFFLAGS
| is for bringing the interface up or down (and the check is whether
| that address exists on the dev) , whereas the aliasing
| ioctl is SIOCSIFADDR and it creates the alias in the dev.
| Probably the 'up' makes it into a SIOCSIFFLAGS (plus maybe
| the netmask and broadcast).

Whether it tries to bring it up or not, since the man page says it will do
the same thing with "up" as without (as long as you don't specify "down")
then I should get the same error message by leaving "up" off.

--
| Phil Howard - KA9WGN | for headlines that | Just say no to absurd patents |

| Dallas - Texas - USA | linuxhomepage.com  | Shop http://bn.com/ instead   |

 
 
 

SIOCSIFFLAGS: Cannot assign requested address

Post by phil-news-nos.. » Mon, 14 Feb 2000 04:00:00




|>    ifconfig eth0:0 inet up 192.168.1.19 netmask 255.255.255.0 broadcast 192.168.1.255
|
| you may find that the ip address is already being used by an interface on your
| server.

No, that is not the case.  Despite the error message, the IP address is in
fact correctly and successfully bound to the interface, and it is not in use
on any other interface.  What happens is that with the "up" option it tries
to bring up the interface and it can't because it is already up, and the error
message is produced incorrectly.  And the man page is wrong because without
the "up" option, it does not do this.

--
| Phil Howard - KA9WGN | for headlines that | Just say no to absurd patents |

| Dallas - Texas - USA | linuxhomepage.com  | Shop http://bn.com/ instead   |

 
 
 

SIOCSIFFLAGS: Cannot assign requested address

Post by Steve Housem » Mon, 14 Feb 2000 04:00:00


strace -odbin -f -t ifconfig eth0:1 up 192.168.1.19 netmask 255.255.255.0

6040  12:18:11 ioctl(5, SIOCGIFFLAGS, 0xbffff9b4) = 0
6040  12:18:11 ioctl(5, SIOCSIFFLAGS, 0xbffff9b4) = -1 EADDRNOTAVAIL \
(Cannot assign requested address)
6040  12:18:11 write(2, "SIOCSIFFLAGS: Cannot assign requ"..., 46) = 46
6040  12:18:11 ioctl(5, SIOCSIFADDR, 0xbffffa18) = 0
6040  12:18:11 ioctl(5, SIOCGIFFLAGS, 0xbffff9b4) = 0
6040  12:18:11 ioctl(5, SIOCSIFFLAGS, 0xbffff9b4) = 0
6040  12:18:11 ioctl(5, SIOCSIFNETMASK, 0xbffffa18) = 0
6040  12:18:11 _exit(0)                 = ?
.................................................................
strace -odbin1 -f -t ifconfig eth0:1 192.168.1.19 netmask 255.255.255.0

6043  12:18:35 ioctl(5, SIOCSIFADDR, 0xbffffa18) = 0
6043  12:18:35 ioctl(5, SIOCGIFFLAGS, 0xbffff9b4) = 0
6043  12:18:35 ioctl(5, SIOCSIFFLAGS, 0xbffff9b4) = 0
6043  12:18:35 ioctl(5, SIOCSIFNETMASK, 0xbffffa18) = 0
6043  12:18:35 _exit(0)                 = ?
................................................................

I *guess* that the man page is right that an 'up' is implied,
but the implementation is wrong and that the first two ioctl's
are triggered by the 'up' but  shouldnt be as the device does not
exist at that point and causes the error message (although the error
code should be checked and the prog stopped there ?).

Cheers,

Steve Houseman

--

currently  steve.houseman at * net      

 
 
 

1. SIOCSIFFLAGS: Cannot assign requested address (please help)

i've posted this question in comp.sys.sun.admin some days ago -
without success yet.

i've assigned quite a lot of logical interfaces to a physical ethernet
interface on a sparc runnig solaris 2.5. now i've come to a limit. the
system has apparently run out of something, but i can't guess what.
the message i get is:

ifconfig: SIOCSIFFLAGS: le0:28: Cannot assign requested address

when i try to:

/usr/sbin/ifconfig le0:28 194.191.88.191 up netmask 255.255.255.224
broadcast 194.191.88.255 -trailers

this happens when i try to assign this very number 28 or any number
above. i couldn't find any limitations mentioned in the dox, and i
personally think that 28 is a weird number to have a limit set at. i'd
rather expect a magic number like 32 or something.

can anyone help, please?

roger luethi

I'm using this address in news groups only. Just to keep my main e-mail
account spam-free. Go http://hellgate.ch/address.html if you'd like to
know my 'real' address.

2. http problem

3. sco_cpd: SIOCGIFADDR: Cannot assign requested address

4. XFree86 fonts..

5. ifconfig ... le0: Cannot assign requested address

6. lpd very slow?

7. apache startup error: cannot assign requested address: make_sock.

8. What does this mean?

9. SATAN cannot assign requested address

10. Cannot Assign Requested Address ?

11. Cannot assign requested address

12. pppd demand dialing - ioctl(SIOCSIFDSTADDR): Cannot assign requested address(99)

13. TALK cannot assign requested address (99)