From d340bc24fc20d4d3bb4229498b21c851c10eee1b Mon Sep 17 00:00:00 2001 From: David Hankins Date: Fri, 20 Feb 2009 18:20:00 +0000 Subject: [PATCH] - Failover port configuration can now be left to defaults (port 647) as described in the -12 revision of the Failover draft (and assigned by IANA). [ISC-Bugs #17738] --- RELNOTES | 4 +++- includes/failover.h | 10 ++++++++++ server/confpars.c | 9 ++++----- server/dhcpd.conf.5 | 14 ++++++-------- 4 files changed, 23 insertions(+), 14 deletions(-) diff --git a/RELNOTES b/RELNOTES index 502f365dc..873e5eebf 100644 --- a/RELNOTES +++ b/RELNOTES @@ -38,7 +38,9 @@ work on other platforms. Please report any problems and suggested fixes to Changes since 4.1.0 (new features) - +- Failover port configuration can now be left to defaults (port 647) as + described in the -12 revision of the Failover draft (and assigned by + IANA). Changes since 4.1.0 (bug fixes) diff --git a/includes/failover.h b/includes/failover.h index 6bf0cc590..ed3dc961f 100644 --- a/includes/failover.h +++ b/includes/failover.h @@ -74,6 +74,16 @@ typedef struct { # define DEFAULT_MAX_RESPONSE_DELAY 20 #endif +/* + * IANA has assigned ports 647 ("dhcp-failover") and 847 ("dhcp-failover2"). + * Of these, only port 647 is mentioned in the -12 draft revision. We're not + * sure if they are supposed to indicate primary and secondary? No matter, + * we'll stick to the -12 draft revision level. + */ +#ifndef DEFAULT_FAILOVER_PORT +# define DEFAULT_FAILOVER_PORT 647 +#endif + #define FM_OFFSET(x) (long)(&(((failover_message_t *)0) -> x)) /* All of the below definitions are mandated by draft-ietf-dhc-failover-12. diff --git a/server/confpars.c b/server/confpars.c index f8e82266c..88ae3b527 100644 --- a/server/confpars.c +++ b/server/confpars.c @@ -1131,11 +1131,10 @@ void parse_failover_peer (cfile, group, type) if (!peer -> partner.address) parse_warn (cfile, "peer address may not be omitted"); - /* XXX - when/if we get a port number assigned, just set as default */ - if (!peer -> me.port) - parse_warn (cfile, "local port may not be omitted"); - if (!peer -> partner.port) - parse_warn (cfile, "peer port may not be omitted"); + if (!peer->me.port) + peer->me.port = DEFAULT_FAILOVER_PORT; + if (!peer->partner.port) + peer->partner.port = DEFAULT_FAILOVER_PORT; if (peer -> i_am == primary) { if (!peer -> hba) { diff --git a/server/dhcpd.conf.5 b/server/dhcpd.conf.5 index 78325850d..8352ea713 100644 --- a/server/dhcpd.conf.5 +++ b/server/dhcpd.conf.5 @@ -28,7 +28,7 @@ .\" see ``http://www.vix.com''. To learn more about Nominum, Inc., see .\" ``http://www.nominum.com''. .\" -.\" $Id: dhcpd.conf.5,v 1.100 2009/01/22 21:22:42 dhankins Exp $ +.\" $Id: dhcpd.conf.5,v 1.101 2009/02/20 18:20:00 dhankins Exp $ .\" .TH dhcpd.conf 5 .SH NAME @@ -594,9 +594,9 @@ statement .B port \fIport-number\fR\fB;\fR .PP The \fBport\fR statement declares the TCP port on which the server -should listen for connections from its failover peer. This statement -may not currently be omitted, because the failover protocol does not -yet have a reserved TCP port number. +should listen for connections from its failover peer. This statement +may be omitted, in which case the IANA assigned port number 647 will be +used by default. .RE .PP The @@ -608,10 +608,8 @@ statement .PP The \fBpeer port\fR statement declares the TCP port to which the server should connect to reach its failover peer for failover -messages. This statement may not be omitted because the failover -protocol does not yet have a reserved TCP port number. The port -number declared in the \fBpeer port\fR statement may be the same as -the port number declared in the \fBport\fR statement. +messages. This statement may be omitted, in which case the IANA +assigned port number 647 will be used by default. .RE .PP The -- 2.47.3