Fri Aug 7 16:37:12 2009 UTC ()
Correct the #ifdef test for struct ifdatareq.


(minskim)
diff -r1.6 -r1.7 src/dist/pf/sbin/pflogd/pflogd.c

cvs diff -r1.6 -r1.7 src/dist/pf/sbin/pflogd/pflogd.c (expand / switch to unified diff)

--- src/dist/pf/sbin/pflogd/pflogd.c 2009/07/15 18:05:17 1.6
+++ src/dist/pf/sbin/pflogd/pflogd.c 2009/08/07 16:37:12 1.7
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: pflogd.c,v 1.6 2009/07/15 18:05:17 christos Exp $ */ 1/* $NetBSD: pflogd.c,v 1.7 2009/08/07 16:37:12 minskim Exp $ */
2/* $OpenBSD: pflogd.c,v 1.45 2007/06/06 14:11:26 henning Exp $ */ 2/* $OpenBSD: pflogd.c,v 1.45 2007/06/06 14:11:26 henning Exp $ */
3 3
4/* 4/*
5 * Copyright (c) 2001 Theo de Raadt 5 * Copyright (c) 2001 Theo de Raadt
6 * Copyright (c) 2001 Can Erkin Acar 6 * Copyright (c) 2001 Can Erkin Acar
7 * All rights reserved. 7 * All rights reserved.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 12 *
13 * - Redistributions of source code must retain the above copyright 13 * - Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -194,27 +194,27 @@ set_pcap_filter(void) @@ -194,27 +194,27 @@ set_pcap_filter(void)
194 if (pcap_compile(hpcap, &bprog, filter, PCAP_OPT_FIL, 0) < 0) 194 if (pcap_compile(hpcap, &bprog, filter, PCAP_OPT_FIL, 0) < 0)
195 logmsg(LOG_WARNING, "%s", pcap_geterr(hpcap)); 195 logmsg(LOG_WARNING, "%s", pcap_geterr(hpcap));
196 else { 196 else {
197 if (pcap_setfilter(hpcap, &bprog) < 0) 197 if (pcap_setfilter(hpcap, &bprog) < 0)
198 logmsg(LOG_WARNING, "%s", pcap_geterr(hpcap)); 198 logmsg(LOG_WARNING, "%s", pcap_geterr(hpcap));
199 pcap_freecode(&bprog); 199 pcap_freecode(&bprog);
200 } 200 }
201} 201}
202 202
203int 203int
204if_exists(char *ifname) 204if_exists(char *ifname)
205{ 205{
206 int s; 206 int s;
207#ifdef SIOCGZIFDATA 207#ifdef SIOCGIFDATA
208 struct ifdatareq ifr; 208 struct ifdatareq ifr;
209#define ifr_name ifdr_name 209#define ifr_name ifdr_name
210#else 210#else
211 struct ifreq ifr; 211 struct ifreq ifr;
212 struct if_data ifrdat; 212 struct if_data ifrdat;
213#endif 213#endif
214 214
215 if ((s = socket(AF_INET, SOCK_DGRAM, 0)) == -1) 215 if ((s = socket(AF_INET, SOCK_DGRAM, 0)) == -1)
216 err(1, "socket"); 216 err(1, "socket");
217 bzero(&ifr, sizeof(ifr)); 217 bzero(&ifr, sizeof(ifr));
218 if (strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)) >= 218 if (strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)) >=
219 sizeof(ifr.ifr_name)) 219 sizeof(ifr.ifr_name))
220 errx(1, "main ifr_name: strlcpy"); 220 errx(1, "main ifr_name: strlcpy");