mirror of
https://github.com/nmap/nmap.git
synced 2025-12-22 07:29:01 +00:00
Fix MSVC 2010's compilation warning on DLT_NULL_HEADER pointer assignment (https://github.com/nmap/nmap/issues/563)
This commit is contained in:
@@ -94,7 +94,7 @@ ssize_t
|
|||||||
eth_send(eth_t *eth, const void *buf, size_t len)
|
eth_send(eth_t *eth, const void *buf, size_t len)
|
||||||
{
|
{
|
||||||
/* 14-byte Ethernet header, but DLT_NULL is a 4-byte header. Skip over the difference */
|
/* 14-byte Ethernet header, but DLT_NULL is a 4-byte header. Skip over the difference */
|
||||||
DLT_NULL_HEADER *hdr = (uint8_t *)buf + ETH_HDR_LEN - DLT_NULL_HDR_LEN;
|
DLT_NULL_HEADER *hdr = (DLT_NULL_HEADER *)((uint8_t *)buf + ETH_HDR_LEN - DLT_NULL_HDR_LEN);
|
||||||
if (eth->type.LinkType == NdisMediumNull) {
|
if (eth->type.LinkType == NdisMediumNull) {
|
||||||
switch (ntohs(((struct eth_hdr *)buf)->eth_type)) {
|
switch (ntohs(((struct eth_hdr *)buf)->eth_type)) {
|
||||||
case ETH_TYPE_IP:
|
case ETH_TYPE_IP:
|
||||||
|
|||||||
Reference in New Issue
Block a user