From: Jeremy Martin <martinjd@csc.uvic.ca>
To: netdev@oss.sgi.com
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] fix tuntap oversight
Date: Sun, 11 Apr 2004 23:59:47 -0700 [thread overview]
Message-ID: <20040412065947.GC18810@net-ronin.org> (raw)
Hi everyone,
This 2.6.5 patch for the universal tuntap driver allows setting the MAC
address via ifconfig(8).
I'm not subscribed to netdev so if you could CC me that'd be awesome.
-Jeremy
Patch contents:
-- CUT HERE --
===== drivers/net/tun.c 1.33 vs edited =====
--- 1.33/drivers/net/tun.c Mon Mar 15 12:45:05 2004
+++ edited/drivers/net/tun.c Sun Apr 11 22:39:06 2004
@@ -117,6 +117,15 @@
return &tun->stats;
}
+static int tun_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;
+}
+
/* Initialize net device. */
static void tun_net_init(struct net_device *dev)
{
@@ -138,6 +147,7 @@
case TUN_TAP_DEV:
/* Ethernet TAP Device */
dev->set_multicast_list = tun_net_mclist;
+ dev->set_mac_address = tun_mac_addr;
/* Generate random Ethernet address. */
*(u16 *)dev->dev_addr = htons(0x00FF);
next reply other threads:[~2004-04-12 6:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-04-12 6:59 Jeremy Martin [this message]
2004-04-12 7:15 ` [PATCH] fix tuntap oversight David S. Miller
2004-04-12 16:29 ` Jeremy Martin
2004-04-12 16:43 ` Jeff Garzik
2004-04-12 17:58 ` David S. Miller
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=20040412065947.GC18810@net-ronin.org \
--to=martinjd@csc.uvic.ca \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@oss.sgi.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).