From 1ab049e8ccb3ea395b33e5c3e440ff9061981626 Mon Sep 17 00:00:00 2001 From: deraadt Date: Fri, 10 Sep 2021 00:00:55 +0000 Subject: [PATCH] the SunOS lseek 4G wraparound workaround is not needed, consequently pulling BSD from sys/param.h is not needed either --- lib/libpcap/pcap-bpf.c | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/lib/libpcap/pcap-bpf.c b/lib/libpcap/pcap-bpf.c index 068580f98c6..4b43edf8018 100644 --- a/lib/libpcap/pcap-bpf.c +++ b/lib/libpcap/pcap-bpf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pcap-bpf.c,v 1.37 2019/06/28 13:32:42 deraadt Exp $ */ +/* $OpenBSD: pcap-bpf.c,v 1.38 2021/09/10 00:00:55 deraadt Exp $ */ /* * Copyright (c) 1993, 1994, 1995, 1996, 1998 @@ -21,7 +21,6 @@ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ -#include /* optionally get BSD define */ #include #include #include @@ -114,20 +113,6 @@ pcap_read(pcap_t *p, int cnt, pcap_handler callback, u_char *user) "The interface went down"); return (PCAP_ERROR); -#if defined(sun) && !defined(BSD) - /* - * Due to a SunOS bug, after 2^31 bytes, the kernel - * file offset overflows and read fails with EINVAL. - * The lseek() to 0 will fix things. - */ - case EINVAL: - if (lseek(p->fd, 0L, SEEK_CUR) + - p->bufsize < 0) { - (void)lseek(p->fd, 0L, SEEK_SET); - goto again; - } - /* FALLTHROUGH */ -#endif } snprintf(p->errbuf, PCAP_ERRBUF_SIZE, "read: %s", pcap_strerror(errno)); -- 2.20.1