* Fixed the test for equality when a known ARP reply came in - you should no longer
see the "ARP entry updated with different address" message. * sockaddr_dl::sdl_data is now unsigned (uint8_t instead of char). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20399 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2006, Haiku, Inc. All Rights Reserved.
|
* Copyright 2006-2007, Haiku, Inc. All Rights Reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
#ifndef _NET_IF_DL_H
|
#ifndef _NET_IF_DL_H
|
||||||
@@ -19,10 +19,10 @@ struct sockaddr_dl {
|
|||||||
uint8_t sdl_nlen; /* interface name length (not terminated with a null byte) */
|
uint8_t sdl_nlen; /* interface name length (not terminated with a null byte) */
|
||||||
uint8_t sdl_alen; /* link level address length */
|
uint8_t sdl_alen; /* link level address length */
|
||||||
uint8_t sdl_slen; /* link layer selector length */
|
uint8_t sdl_slen; /* link layer selector length */
|
||||||
char sdl_data[20]; /* minimum work area, can be larger */
|
uint8_t sdl_data[20]; /* minimum work area, can be larger */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Macro to get a pointer to the link level address */
|
/* Macro to get a pointer to the link level address */
|
||||||
#define LLADDR(s) ((char *)((s)->sdl_data + (s)->sdl_nlen))
|
#define LLADDR(s) ((uint8_t *)((s)->sdl_data + (s)->sdl_nlen))
|
||||||
|
|
||||||
#endif /* _NET_IF_DL_H */
|
#endif /* _NET_IF_DL_H */
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2006, Haiku, Inc. All Rights Reserved.
|
* Copyright 2006-2007, Haiku, Inc. All Rights Reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
@@ -219,11 +219,13 @@ arp_update_entry(in_addr_t protocolAddress, sockaddr_dl *hardwareAddress,
|
|||||||
// Right now, you have to manually purge the ARP entries (or wait some
|
// Right now, you have to manually purge the ARP entries (or wait some
|
||||||
// time) to let us switch to the new address.
|
// time) to let us switch to the new address.
|
||||||
if (entry->hardware_address.sdl_alen != 0
|
if (entry->hardware_address.sdl_alen != 0
|
||||||
&& memcmp(LLADDR(&entry->hardware_address), hardwareAddress, ETHER_ADDRESS_LENGTH)) {
|
&& memcmp(LLADDR(&entry->hardware_address),
|
||||||
|
LLADDR(hardwareAddress), ETHER_ADDRESS_LENGTH)) {
|
||||||
dprintf("ARP host %08lx updated with different hardware address %02x:%02x:%02x:%02x:%02x:%02x.\n",
|
dprintf("ARP host %08lx updated with different hardware address %02x:%02x:%02x:%02x:%02x:%02x.\n",
|
||||||
protocolAddress, hardwareAddress->sdl_data[0] & 0xff, hardwareAddress->sdl_data[1] & 0xff,
|
protocolAddress,
|
||||||
hardwareAddress->sdl_data[2] & 0xff, hardwareAddress->sdl_data[3] & 0xff,
|
hardwareAddress->sdl_data[0], hardwareAddress->sdl_data[1],
|
||||||
hardwareAddress->sdl_data[4] & 0xff, hardwareAddress->sdl_data[5] & 0xff);
|
hardwareAddress->sdl_data[2], hardwareAddress->sdl_data[3],
|
||||||
|
hardwareAddress->sdl_data[4], hardwareAddress->sdl_data[5]);
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user