summaryrefslogtreecommitdiff
path: root/pcap-dlpi.c
diff options
context:
space:
mode:
authorguy <guy>2006-04-04 05:32:27 +0000
committerguy <guy>2006-04-04 05:32:27 +0000
commitcbcd540a75f60872d0252a7161793d9c28f49dc1 (patch)
treec22c11bfa64f9cab57351c0ab285ccf9157f4233 /pcap-dlpi.c
parent8815467ef5d38cbeb19e3af04703c807f9f9b7dc (diff)
downloadlibpcap-cbcd540a75f60872d0252a7161793d9c28f49dc1.tar.gz
putmsg() returns 0 or -1, not the number of bytes written.
Diffstat (limited to 'pcap-dlpi.c')
-rw-r--r--pcap-dlpi.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/pcap-dlpi.c b/pcap-dlpi.c
index d87f8c93..1345525e 100644
--- a/pcap-dlpi.c
+++ b/pcap-dlpi.c
@@ -70,7 +70,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/libpcap/pcap-dlpi.c,v 1.115 2005-08-13 23:14:24 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/libpcap/pcap-dlpi.c,v 1.116 2006-04-04 05:32:27 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -396,6 +396,14 @@ pcap_inject_dlpi(pcap_t *p, const void *buf, size_t size)
pcap_strerror(errno));
return (-1);
}
+ /*
+ * putmsg() returns either 0 or -1; it doesn't indicate how
+ * many bytes were written (presumably they were all written
+ * or none of them were written). OpenBSD's pcap_inject()
+ * returns the number of bytes written, so, for API compatibility,
+ * we return the number of bytes we were told to write.
+ */
+ ret = size;
#else /* no raw mode */
/*
* XXX - this is a pain, because you might have to extract