From nobody@FreeBSD.org  Wed Oct  5 23:00:40 2005
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 72C3F16A43A
	for <freebsd-gnats-submit@FreeBSD.org>; Wed,  5 Oct 2005 23:00:40 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 468E143D45
	for <freebsd-gnats-submit@FreeBSD.org>; Wed,  5 Oct 2005 23:00:40 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id j95N0e0D075966
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 5 Oct 2005 23:00:40 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id j95N0dGE075965;
	Wed, 5 Oct 2005 23:00:39 GMT
	(envelope-from nobody)
Message-Id: <200510052300.j95N0dGE075965@www.freebsd.org>
Date: Wed, 5 Oct 2005 23:00:39 GMT
From: Remigiusz Hajduk <rhajduk@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [PATCH] ipfw mac logging
X-Send-Pr-Version: www-2.3

>Number:         86957
>Category:       kern
>Synopsis:       [ipfw] [patch] ipfw mac logging
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ipfw
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Oct 05 23:10:14 GMT 2005
>Closed-Date:    
>Last-Modified:  Mon Oct 24 05:12:37 GMT 2005
>Originator:     Remigiusz Hajduk
>Release:        5.4-RELEASE
>Organization:
home
>Environment:
FreeBSD devel 5.4-RELEASE FreeBSD 5.4-RELEASE #0: Sun May  8 10:21:06 UTC 2005     root@harlow.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386 
>Description:
              I added MAC address logging facility.
I think that it is useful and should be committed.
>How-To-Repeat:
              
>Fix:
--- sys/netinet/ip_fw2.c.orig   Tue Oct  4 23:06:20 2005
+++ sys/netinet/ip_fw2.c        Tue Oct  4 23:06:21 2005
@@ -665,7 +665,25 @@
        }
 
        if (hlen == 0) {        /* non-ip */
-               snprintf(SNPARGS(proto, 0), "MAC");
+               int len, i;
+               u_char *ptr;
+
+               len = snprintf(SNPARGS(proto, 0), "MAC ");
+
+               i = ETHER_ADDR_LEN;
+               ptr = eh->ether_dhost;
+
+               do {
+                       len += snprintf(SNPARGS(proto, len), "%s%02x", (i==ETHER_ADDR_LEN) ? "" : ":", *ptr++);
+               } while(--i > 0);
+
+               i = ETHER_ADDR_LEN;
+               ptr = eh->ether_shost;
+               len += snprintf(SNPARGS(proto, len), " ");
+               do {
+                       len += snprintf(SNPARGS(proto, len), "%s%02x", (i==ETHER_ADDR_LEN) ? "" : ":", *ptr++);
+               } while(--i > 0);
+
        } else {
                struct ip *ip = mtod(m, struct ip *);
                /* these three are all aliases to the same thing */

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-ipfw 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Mon Oct 24 05:12:25 GMT 2005 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=86957 
>Unformatted:
