summaryrefslogtreecommitdiffstats
path: root/usr.sbin/switchd
diff options
context:
space:
mode:
authorakoshibe <akoshibe@openbsd.org>2018-11-08 17:12:12 +0000
committerakoshibe <akoshibe@openbsd.org>2018-11-08 17:12:12 +0000
commit14b22228d7b79b497eefa8002af73ed478a31c0a (patch)
tree2a1f50c801ff779dcef9d057c03f289a61baebee /usr.sbin/switchd
parentunveil(2) obvious _PATH_LOGIN_CONF with read permission to use login_get*(3) (diff)
downloadwireguard-openbsd-14b22228d7b79b497eefa8002af73ed478a31c0a.tar.xz
wireguard-openbsd-14b22228d7b79b497eefa8002af73ed478a31c0a.zip
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
Diffstat (limited to 'usr.sbin/switchd')
-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 */