diff options
author | obrien <obrien@FreeBSD.org> | 1999-02-28 20:34:40 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 1999-02-28 20:34:40 +0000 |
commit | c4a13b4e0fb1d954a15d47bc45e23fa34181f044 (patch) | |
tree | df4cd80f77d6ff8d12ecef362039cb4041880fa3 /contrib/isc-dhcp/common/lpf.c | |
parent | a342fabba36426fd65daff3e995941df89606c88 (diff) | |
download | FreeBSD-src-c4a13b4e0fb1d954a15d47bc45e23fa34181f044.zip FreeBSD-src-c4a13b4e0fb1d954a15d47bc45e23fa34181f044.tar.gz |
Virgin import of ISC-DHCP v2.0b1pl17
Diffstat (limited to 'contrib/isc-dhcp/common/lpf.c')
-rw-r--r-- | contrib/isc-dhcp/common/lpf.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/contrib/isc-dhcp/common/lpf.c b/contrib/isc-dhcp/common/lpf.c index 7c6ff74..d31d6f3 100644 --- a/contrib/isc-dhcp/common/lpf.c +++ b/contrib/isc-dhcp/common/lpf.c @@ -43,7 +43,7 @@ #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.6 1999/02/23 22:09:55 mellon Exp $ Copyright (c) 1995, 1996, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -129,13 +129,14 @@ void if_register_send (info) info -> wfdesc = info -> rfdesc; #endif if (!quiet_interface_discovery) - note ("Sending on LPF/%s/%s/%s", + note ("Sending on LPF/%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_LPF_SEND */ @@ -174,13 +175,14 @@ void if_register_receive (info) error ("Can't install packet filter program: %m"); } if (!quiet_interface_discovery) - note ("Listening on LPF/%s/%s/%s", + note ("Listening on LPF/%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_LPF_RECEIVE */ @@ -197,6 +199,7 @@ ssize_t send_packet (interface, packet, raw, len, from, to, hto) int bufp = 0; unsigned char buf [1500]; struct sockaddr sa; + int result; if (!strcmp (interface -> name, "fallback")) return send_fallback (interface, packet, raw, @@ -216,8 +219,11 @@ ssize_t send_packet (interface, packet, raw, len, from, to, hto) 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 */ |