summaryrefslogtreecommitdiffstats
path: root/ulogd/extensions
diff options
context:
space:
mode:
authorlaforge <laforge>2001-09-27 15:45:25 +0000
committerlaforge <laforge>2001-09-27 15:45:25 +0000
commit6e04a2e50595f02f198f574fa2bfb5dec96d16d7 (patch)
treeb03207d85bd93273862ceea240366da2d1e20ab3 /ulogd/extensions
parent86a404c6fb70c07b8c5997cbb3f84a4815d1a702 (diff)
Fix MAC address printing if there is none (by Andrej Ota)
Diffstat (limited to 'ulogd/extensions')
-rw-r--r--ulogd/extensions/ulogd_LOGEMU.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/ulogd/extensions/ulogd_LOGEMU.c b/ulogd/extensions/ulogd_LOGEMU.c
index 31ae337..5222786 100644
--- a/ulogd/extensions/ulogd_LOGEMU.c
+++ b/ulogd/extensions/ulogd_LOGEMU.c
@@ -1,4 +1,4 @@
-/* ulogd_LOGEMU.c, Version $Revision: 1.6 $
+/* ulogd_LOGEMU.c, Version $Revision: 1.7 $
*
* ulogd output target for syslog logging emulation
*
@@ -20,7 +20,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id: ulogd_LOGEMU.c,v 1.5 2001/05/20 15:07:45 laforge Exp $
+ * $Id: ulogd_LOGEMU.c,v 1.7 2001/09/01 11:51:54 laforge Exp $
*
*/
@@ -106,6 +106,7 @@ static struct intr_id intr_ids[INTR_IDS] = {
};
#define GET_VALUE(x) ulogd_keyh[intr_ids[x].id].interp->result[ulogd_keyh[intr_ids[x].id].offset].value
+#define GET_FLAGS(x) ulogd_keyh[intr_ids[x].id].interp->result[ulogd_keyh[intr_ids[x].id].offset].flags
int _output_logemu(ulog_iret_t *res)
{
@@ -136,7 +137,8 @@ int _output_logemu(ulog_iret_t *res)
(char *) GET_VALUE(2).ptr);
/* FIXME: configurable */
- fprintf(of, "MAC=%s ", (char *) GET_VALUE(3).ptr);
+ fprintf(of, "MAC=%s ",
+ (GET_FLAGS(3) & ULOGD_RETF_VALID) ? (char *) GET_VALUE(3).ptr : "");
fprintf(of, "SRC=%s ", inet_ntoa(htonl(GET_VALUE(4).ui32)));
fprintf(of, "DST=%s ", inet_ntoa(htonl(GET_VALUE(5).ui32)));