summaryrefslogtreecommitdiff
path: root/addrtoname.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2015-04-26 18:42:23 -0700
committerGuy Harris <guy@alum.mit.edu>2015-04-26 18:42:23 -0700
commitdccbbf9a09fe917311400196b9a3542831b12598 (patch)
tree6dda49c1fe3fc866b06ab33a7ff98483c433c7c2 /addrtoname.c
parente3302bc807c1c3e0a2fd53bbe16cfbf95475e521 (diff)
downloadtcpdump-dccbbf9a09fe917311400196b9a3542831b12598.tar.gz
Don't cast away warnings for ether_ntohost().
We have a choice between "your OS's header files suck" warnings on HP-UX and -Wcast-qual warnings on all platforms. I vote for the former, as the latter let us find cases where we're casting constness away, and we really don't want to cast constness away if we can possibly avoid it.
Diffstat (limited to 'addrtoname.c')
-rw-r--r--addrtoname.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/addrtoname.c b/addrtoname.c
index e1319583..af6afb71 100644
--- a/addrtoname.c
+++ b/addrtoname.c
@@ -481,13 +481,7 @@ etheraddr_string(netdissect_options *ndo, register const u_char *ep)
if (!ndo->ndo_nflag) {
char buf2[BUFSIZE];
- /*
- * We don't cast it to "const struct ether_addr *"
- * because some systems fail to declare the second
- * argument as a "const" pointer, even though they
- * don't modify what it points to.
- */
- if (ether_ntohost(buf2, (struct ether_addr *)ep) == 0) {
+ if (ether_ntohost(buf2, (const struct ether_addr *)ep) == 0) {
tp->e_name = strdup(buf2);
return (tp->e_name);
}
@@ -880,13 +874,8 @@ init_etherarray(void)
#ifdef USE_ETHER_NTOHOST
/*
* Use YP/NIS version of name if available.
- *
- * We don't cast it to "const struct ether_addr *"
- * because some systems don't modify the Ethernet
- * address but fail to declare the second argument
- * as a "const" pointer.
*/
- if (ether_ntohost(name, (struct ether_addr *)el->addr) == 0) {
+ if (ether_ntohost(name, (const struct ether_addr *)el->addr) == 0) {
tp->e_name = strdup(name);
continue;
}