summaryrefslogtreecommitdiff
path: root/community/ulogd/mac-addr.patch
blob: 87a76a22be01d02a9a94a667a6153e434d826ed3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
--- ulogd_BASE.c-save	2007-08-06 11:23:53.000000000 +0200
+++ ulogd_BASE.c	2007-08-06 11:28:47.000000000 +0200
@@ -63,7 +63,7 @@ static ulog_iret_t *_interp_raw(ulog_int
 {
 	unsigned char *p;
 	int i;
-	char *buf, *oldbuf = NULL;
+	char *buf = NULL;
 	ulog_iret_t *ret = ip->result;
 
 	if (pkt->mac_len) {
@@ -75,9 +75,8 @@ static ulog_iret_t *_interp_raw(ulog_int
 		*buf = '\0';
 
 		p = pkt->mac;
-		oldbuf = buf;
 		for (i = 0; i < pkt->mac_len; i++, p++)
-			sprintf(buf, "%s%02x%c", oldbuf, *p, i==pkt->mac_len-1 ? ' ':':');
+			sprintf(buf + (i*3), "%02x%c", *p, i==pkt->mac_len-1 ? ' ':':');
 		ret[0].value.ptr = buf;
 		ret[0].flags |= ULOGD_RETF_VALID;
 	}