summaryrefslogtreecommitdiff
path: root/common/upf.c
diff options
context:
space:
mode:
authorTed Lemon <source@isc.org>1999-02-25 23:30:43 +0000
committerTed Lemon <source@isc.org>1999-02-25 23:30:43 +0000
commit74f45f9642639bf4dfc7a28595363055d4c1b955 (patch)
tree84218f8405c4619b257b60a5bd5941090d9af0fa /common/upf.c
parentce53cc84e93fb0cdb4d6fa912577ea45074ea0f7 (diff)
downloadisc-dhcp-74f45f9642639bf4dfc7a28595363055d4c1b955.tar.gz
Sync with 2.0b1pl16. Fix some pool allocation problems.
Diffstat (limited to 'common/upf.c')
-rw-r--r--common/upf.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/common/upf.c b/common/upf.c
index 4fc2f01b..71d9254b 100644
--- a/common/upf.c
+++ b/common/upf.c
@@ -42,7 +42,7 @@
#ifndef lint
static char copyright[] =
-"$Id: upf.c,v 1.5 1999/02/24 17:56:49 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
+"$Id: upf.c,v 1.6 1999/02/25 23:30:36 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@@ -143,13 +143,14 @@ void if_register_send (info)
info -> wfdesc = info -> rfdesc;
#endif
if (!quiet_interface_discovery)
- log_info ("Sending on UPF/%s/%s/%s",
+ log_info ("Sending on UPF/%s/%s%s%s",
info -> name,
print_hw_addr (info -> hw_address.htype,
info -> hw_address.hlen,
info -> hw_address.haddr),
+ (info -> shared_network ? "/" : ""),
(info -> shared_network ?
- info -> shared_network -> name : "unattached"));
+ info -> shared_network -> name : ""));
}
#endif /* USE_UPF_SEND */
@@ -208,13 +209,14 @@ void if_register_receive (info)
if (ioctl (info -> rfdesc, EIOCSETF, &pf) < 0)
log_fatal ("Can't install packet filter program: %m");
if (!quiet_interface_discovery)
- log_info ("Listening on UPF/%s/%s/%s",
+ log_info ("Listening on UPF/%s/%s%s%s",
info -> name,
print_hw_addr (info -> hw_address.htype,
info -> hw_address.hlen,
info -> hw_address.haddr),
+ (info -> shared_network ? "/" : ""),
(info -> shared_network ?
- info -> shared_network -> name : "unattached"));
+ info -> shared_network -> name : ""));
}
#endif /* USE_UPF_RECEIVE */
@@ -231,6 +233,7 @@ ssize_t send_packet (interface, packet, raw, len, from, to, hto)
int bufp = 0;
unsigned char buf [256];
struct iovec iov [2];
+ int result;
if (!strcmp (interface -> name, "fallback"))
return send_fallback (interface, packet, raw,
@@ -248,7 +251,10 @@ ssize_t send_packet (interface, packet, raw, len, from, to, hto)
iov [1].iov_base = (char *)raw;
iov [1].iov_len = len;
- return writev(interface -> wfdesc, iov, 2);
+ result = writev(interface -> wfdesc, iov, 2);
+ if (result < 0)
+ warn ("send_packet: %m");
+ return result;
}
#endif /* USE_UPF_SEND */