mirror of
https://gitlab.isc.org/isc-projects/dhcp
synced 2025-08-22 18:07:25 +00:00
[#75] Added target interface name to socket init failure logs
modified: RELNOTES common/socket.c
This commit is contained in:
parent
5c23b618b2
commit
4ad524bd4d
7
RELNOTES
7
RELNOTES
@ -104,7 +104,7 @@ ISC DHCP is open source software maintained by Internet Systems
|
|||||||
Consortium. This product includes cryptographic software written
|
Consortium. This product includes cryptographic software written
|
||||||
by Eric Young (eay@cryptsoft.com).
|
by Eric Young (eay@cryptsoft.com).
|
||||||
|
|
||||||
Changes since 4.4.2b1
|
Changes since 4.4.2b1 (Bug Fixes)
|
||||||
|
|
||||||
- Added a clarification on DHCPINFORMs and server authority to
|
- Added a clarification on DHCPINFORMs and server authority to
|
||||||
dhcpd.conf.5
|
dhcpd.conf.5
|
||||||
@ -114,6 +114,11 @@ by Eric Young (eay@cryptsoft.com).
|
|||||||
is defined.
|
is defined.
|
||||||
[Gitlab #72]
|
[Gitlab #72]
|
||||||
|
|
||||||
|
- Added the interface name to socket initialization failure log messages.
|
||||||
|
Prior to this the log messages stated only the error reason without
|
||||||
|
stating the target interface.
|
||||||
|
[Gitlab #75]
|
||||||
|
|
||||||
Changes since 4.4.1 (New Features)
|
Changes since 4.4.1 (New Features)
|
||||||
|
|
||||||
- A new configuration parameter, ping-cltt-secs (v4 operation only), has
|
- A new configuration parameter, ping-cltt-secs (v4 operation only), has
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
BSD socket interface code... */
|
BSD socket interface code... */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2019 by Internet Systems Consortium, Inc. ("ISC")
|
* Copyright (c) 2004-2020 by Internet Systems Consortium, Inc. ("ISC")
|
||||||
* Copyright (c) 1995-2003 by Internet Software Consortium
|
* Copyright (c) 1995-2003 by Internet Software Consortium
|
||||||
*
|
*
|
||||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
@ -211,7 +211,7 @@ if_register_socket(struct interface_info *info, int family,
|
|||||||
/* Make a socket... */
|
/* Make a socket... */
|
||||||
sock = socket(domain, SOCK_DGRAM, IPPROTO_UDP);
|
sock = socket(domain, SOCK_DGRAM, IPPROTO_UDP);
|
||||||
if (sock < 0) {
|
if (sock < 0) {
|
||||||
log_fatal("Can't create dhcp socket: %m");
|
log_fatal("Can't create dhcp socket for %s: %m", info->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set the REUSEADDR option so that we don't fail to start if
|
/* Set the REUSEADDR option so that we don't fail to start if
|
||||||
@ -219,7 +219,8 @@ if_register_socket(struct interface_info *info, int family,
|
|||||||
flag = 1;
|
flag = 1;
|
||||||
if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR,
|
if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR,
|
||||||
(char *)&flag, sizeof(flag)) < 0) {
|
(char *)&flag, sizeof(flag)) < 0) {
|
||||||
log_fatal("Can't set SO_REUSEADDR option on dhcp socket: %m");
|
log_fatal("Can't set SO_REUSEADDR on dhcp socket for"
|
||||||
|
" %s: %m", info->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set the BROADCAST option so that we can broadcast DHCP responses.
|
/* Set the BROADCAST option so that we can broadcast DHCP responses.
|
||||||
@ -228,7 +229,8 @@ if_register_socket(struct interface_info *info, int family,
|
|||||||
if (info->ifp &&
|
if (info->ifp &&
|
||||||
(setsockopt(sock, SOL_SOCKET, SO_BROADCAST,
|
(setsockopt(sock, SOL_SOCKET, SO_BROADCAST,
|
||||||
(char *)&flag, sizeof(flag)) < 0)) {
|
(char *)&flag, sizeof(flag)) < 0)) {
|
||||||
log_fatal("Can't set SO_BROADCAST option on dhcp socket: %m");
|
log_fatal("Can't set SO_BROADCAST on dhcp socket for"
|
||||||
|
" %s: %m", info->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(DHCPv6) && defined(SO_REUSEPORT)
|
#if defined(DHCPv6) && defined(SO_REUSEPORT)
|
||||||
@ -246,8 +248,8 @@ if_register_socket(struct interface_info *info, int family,
|
|||||||
if ((setsockopt(sock, SOL_SOCKET, SO_REUSEPORT,
|
if ((setsockopt(sock, SOL_SOCKET, SO_REUSEPORT,
|
||||||
(char *)&flag, sizeof(flag)) < 0) &&
|
(char *)&flag, sizeof(flag)) < 0) &&
|
||||||
(errno != ENOPROTOOPT)) {
|
(errno != ENOPROTOOPT)) {
|
||||||
log_fatal("Can't set SO_REUSEPORT option on dhcp "
|
log_fatal("Can't set SO_REUSEPORT on dhcp socket for"
|
||||||
"socket: %m");
|
" %s: %m", info->name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -267,7 +269,8 @@ if_register_socket(struct interface_info *info, int family,
|
|||||||
if ((local_family != AF_INET6) && (info->ifp != NULL) &&
|
if ((local_family != AF_INET6) && (info->ifp != NULL) &&
|
||||||
setsockopt(sock, SOL_SOCKET, SO_BINDTODEVICE,
|
setsockopt(sock, SOL_SOCKET, SO_BINDTODEVICE,
|
||||||
(char *)(info -> ifp), sizeof(*(info -> ifp))) < 0) {
|
(char *)(info -> ifp), sizeof(*(info -> ifp))) < 0) {
|
||||||
log_fatal("setsockopt: SO_BINDTODEVICE: %m");
|
log_fatal("Can't set SO_BINDTODEVICE on dhcp socket for"
|
||||||
|
" %s : %m", (char *)(info->ifp));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -282,7 +285,8 @@ if_register_socket(struct interface_info *info, int family,
|
|||||||
if (info->address_count &&
|
if (info->address_count &&
|
||||||
setsockopt(sock, IPPROTO_IP, IP_BROADCAST_IF, &info->addresses[0],
|
setsockopt(sock, IPPROTO_IP, IP_BROADCAST_IF, &info->addresses[0],
|
||||||
sizeof(info->addresses[0])) < 0)
|
sizeof(info->addresses[0])) < 0)
|
||||||
log_fatal("Can't set IP_BROADCAST_IF on dhcp socket: %m");
|
log_fatal("Can't set IP_BROADCAST_IF on dhcp socket for"
|
||||||
|
" %s: %m", info->name);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(IP_PKTINFO) && defined(IP_RECVPKTINFO) && defined(USE_V4_PKTINFO)
|
#if defined(IP_PKTINFO) && defined(IP_RECVPKTINFO) && defined(USE_V4_PKTINFO)
|
||||||
@ -294,7 +298,8 @@ if_register_socket(struct interface_info *info, int family,
|
|||||||
int on = 1;
|
int on = 1;
|
||||||
if (setsockopt(sock, IPPROTO_IP, IP_RECVPKTINFO,
|
if (setsockopt(sock, IPPROTO_IP, IP_RECVPKTINFO,
|
||||||
&on, sizeof(on)) != 0) {
|
&on, sizeof(on)) != 0) {
|
||||||
log_fatal("setsockopt: IPV_RECVPKTINFO: %m");
|
log_fatal("Can't set IP_RECVPTKINFO on dhcp socket for"
|
||||||
|
" %s: %m", info->name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user