summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorakoshibe <akoshibe@cvs.openbsd.org>2018-11-08 17:12:13 +0000
committerakoshibe <akoshibe@cvs.openbsd.org>2018-11-08 17:12:13 +0000
commit87db1e687f9a765f90d649565a4ef4a234b02bff (patch)
tree8155e186c6a2c98d40180d7354896a94aeaa7421
parentd5acbff1a4f17bbe6b00842b8cfe1b1c6a9f57f2 (diff)
Currently, switchd(8) defaults to listening on port 6633, which was the
defacto port value used by OpenFlow. A decent chunk of OpenFlow controllers have switched over to the IANA standardized OpenFlow port, 6653. switchd(8) also randomizes its listen ports when one is not specified in switchd.conf(5).conf. Consolidate the #defines for port values, and set a default listen port. OK phessler@ claudio@, kn@ with separate switchd.conf(5) update
-rw-r--r--usr.sbin/switchd/parse.y6
-rw-r--r--usr.sbin/switchd/types.h5
2 files changed, 6 insertions, 5 deletions
diff --git a/usr.sbin/switchd/parse.y b/usr.sbin/switchd/parse.y
index 81350328438..6da5e5ea0ee 100644
--- a/usr.sbin/switchd/parse.y
+++ b/usr.sbin/switchd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.12 2018/11/01 00:18:44 sashan Exp $ */
+/* $OpenBSD: parse.y,v 1.13 2018/11/08 17:12:12 akoshibe Exp $ */
/*
* Copyright (c) 2007-2016 Reyk Floeter <reyk@openbsd.org>
@@ -146,6 +146,8 @@ listen : LISTEN ON STRING opttls port {
YYERROR;
}
free($3);
+ ((struct sockaddr_in *)&conf->sc_server.srv_addr)
+ ->sin_port = htons(SWITCHD_CTLR_PORT);
}
;
@@ -627,7 +629,7 @@ parse_config(const char *filename, struct switchd *sc)
conf = sc;
- /* Set the default 0.0.0.0 6633/tcp */
+ /* Set the default 0.0.0.0 6653/tcp */
memset(&conf->sc_server.srv_addr, 0, sizeof(conf->sc_server.srv_addr));
sin4 = (struct sockaddr_in *)&conf->sc_server.srv_addr;
sin4->sin_family = AF_INET;
diff --git a/usr.sbin/switchd/types.h b/usr.sbin/switchd/types.h
index b89bae20712..4976e4cff1e 100644
--- a/usr.sbin/switchd/types.h
+++ b/usr.sbin/switchd/types.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: types.h,v 1.10 2016/11/18 16:49:35 reyk Exp $ */
+/* $OpenBSD: types.h,v 1.11 2018/11/08 17:12:12 akoshibe Exp $ */
/*
* Copyright (c) 2013-2016 Reyk Floeter <reyk@openbsd.org>
@@ -37,8 +37,7 @@
#define SWITCHD_MAX_TAP 256
#define SWITCHD_MAX_SESSIONS 0xffff
-#define SWITCHD_CTLR_PORT 6633 /* Previously used by OpenFlow */
-#define SWITCHD_CTLR_IANA_PORT 6653 /* Assigned by IANA for OpenFlow */
+#define SWITCHD_CTLR_PORT 6653 /* Assigned by IANA for OpenFlow */
#define SWITCHD_CACHE_MAX 4096 /* Default MAC address cache limit */
#define SWITCHD_CACHE_TIMEOUT 240 /* t/o in seconds for learned MACs */