All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Hutchings <bhutchings@solarflare.com>
To: Chin Shi Hong <cshong87@gmail.com>
Cc: netdev@vger.kernel.org
Subject: Re: Reset hardware address (MAC address) in c++
Date: Sun, 09 Jan 2011 16:06:53 +0000	[thread overview]
Message-ID: <1294589213.3283.103.camel@localhost> (raw)
In-Reply-To: <AANLkTimW247sL7mVKChOVjGFTcSA4mYZhwXdasfaYzXN@mail.gmail.com>

On Sun, 2011-01-09 at 22:39 +0800, Chin Shi Hong wrote:
> Dear All,
> 
> My final year project is all about MAC address spoofing.
> 
> I do know that I can reset the MAC address of my network adapter to
> its original by rebooting the Linux operating system I am using.
> 
> My Linux distribution is using NetworkManager. On Wireless network,
> each time after I change the MAC address of my wireless network
> adapter and then connect to the wireless network, and then once I
> disconnect from wireless network, NetworkManager will reset the MAC
> address of my wireless network adapter to its original.
> 
> I had programmed my application to change the MAC address. Now, trying
> to implement the feature that reset the MAC address. I don't know
> whether NetworkManager record down the original MAC address of my
> Network Adapter or not. But, assume if NetworkManager is able to reset
> the MAC address of my network adapter to its original MAC address
> without recording the original MAC address and without reboot, then my
> application must be able to do the same.
> 
> So, can anyone tell me the C++ codes that is able to reset the MAC
> address, or give me some ideas on this, please?

You can read the permanent MAC address using the ethtool
ETHTOOL_GPERMADDR operation.  See the ethtool utility for an example of
how to use this.

Ben.

-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.


      reply	other threads:[~2011-01-09 16:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-09 14:39 Reset hardware address (MAC address) in c++ Chin Shi Hong
2011-01-09 16:06 ` Ben Hutchings [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1294589213.3283.103.camel@localhost \
    --to=bhutchings@solarflare.com \
    --cc=cshong87@gmail.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.