diff options
author | Shawn Routhier <sar@isc.org> | 2010-09-09 22:18:02 +0000 |
---|---|---|
committer | Shawn Routhier <sar@isc.org> | 2010-09-09 22:18:02 +0000 |
commit | 57fbc772210d73a091c828ca3a5f4fa692f3d582 (patch) | |
tree | f2aea3fa77fadc2cd3b099cac21632efc18d37f1 /common/dlpi.c | |
parent | 228e44472252fec51c05eaf9e878f684fb583a76 (diff) | |
download | isc-dhcp-57fbc772210d73a091c828ca3a5f4fa692f3d582.tar.gz |
Another batch of fixes
Correct error handling in DLPI [ISC-Bugs #20378]
Remove __sun__ and __hpux__ typedefs in osdep.h as they are now being
checked in configure. [ISC-Bugs #20443]
Modify how the cmsg header is allocated the v6 send and received routines
to compile on more compilers. [ISC-Bugs #20524]
When parsing a domain name free the memory for the name after we are
done with it. [ISC-Bugs #20824]
Diffstat (limited to 'common/dlpi.c')
-rw-r--r-- | common/dlpi.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/common/dlpi.c b/common/dlpi.c index eb64342c..002480ff 100644 --- a/common/dlpi.c +++ b/common/dlpi.c @@ -3,7 +3,8 @@ Data Link Provider Interface (DLPI) network interface code. */ /* - * Copyright (c) 2004,2007,2009 by Internet Systems Consortium, Inc. ("ISC") + * Copyright (c) 2009-2010 by Internet Systems Consortium, Inc. ("ISC") + * Copyright (c) 2004,2007 by Internet Systems Consortium, Inc. ("ISC") * Copyright (c) 1996-2003 by Internet Software Consortium * * Permission to use, copy, modify, and distribute this software for any @@ -981,7 +982,7 @@ static int dlpibindack (fd, bufp) dlp = (union DL_primitives *)ctl.buf; - if (!expected (DL_BIND_ACK, dlp, flags) < 0) { + if (expected (DL_BIND_ACK, dlp, flags) == -1) { return -1; } @@ -1015,7 +1016,7 @@ static int dlpiokack (fd, bufp) dlp = (union DL_primitives *)ctl.buf; - if (!expected (DL_OK_ACK, dlp, flags) < 0) { + if (expected (DL_OK_ACK, dlp, flags) == -1) { return -1; } @@ -1049,7 +1050,7 @@ static int dlpiinfoack (fd, bufp) dlp = (union DL_primitives *) ctl.buf; - if (!expected (DL_INFO_ACK, dlp, flags) < 0) { + if (expected (DL_INFO_ACK, dlp, flags) == -1) { return -1; } @@ -1083,7 +1084,7 @@ int dlpiphysaddrack (fd, bufp) dlp = (union DL_primitives *)ctl.buf; - if (!expected (DL_PHYS_ADDR_ACK, dlp, flags) < 0) { + if (expected (DL_PHYS_ADDR_ACK, dlp, flags) == -1) { return -1; } @@ -1225,15 +1226,15 @@ static int expected (prim, dlp, msgflags) { if (msgflags != RS_HIPRI) { /* Message was not M_PCPROTO */ - return 0; + return -1; } - if (dlp -> dl_primitive != prim) { + if (dlp->dl_primitive != prim) { /* Incorrect/unexpected return message */ - return 0; + return -1; } - return 1; + return 0; } /* |