mirror of
https://gitlab.isc.org/isc-projects/dhcp
synced 2025-09-02 15:25:48 +00:00
Work around FreeBSD BPF bug
This commit is contained in:
@@ -76,4 +76,5 @@ extern int h_errno;
|
|||||||
|
|
||||||
#if defined (USE_DEFAULT_NETWORK)
|
#if defined (USE_DEFAULT_NETWORK)
|
||||||
# define USE_BPF
|
# define USE_BPF
|
||||||
|
# define BROKEN_FREEBSD_BPF /* Fixed in 2.2 */
|
||||||
#endif
|
#endif
|
||||||
|
@@ -141,7 +141,12 @@ void assemble_hw_header (interface, buf, bufix, to)
|
|||||||
sizeof (eh.ether_shost));
|
sizeof (eh.ether_shost));
|
||||||
else
|
else
|
||||||
memset (eh.ether_shost, 0x00, sizeof (eh.ether_shost));
|
memset (eh.ether_shost, 0x00, sizeof (eh.ether_shost));
|
||||||
|
|
||||||
|
#ifdef BROKEN_FREEBSD_BPF /* Fixed in FreeBSD 2.2 */
|
||||||
|
eh.ether_type = ETHERTYPE_IP;
|
||||||
|
#else
|
||||||
eh.ether_type = htons (ETHERTYPE_IP);
|
eh.ether_type = htons (ETHERTYPE_IP);
|
||||||
|
#endif
|
||||||
|
|
||||||
memcpy (&buf [*bufix], &eh, sizeof eh);
|
memcpy (&buf [*bufix], &eh, sizeof eh);
|
||||||
*bufix += sizeof eh;
|
*bufix += sizeof eh;
|
||||||
|
@@ -76,4 +76,5 @@ extern int h_errno;
|
|||||||
|
|
||||||
#if defined (USE_DEFAULT_NETWORK)
|
#if defined (USE_DEFAULT_NETWORK)
|
||||||
# define USE_BPF
|
# define USE_BPF
|
||||||
|
# define BROKEN_FREEBSD_BPF /* Fixed in 2.2 */
|
||||||
#endif
|
#endif
|
||||||
|
5
packet.c
5
packet.c
@@ -141,7 +141,12 @@ void assemble_hw_header (interface, buf, bufix, to)
|
|||||||
sizeof (eh.ether_shost));
|
sizeof (eh.ether_shost));
|
||||||
else
|
else
|
||||||
memset (eh.ether_shost, 0x00, sizeof (eh.ether_shost));
|
memset (eh.ether_shost, 0x00, sizeof (eh.ether_shost));
|
||||||
|
|
||||||
|
#ifdef BROKEN_FREEBSD_BPF /* Fixed in FreeBSD 2.2 */
|
||||||
|
eh.ether_type = ETHERTYPE_IP;
|
||||||
|
#else
|
||||||
eh.ether_type = htons (ETHERTYPE_IP);
|
eh.ether_type = htons (ETHERTYPE_IP);
|
||||||
|
#endif
|
||||||
|
|
||||||
memcpy (&buf [*bufix], &eh, sizeof eh);
|
memcpy (&buf [*bufix], &eh, sizeof eh);
|
||||||
*bufix += sizeof eh;
|
*bufix += sizeof eh;
|
||||||
|
Reference in New Issue
Block a user