Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Not able to change MAC of network interface using ioctl calls in QNX 6.6: (2 Items)
   
Not able to change MAC of network interface using ioctl calls in QNX 6.6  
I am trying to change the MAC address of a network interface using ioctl() api in my program, but it always returns 
error 103 (Operation not supported).

I am able to change it through the shell using command "ifconfig eth1 link 00:50:56:2e:88:1a active". 
I want to do the same using system APIs, but it gives error. Below is the code snippet, please suggest any other way to 
do the same

struct ifaliasreq  addreq;
memset(&addreq, 0, sizeof(addreq));
strcpy(addreq.ifra_name, "eth1");
addreq.ifra_addr.sa_family = AF_LINK;
bcopy(mac, addreq.ifra_addr.sa_data, 6);
ioctl(s, SIOCAIFADDR, &addreq);
Re: Not able to change MAC of network interface using ioctl calls in QNX 6.6  
Which driver are you using?

Thanks, Hugh.

On 2017-12-29, 6:56 AM, "Giji G" <community-noreply@qnx.com> wrote:

    I am trying to change the MAC address of a network interface using ioctl() api in my program, but it always returns 
error 103 (Operation not supported).
    
    I am able to change it through the shell using command "ifconfig eth1 link 00:50:56:2e:88:1a active". 
    I want to do the same using system APIs, but it gives error. Below is the code snippet, please suggest any other way
 to do the same
    
    struct ifaliasreq  addreq;
    memset(&addreq, 0, sizeof(addreq));
    strcpy(addreq.ifra_name, "eth1");
    addreq.ifra_addr.sa_family = AF_LINK;
    bcopy(mac, addreq.ifra_addr.sa_data, 6);
    ioctl(s, SIOCAIFADDR, &addreq);
    
    
    
    _______________________________________________
    
    General
    http://community.qnx.com/sf/go/post118297
    To cancel your subscription to this discussion, please e-mail general-community-unsubscribe@community.qnx.com