summaryrefslogtreecommitdiffstats
path: root/usr.sbin/switchd/ofrelay.c
diff options
context:
space:
mode:
authorrzalamena <rzalamena@openbsd.org>2016-12-22 15:31:43 +0000
committerrzalamena <rzalamena@openbsd.org>2016-12-22 15:31:43 +0000
commitcc4fa12dd49a79985bb07c935a3ca2dd5017257e (patch)
tree40be7bd7502fea94c5426f7a1fa19e3e4a2de030 /usr.sbin/switchd/ofrelay.c
parentRelease the NET_LOCK() before namei(9) as a workaround to let NFS boot (diff)
downloadwireguard-openbsd-cc4fa12dd49a79985bb07c935a3ca2dd5017257e.tar.xz
wireguard-openbsd-cc4fa12dd49a79985bb07c935a3ca2dd5017257e.zip
Learn remote switch flow tables properties to find out where to install
the default table-miss flow for OpenFlow 1.3.5. This is enough to make switchd(8) to work with switch(4) and HP 3800 switch out-of-the-box. ok reyk@
Diffstat (limited to 'usr.sbin/switchd/ofrelay.c')
-rw-r--r--usr.sbin/switchd/ofrelay.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/switchd/ofrelay.c b/usr.sbin/switchd/ofrelay.c
index 9cf4ac83f4a..653882caa4c 100644
--- a/usr.sbin/switchd/ofrelay.c
+++ b/usr.sbin/switchd/ofrelay.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ofrelay.c,v 1.9 2016/12/02 14:39:46 rzalamena Exp $ */
+/* $OpenBSD: ofrelay.c,v 1.10 2016/12/22 15:31:43 rzalamena Exp $ */
/*
* Copyright (c) 2016 Reyk Floeter <reyk@openbsd.org>
@@ -98,6 +98,7 @@ ofrelay_close(struct switch_connection *con)
TAILQ_REMOVE(&sc->sc_conns, con, con_entry);
ofrelay_sessions--;
+ switch_freetables(con);
ofp_multipart_clear(con);
switch_remove(con->con_sc, con->con_switch);
msgbuf_clear(&con->con_wbuf);
@@ -405,6 +406,7 @@ ofrelay_attach(struct switch_server *srv, int s, struct sockaddr *sa)
con->con_srv = srv;
con->con_state = OFP_STATE_CLOSED;
SLIST_INIT(&con->con_mmlist);
+ TAILQ_INIT(&con->con_stlist);
memcpy(&con->con_peer, sa, sa->sa_len);
con->con_port = htons(socket_getport(&con->con_peer));