#ifndef lint
static char ocopyright[] =
-"$Id: dhclient.c,v 1.44.2.20 1999/02/19 18:30:19 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
+"$Id: dhclient.c,v 1.44.2.21 1999/02/23 17:42:52 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
ip -> client -> packet_length,
inaddr_any, &sockaddr_broadcast,
(struct hardware *)0);
- if (result < 0)
- warn ("send_packet: %m");
add_timeout (cur_time + ip -> client -> interval, send_discover, ip);
}
from, &destination,
(struct hardware *)0);
- if (result < 0)
- warn ("send_packet: %m");
-
add_timeout (cur_time + ip -> client -> interval,
send_request, ip);
}
ip -> client -> packet_length,
inaddr_any, &sockaddr_broadcast,
(struct hardware *)0);
- if (result < 0)
- warn ("send_packet: %m");
}
void send_release (ipp)
ip -> client -> packet_length,
inaddr_any, &sockaddr_broadcast,
(struct hardware *)0);
- if (result < 0)
- warn ("send_packet: %m");
}
void make_discover (ip, lease)
#ifndef lint
static char copyright[] =
-"$Id: bpf.c,v 1.19.2.6 1999/02/09 04:46:59 mellon Exp $ Copyright (c) 1995, 1996, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
+"$Id: bpf.c,v 1.19.2.7 1999/02/23 17:35:45 mellon Exp $ Copyright (c) 1995, 1996, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
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_BPF_SEND */
Data Link Provider Interface (DLPI) network interface code. */
/*
- * Copyright (c) 1998 The Internet Software Consortium.
+ * Copyright (c) 1998, 1999 The Internet Software Consortium.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
unsigned char dstaddr [DLPI_MAXDLADDR];
unsigned addrlen;
int saplen;
- int rslt;
+ int result;
if (!strcmp (interface -> name, "fallback"))
return send_fallback (interface, packet, raw,
dbuflen += len;
#ifdef USE_DLPI_RAW
- rslt = write (interface -> wfdesc, dbuf, dbuflen);
+ result = write (interface -> wfdesc, dbuf, dbuflen);
#else
/* XXX: Assumes ethernet, with two byte SAP */
sap [0] = 0x08; /* ETHERTYPE_IP, high byte */
addrlen = interface -> hw_address.hlen + ABS (saplen);
/* Send the packet down the wire... */
- rslt = dlpiunitdatareq (interface -> wfdesc, dstaddr, addrlen,
- 0, 0, dbuf, dbuflen);
+ result = dlpiunitdatareq (interface -> wfdesc, dstaddr, addrlen,
+ 0, 0, dbuf, dbuflen);
#endif
- return rslt;
+ if (result < 0)
+ warn ("send_packet: %m");
+ return result;
}
#endif /* USE_DLPI_SEND */
int length = 0;
int offset = 0;
int bufix = 0;
- int rslt;
#ifdef USE_DLPI_RAW
length = read (interface -> rfdesc, dbuf, sizeof (dbuf));
union DL_primitives *dlp;
struct strbuf ctl, data;
int flags = 0;
- int rslt;
+ int result;
/* Set up the msg_buf structure... */
dlp = (union DL_primitives *)buf;
data.len = 0;
data.buf = (char *)dbuf;
- rslt = getmsg (fd, &ctl, &data, &flags);
+ result = getmsg (fd, &ctl, &data, &flags);
- if (rslt != 0) {
+ if (result != 0) {
return -1;
}
int *flagsp;
int fd;
{
- int rslt;
+ int result;
#ifdef USE_POLL
struct pollfd pfd;
int count;
* Set flags argument and issue getmsg ().
*/
*flagsp = 0;
- if ((rslt = getmsg (fd, ctlp, datap, flagsp)) < 0) {
- return rslt;
+ if ((result = getmsg (fd, ctlp, datap, flagsp)) < 0) {
+ return result;
}
#ifndef USE_POLL
/*
* Check for MOREDATA and/or MORECTL.
*/
- if (rslt & (MORECTL|MOREDATA)) {
+ if (result & (MORECTL|MOREDATA)) {
return -1;
}
#ifndef lint
static char copyright[] =
-"$Id: lpf.c,v 1.1.2.4 1999/02/09 04:51:05 mellon Exp $ Copyright (c) 1995, 1996, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
+"$Id: lpf.c,v 1.1.2.5 1999/02/23 17:35:45 mellon Exp $ Copyright (c) 1995, 1996, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
int bufp = 0;
unsigned char buf [1500];
struct sockaddr sa;
+ int result;
if (!strcmp (interface -> name, "fallback"))
return send_fallback (interface, packet, raw,
strncpy (sa.sa_data,
(const char *)interface -> ifp, sizeof sa.sa_data);
- return sendto (interface -> wfdesc, buf, bufp + len, 0,
- &sa, sizeof sa);
+ result = sendto (interface -> wfdesc, buf, bufp + len, 0,
+ &sa, sizeof sa);
+ if (result < 0)
+ warn ("send_packet: %m");
+ return result;
}
#endif /* USE_LPF_SEND */
with one crucial tidbit of help from Stu Grossmen. */
/*
- * Copyright (c) 1996 The Internet Software Consortium.
+ * Copyright (c) 1996, 1998, 1999 The Internet Software Consortium.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
#ifndef lint
static char copyright[] =
-"$Id: nit.c,v 1.15.2.1 1998/12/20 18:27:44 mellon Exp $ Copyright (c) 1996 The Internet Software Consortium. All rights reserved.\n";
+"$Id: nit.c,v 1.15.2.2 1999/02/23 17:35:46 mellon Exp $ Copyright (c) 1996 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
struct strbuf ctl, data;
int hw_end;
struct sockaddr_in foo;
+ int result;
if (!strcmp (interface -> name, "fallback"))
return send_fallback (interface, packet, raw,
data.buf = (char *)&buf [hw_end];
data.maxlen = data.len = bufp + len - hw_end;
- return putmsg (interface -> wfdesc, &ctl, &data, 0);
+ result = putmsg (interface -> wfdesc, &ctl, &data, 0);
+ if (result < 0)
+ warn ("send_packet: %m");
+ return result;
}
#endif /* USE_NIT_SEND */
Sigh. */
/*
- * Copyright (c) 1995, 1996 The Internet Software Consortium.
+ * Copyright (c) 1995, 1996, 1997, 1999 The Internet Software Consortium.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
#ifndef lint
static char copyright[] =
-"$Id: raw.c,v 1.11 1997/10/20 21:47:14 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
+"$Id: raw.c,v 1.11.2.1 1999/02/23 17:35:46 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1999 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
unsigned char buf [256];
int bufp = 0;
struct iovec iov [2];
+ int result;
/* Assemble the headers... */
assemble_udp_ip_header (interface, buf, &bufp, from.s_addr,
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_SOCKET_SEND */
#ifndef lint
static char copyright[] =
-"$Id: socket.c,v 1.26.2.8 1999/02/19 18:17:34 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
+"$Id: socket.c,v 1.26.2.9 1999/02/23 17:35:46 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
errno == ECONNREFUSED) &&
retry++ < 10);
#endif
+ if (result < 0) {
+ warn ("send_packet: %m");
+ if (errno == ENETUNREACH)
+ warn ("send_packet: please consult README file %s",
+ "regarding broadcast address.");
+ }
return result;
}
#endif /* USE_SOCKET_SEND */
Ultrix PacketFilter interface code.
/*
- * Copyright (c) 1995, 1996, 1997 The Internet Software Consortium.
- * All rights reserved.
+ * Copyright (c) 1995, 1996, 1997, 1998, 1999
+ * The Internet Software Consortium. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
#ifndef lint
static char copyright[] =
-"$Id: upf.c,v 1.3.2.1 1998/12/20 18:29:48 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
+"$Id: upf.c,v 1.3.2.2 1999/02/23 17:35:47 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
int bufp = 0;
unsigned char buf [256];
struct iovec iov [2];
+ int result;
if (!strcmp (interface -> name, "fallback"))
return send_fallback (interface, packet, raw,
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 */
#ifndef lint
static char ocopyright [] =
-"$Id: dhcrelay.c,v 1.9.2.15 1999/02/19 18:32:46 mellon Exp $ Copyright (c) 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
+"$Id: dhcrelay.c,v 1.9.2.16 1999/02/23 17:40:10 mellon Exp $ Copyright (c) 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
return;
}
- if (send_packet (out,
- (struct packet *)0,
- packet, length, out -> primary_address,
- &to, &hto) < 0)
- debug ("sendpkt: %m");
- else
+ if (!send_packet (out,
+ (struct packet *)0,
+ packet, length, out -> primary_address,
+ &to, &hto) < 0)
debug ("forwarded BOOTREPLY for %s to %s",
print_hw_addr (packet -> htype, packet -> hlen,
packet -> chaddr),
/* Otherwise, it's a BOOTREQUEST, so forward it to all the
servers. */
for (sp = servers; sp; sp = sp -> next) {
- if (send_packet ((fallback_interface
- ? fallback_interface : interfaces),
- (struct packet *)0,
- packet, length, ip -> primary_address,
- &sp -> to, (struct hardware *)0) < 0) {
- debug ("send_packet: %m");
- } else {
+ if (!send_packet ((fallback_interface
+ ? fallback_interface : interfaces),
+ (struct packet *)0,
+ packet, length, ip -> primary_address,
+ &sp -> to, (struct hardware *)0) < 0) {
debug ("forwarded BOOTREQUEST for %s to %s",
print_hw_addr (packet -> htype, packet -> hlen,
packet -> chaddr),
BOOTP Protocol support. */
/*
- * Copyright (c) 1995, 1996 The Internet Software Consortium.
+ * Copyright (c) 1995, 1996, 1998, 1999 The Internet Software Consortium.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
#ifndef lint
static char copyright[] =
-"$Id: bootp.c,v 1.28.2.2 1998/12/21 04:21:30 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
+"$Id: bootp.c,v 1.28.2.3 1999/02/23 17:43:38 mellon Exp $ Copyright (c) 1995, 1996, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
(struct packet *)0,
&raw, outgoing.packet_length,
from, &to, &hto);
- if (result < 0)
- warn ("send_packet: %m");
return;
}
/* Otherwise, broadcast it on the local network. */
result = send_packet (packet -> interface,
packet, &raw, outgoing.packet_length,
from, &to, &hto);
- if (result < 0)
- warn ("send_packet: %m");
}