openbsd-ports/net/pdnsd/patches/patch-netdev_c
camield 82a4c631a2 threaded dns daemon, optimized for caching
Submitted by Sebastian Stark <seb@todesplanet.de>
2001-06-14 14:46:07 +00:00

32 lines
1004 B
Plaintext

$OpenBSD: patch-netdev_c,v 1.1.1.1 2001/06/14 14:46:07 camield Exp $
- add define from FreeBSD net/if.h as we don't have it here
--- src/netdev.c.orig Wed May 9 19:51:52 2001
+++ src/netdev.c Thu Jun 14 11:09:05 2001
@@ -22,7 +22,9 @@ Boston, MA 02111-1307, USA. */
#include "ipvers.h"
#include <sys/stat.h>
#include <sys/ioctl.h>
+#ifndef __OPENBSD__
#include <net/if.h>
+#endif
#include <netdb.h>
#include <string.h>
#include <unistd.h>
@@ -37,6 +39,14 @@ Boston, MA 02111-1307, USA. */
static char rcsid[]="$Id: patch-netdev_c,v 1.1.1.1 2001/06/14 14:46:07 camield Exp $";
#endif
+/* borrowed from FreeBSD net/if.h */
+#ifdef __OpenBSD__
+#define _SIZEOF_ADDR_IFREQ(ifr) \
+((ifr).ifr_addr.sa_len > sizeof(struct sockaddr) ? \
+ (sizeof(struct ifreq) - sizeof(struct sockaddr) + \
+ (ifr).ifr_addr.sa_len) : sizeof(struct ifreq))
+#endif
+
/*
* These portion is Linux/FreeBSD specific. Please write interface-detection routines for other
* flavours of Unix if you can and want.