Module Name:    src
Committed By:   christos
Date:           Wed Jul 15 18:05:17 UTC 2009

Modified Files:
        src/dist/pf/sbin/pflogd: pflogd.c

Log Message:
use the proper structure to get interface data. We depend on having the
NetBSD-specific ZIFDATA call to do the selection of the ioctl style.
>From Patrick Welche.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/dist/pf/sbin/pflogd/pflogd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/dist/pf/sbin/pflogd/pflogd.c
diff -u src/dist/pf/sbin/pflogd/pflogd.c:1.5 src/dist/pf/sbin/pflogd/pflogd.c:1.6
--- src/dist/pf/sbin/pflogd/pflogd.c:1.5	Wed Jun 18 05:06:26 2008
+++ src/dist/pf/sbin/pflogd/pflogd.c	Wed Jul 15 14:05:17 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: pflogd.c,v 1.5 2008/06/18 09:06:26 yamt Exp $	*/
+/*	$NetBSD: pflogd.c,v 1.6 2009/07/15 18:05:17 christos Exp $	*/
 /*	$OpenBSD: pflogd.c,v 1.45 2007/06/06 14:11:26 henning Exp $	*/
 
 /*
@@ -204,8 +204,13 @@
 if_exists(char *ifname)
 {
 	int s;
+#ifdef SIOCGZIFDATA
+	struct ifdatareq ifr;
+#define ifr_name ifdr_name
+#else
 	struct ifreq ifr;
 	struct if_data ifrdat;
+#endif
 
 	if ((s = socket(AF_INET, SOCK_DGRAM, 0)) == -1)
 		err(1, "socket");
@@ -213,7 +218,9 @@
 	if (strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)) >=
 		sizeof(ifr.ifr_name))
 			errx(1, "main ifr_name: strlcpy");
+#ifndef ifr_name
 	ifr.ifr_data = (caddr_t)&ifrdat;
+#endif
 	if (ioctl(s, SIOCGIFDATA, (caddr_t)&ifr) == -1)
 		return (0);
 	if (close(s))

Reply via email to