* [PATCH] Ensure local assignment bit on tun device MAC addr
@ 2007-03-31 0:49 Rusty Russell
2007-03-31 1:03 ` James Morris
0 siblings, 1 reply; 2+ messages in thread
From: Rusty Russell @ 2007-03-31 0:49 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev
This becomes especially important after the tun patch sitting in the -mm
tree is applied, but it works standalone. Please apply. (See netdev
posting Message-Id: <200703270550.l2R5o0Mh008378@shell0.pdx.osdl.net>)
==
The effect of this bug was made worse by Brian Braunstein's patch to keep
net_device.dev_addr and tun.dev_addr in sync.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
diff -r fd8c40f4f533 drivers/net/tun.c
--- a/drivers/net/tun.c Fri Mar 30 17:02:19 2007 +1000
+++ b/drivers/net/tun.c Sat Mar 31 10:30:47 2007 +1000
@@ -507,9 +507,7 @@ static int tun_set_iff(struct file *file
tun->flags = flags;
/* Be promiscuous by default to maintain previous behaviour. */
tun->if_flags = IFF_PROMISC;
- /* Generate random Ethernet address. */
- *(u16 *)tun->dev_addr = htons(0x00FF);
- get_random_bytes(tun->dev_addr + sizeof(u16), 4);
+ random_ether_addr(tun->dev_addr);
memset(tun->chr_filter, 0, sizeof tun->chr_filter);
tun_net_init(dev);
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Ensure local assignment bit on tun device MAC addr
2007-03-31 0:49 [PATCH] Ensure local assignment bit on tun device MAC addr Rusty Russell
@ 2007-03-31 1:03 ` James Morris
0 siblings, 0 replies; 2+ messages in thread
From: James Morris @ 2007-03-31 1:03 UTC (permalink / raw)
To: Rusty Russell; +Cc: David S. Miller, netdev
On Sat, 31 Mar 2007, Rusty Russell wrote:
> This becomes especially important after the tun patch sitting in the -mm
> tree is applied, but it works standalone. Please apply. (See netdev
> posting Message-Id: <200703270550.l2R5o0Mh008378@shell0.pdx.osdl.net>)
>
> ==
> The effect of this bug was made worse by Brian Braunstein's patch to keep
> net_device.dev_addr and tun.dev_addr in sync.
>
> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Acked-by: James Morris <jmorris@namei.org>
>
> diff -r fd8c40f4f533 drivers/net/tun.c
> --- a/drivers/net/tun.c Fri Mar 30 17:02:19 2007 +1000
> +++ b/drivers/net/tun.c Sat Mar 31 10:30:47 2007 +1000
> @@ -507,9 +507,7 @@ static int tun_set_iff(struct file *file
> tun->flags = flags;
> /* Be promiscuous by default to maintain previous behaviour. */
> tun->if_flags = IFF_PROMISC;
> - /* Generate random Ethernet address. */
> - *(u16 *)tun->dev_addr = htons(0x00FF);
> - get_random_bytes(tun->dev_addr + sizeof(u16), 4);
> + random_ether_addr(tun->dev_addr);
> memset(tun->chr_filter, 0, sizeof tun->chr_filter);
>
> tun_net_init(dev);
>
>
> -
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
--
James Morris
<jmorris@namei.org>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-03-31 1:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-31 0:49 [PATCH] Ensure local assignment bit on tun device MAC addr Rusty Russell
2007-03-31 1:03 ` James Morris
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).