ebt_log.c ARP patch

"Dmitry B. Khlonin" <dmitry-AsMeOOct1NhWk0Htik3J/[email protected]>
Newsgroups gmane.linux.network.bridge.ebtables.devel
Message-ID <[email protected]>
Hi all!
I created small patch to improve logging of ARP packets in --log-arp 
target. Now it also output
contents of ARP packet: SRC and DST hw and proto addresses.


--- ebt_log.c   7 Jul 2003 11:43:51 -0000   1.1
+++ ebt_log.c   8 Jul 2003 10:09:59 -0000
@@ -73,6 +73,18 @@
        printk(" ARP HTYPE=%d, PTYPE=0x%04x, OPCODE=%d",
           ntohs(arph->ar_hrd), ntohs(arph->ar_pro),
           ntohs(arph->ar_op));
+       int i, j;
+       unsigned char *p = skb->nh.raw + sizeof(struct arphdr);
+       for (j=0;j<2;j++) {
+           if (j==0) printk(" src");
+           else printk(" dst");
+           printk(" MAC=");
+           for (i = 0; i < ETH_ALEN; i++,p++)
+           printk("%02x%c", *p, i == ETH_ALEN - 1 ? ' ':':');
+           printk(" IP=");
+           for (i = 0; i < arph->ar_pln; i++,p++)
+           printk("%u%c", *p, i == arph->ar_pln - 1 ? ' ':'.');
+       }
    }
    printk("\n");
    spin_unlock_bh(&ebt_log_lock);




-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.