mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Question concerning ifconfig
@ 2002-07-05 13:58 Bloch, Jack
  2002-07-05 17:20 ` Ben Greear
  2002-07-05 17:33 ` Bernd Eckenfels
  0 siblings, 2 replies; 4+ messages in thread
From: Bloch, Jack @ 2002-07-05 13:58 UTC (permalink / raw)
  To: 'linux-kernel@vger.kernel.org'

I am running a Red Hat 7.2 load (Kernel version 2.4.7-10). I am trying to
enter the following command to change the MAC address on my device.

ifconfig ifp0 hw ether A2:A5:A5:01:00:00

ifp0 is my own device which replaces eth0. The system gives me a response
"SIOCSIFHWADDR : device or resources busy"
The same exact command works on my 2.2.16 Kernel. Any ideas why the error.
Please CC me directly in any responses.

Thanks in advance,  

Jack Bloch
Siemens Carrier Networks
e-mail    : jack.bloch@icn.siemens.com
phone     : (561) 923-6550


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Question concerning ifconfig
  2002-07-05 13:58 Question concerning ifconfig Bloch, Jack
@ 2002-07-05 17:20 ` Ben Greear
  2002-07-05 17:33 ` Bernd Eckenfels
  1 sibling, 0 replies; 4+ messages in thread
From: Ben Greear @ 2002-07-05 17:20 UTC (permalink / raw)
  To: Bloch, Jack; +Cc: 'linux-kernel@vger.kernel.org'

Bloch, Jack wrote:
> I am running a Red Hat 7.2 load (Kernel version 2.4.7-10). I am trying to
> enter the following command to change the MAC address on my device.
> 
> ifconfig ifp0 hw ether A2:A5:A5:01:00:00
> 
> ifp0 is my own device which replaces eth0. The system gives me a response
> "SIOCSIFHWADDR : device or resources busy"
> The same exact command works on my 2.2.16 Kernel. Any ideas why the error.
> Please CC me directly in any responses.

ifconfig ifp0 down

first, then it should work.

Ben

> 
> Thanks in advance,  
> 
> Jack Bloch
> Siemens Carrier Networks
> e-mail    : jack.bloch@icn.siemens.com
> phone     : (561) 923-6550
> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 



-- 
Ben Greear <greearb@candelatech.com>       <Ben_Greear AT excite.com>
President of Candela Technologies Inc      http://www.candelatech.com
ScryMUD:  http://scry.wanfear.com     http://scry.wanfear.com/~greear



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Question concerning ifconfig
  2002-07-05 13:58 Question concerning ifconfig Bloch, Jack
  2002-07-05 17:20 ` Ben Greear
@ 2002-07-05 17:33 ` Bernd Eckenfels
  1 sibling, 0 replies; 4+ messages in thread
From: Bernd Eckenfels @ 2002-07-05 17:33 UTC (permalink / raw)
  To: linux-kernel

Bloch, Jack <Jack.Bloch@icn.siemens.com> wrote:
> ifconfig ifp0 hw ether A2:A5:A5:01:00:00

I get also EBUSY on 0x8924 aka SIOCSIFHWADDR.

Looking into the kernel:

core/dev.c
                case SIOCSIFHWADDR:
                        if (dev->set_mac_address == NULL)
                                return -EOPNOTSUPP;
                        if (ifr->ifr_hwaddr.sa_family!=dev->type)
                                return -EINVAL;
                        if (!netif_device_present(dev))
                                return -ENODEV;
                        err = dev->set_mac_address(dev, &ifr->ifr_hwaddr);
                        if (!err)
                                notifier_call_chain(&netdev_chain, NETDEV_CHANGE
                        return err;


It looks to me that set_mac_address() of the device is doing that. For my
card it is the generic one in net_init.c which is doing:

static int eth_mac_addr(struct net_device *dev, void *p)
{
        struct sockaddr *addr=p;
        if (netif_running(dev))
                return -EBUSY;
        memcpy(dev->dev_addr, addr->sa_data,dev->addr_len);
        return 0;
}

So, as long as your interface is up, you are not allowed to change the
address.

I will add that to the man page.

Greetings
Bernd

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: Question concerning ifconfig
@ 2002-07-08 11:37 Bloch, Jack
  0 siblings, 0 replies; 4+ messages in thread
From: Bloch, Jack @ 2002-07-08 11:37 UTC (permalink / raw)
  To: 'Ben Greear'; +Cc: 'linux-kernel@vger.kernel.org'

Thanks for the quick response, but in the mean time I figured it out through
trial and error. My driver did not have a set_mac_address method. There must
have been some sort of default method in 2.2

Jack Bloch
Siemens Carrier Networks
e-mail    : jack.bloch@icn.siemens.com
phone     : (561) 923-6550


-----Original Message-----
From: Ben Greear [mailto:greearb@candelatech.com]
Sent: Friday, July 05, 2002 1:20 PM
To: Bloch, Jack
Cc: 'linux-kernel@vger.kernel.org'
Subject: Re: Question concerning ifconfig


Bloch, Jack wrote:
> I am running a Red Hat 7.2 load (Kernel version 2.4.7-10). I am trying to
> enter the following command to change the MAC address on my device.
> 
> ifconfig ifp0 hw ether A2:A5:A5:01:00:00
> 
> ifp0 is my own device which replaces eth0. The system gives me a response
> "SIOCSIFHWADDR : device or resources busy"
> The same exact command works on my 2.2.16 Kernel. Any ideas why the error.
> Please CC me directly in any responses.

ifconfig ifp0 down

first, then it should work.

Ben

> 
> Thanks in advance,  
> 
> Jack Bloch
> Siemens Carrier Networks
> e-mail    : jack.bloch@icn.siemens.com
> phone     : (561) 923-6550
> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 



-- 
Ben Greear <greearb@candelatech.com>       <Ben_Greear AT excite.com>
President of Candela Technologies Inc      http://www.candelatech.com
ScryMUD:  http://scry.wanfear.com     http://scry.wanfear.com/~greear


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-07-08 11:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-05 13:58 Question concerning ifconfig Bloch, Jack
2002-07-05 17:20 ` Ben Greear
2002-07-05 17:33 ` Bernd Eckenfels
2002-07-08 11:37 Bloch, Jack

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®