You are not logged in.

#1 2018-07-15 09:23:03

leethaxor
Member
Registered: 2018-07-09
Posts: 31

(SOLVED) Change mac address via a C program

Is there a way to change the mac address via a C program WITHOUT calling other programs such as ip, iwconfig or ifconfig? The mac address has to be read from somewhere but I can't find any other place besides in '/sys/class/net/{interface}/address' but I can't write to that file without creating a linux module... Does anybody know where the mac address is set / read from and how I could possibly interfere and change it with a C program or any other way? I'm having a difficult time phrasing my issue here since this is so out of the ordinary so please ask any questions if anything was unclear! smile
Edit: I am using netctl and have a broadcom wireless card. Broadcom wireless cards are difficult to change the mac address on because their drivers are not fully linux supported which is why I want to do it myself

Last edited by leethaxor (2018-07-17 05:20:14)

Offline

#2 2018-07-15 11:55:58

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,171

Re: (SOLVED) Change mac address via a C program

Google "linux ioctl change mac"
The "problem" here is that it's always the kernel (module) that adjusts the MAC (via ioctl), so if this doesn't work w/ existing tools, chances you can do that w/o fixing the driver are zero.

Online

#3 2018-07-17 05:19:58

leethaxor
Member
Registered: 2018-07-09
Posts: 31

Re: (SOLVED) Change mac address via a C program

Yup chances are pretty much 0. It didn't work... Thanks anyways!

Offline

Board footer

Powered by FluxBB