From 0f85a59a258aaa4d19e209c9b2e6b655ab0a87bf Mon Sep 17 00:00:00 2001 From: jakllsch Date: Sat, 15 Dec 2012 04:40:33 +0000 Subject: [PATCH] Even though the kernel will fill the source address in, it looks weird in trace output to see a not-obviously-bogus uninitialized source address go into the kernel. --- usr.sbin/wakeonlan/wakeonlan.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr.sbin/wakeonlan/wakeonlan.c b/usr.sbin/wakeonlan/wakeonlan.c index 300b0066f355..0086a9708484 100644 --- a/usr.sbin/wakeonlan/wakeonlan.c +++ b/usr.sbin/wakeonlan/wakeonlan.c @@ -1,4 +1,4 @@ -/* $NetBSD: wakeonlan.c,v 1.1 2012/05/26 01:58:21 uebayasi Exp $ */ +/* $NetBSD: wakeonlan.c,v 1.2 2012/12/15 04:40:33 jakllsch Exp $ */ /* * Copyright (C) 2006, 2007, 2008, 2009, 2010 Marc Balmer @@ -167,6 +167,7 @@ send_wakeup(int bpf, struct ether_addr const *addr) ssize_t bw, len; memset(pkt.hdr.ether_dhost, 0xff, sizeof(pkt.hdr.ether_dhost)); + memset(pkt.hdr.ether_shost, 0x00, sizeof(pkt.hdr.ether_shost)); pkt.hdr.ether_type = htons(0); memset(pkt.data, 0xff, SYNC_LEN); for (p = pkt.data + SYNC_LEN, i = 0; i < DESTADDR_COUNT;