|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
From b06fa16c0efeacc453f96e5640124acdf980bae7 Mon Sep 17 00:00:00 2001
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
From: Numan Siddique <numans@ovn.org>
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
Date: Tue, 22 Oct 2019 12:28:36 +0530
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
Subject: [PATCH 11/12] Send service monitor health checks
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
ovn-controller will periodically sends out the service monitor packets
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
for the services configured in the SB DB Service_Monitor table. This
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
patch makes use of the action - handle_svc_check to handle the service
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
monitor reply packets from the service.
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
This patch supports IPv4 TCP and UDP service monitoring. For TCP services,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
it sends out a TCP SYN packet and expects TCP ACK packet in response.
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
If the response is received on time, the status of the service is set to
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
"online", otherwise it is set to "offline".
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
For UDP services, it sends out a empty UDP packet and doesn't expect any
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
reply. In case the service is down, the host running the service, sends out
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
ICMP type 3 code 4 (destination unreachable) packet. If ovn-controller receives this
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
ICMP packet, it sets the status of the service to "offline".
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
Right now only IPv4 service monitoring is supported. An upcoming patch will add
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
the support for IPv6.
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
Change-Id: Ia8457c020b6d6cea15b1e5a73989a54430d8d9de
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
Acked-by: Mark Michelson <mmichels@redhat.com>
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
Signed-off-by: Numan Siddique <numans@ovn.org>
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
---
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
ovn/controller/ovn-controller.c | 2 +
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
ovn/controller/pinctrl.c | 775 ++++++++++++++++++++++++++++++--
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
ovn/controller/pinctrl.h | 2 +
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
ovn/northd/ovn-northd.8.xml | 10 +
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
ovn/northd/ovn-northd.c | 18 +
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
tests/ovn.at | 119 +++++
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
tests/system-common-macros.at | 1 +
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
tests/system-ovn.at | 180 ++++++++
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
8 files changed, 1081 insertions(+), 26 deletions(-)
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
diff --git a/ovn/controller/ovn-controller.c b/ovn/controller/ovn-controller.c
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
index cb3d63cbb..f2378ab99 100644
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
--- a/ovn/controller/ovn-controller.c
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+++ b/ovn/controller/ovn-controller.c
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
@@ -2046,6 +2046,8 @@ main(int argc, char *argv[])
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
sbrec_dns_table_get(ovnsb_idl_loop.idl),
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
sbrec_controller_event_table_get(
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
ovnsb_idl_loop.idl),
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ sbrec_service_monitor_table_get(
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ ovnsb_idl_loop.idl),
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
br_int, chassis,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
&ed_runtime_data.local_datapaths,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
&ed_runtime_data.active_tunnels);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
diff --git a/ovn/controller/pinctrl.c b/ovn/controller/pinctrl.c
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
index c6dd69fb3..ae1b8e1ca 100644
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
--- a/ovn/controller/pinctrl.c
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+++ b/ovn/controller/pinctrl.c
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
@@ -38,6 +38,7 @@
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
#include "openvswitch/ofp-switch.h"
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
#include "openvswitch/ofp-util.h"
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
#include "openvswitch/vlog.h"
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+#include "lib/random.h"
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
#include "lib/dhcp.h"
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
#include "ovn-controller.h"
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
@@ -284,6 +285,22 @@ static void run_put_vport_bindings(
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
static void wait_put_vport_bindings(struct ovsdb_idl_txn *ovnsb_idl_txn);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
static void pinctrl_handle_bind_vport(const struct flow *md,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
struct ofpbuf *userdata);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+static void pinctrl_handle_svc_check(struct rconn *swconn,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ const struct flow *ip_flow,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ struct dp_packet *pkt_in,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ const struct match *md);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+static void init_svc_monitors(void);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+static void destroy_svc_monitors(void);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+static void sync_svc_monitors(
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ struct ovsdb_idl_txn *ovnsb_idl_txn,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ const struct sbrec_service_monitor_table *svc_mon_table,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ struct ovsdb_idl_index *sbrec_port_binding_by_name,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ const struct sbrec_chassis *our_chassis)
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ OVS_REQUIRES(pinctrl_mutex);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+static void svc_monitors_run(struct rconn *swconn,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ long long int *svc_monitors_next_run_time)
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ OVS_REQUIRES(pinctrl_mutex);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+static void svc_monitors_wait(long long int svc_monitors_next_run_time);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
COVERAGE_DEFINE(pinctrl_drop_put_mac_binding);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
COVERAGE_DEFINE(pinctrl_drop_buffered_packets_map);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
@@ -446,6 +463,7 @@ pinctrl_init(void)
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
init_event_table();
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
ip_mcast_snoop_init();
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
init_put_vport_bindings();
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ init_svc_monitors();
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
pinctrl.br_int_name = NULL;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
pinctrl_handler_seq = seq_create();
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
pinctrl_main_seq = seq_create();
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
@@ -1983,6 +2001,13 @@ process_packet_in(struct rconn *swconn, const struct ofp_header *msg)
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
ovs_mutex_unlock(&pinctrl_mutex);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
break;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ case ACTION_OPCODE_HANDLE_SVC_CHECK:
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ ovs_mutex_lock(&pinctrl_mutex);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ pinctrl_handle_svc_check(swconn, &headers, &packet,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ &pin.flow_metadata);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ ovs_mutex_unlock(&pinctrl_mutex);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ break;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
default:
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
VLOG_WARN_RL(&rl, "unrecognized packet-in opcode %"PRIu32,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
ntohl(ah->opcode));
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
@@ -2052,6 +2077,7 @@ pinctrl_handler(void *arg_)
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
static long long int send_garp_time = LLONG_MAX;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
/* Next multicast query (IGMP) in ms. */
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
static long long int send_mcast_query_time = LLONG_MAX;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ static long long int svc_monitors_next_run_time = LLONG_MAX;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
swconn = rconn_create(5, 0, DSCP_DEFAULT, 1 << OFP13_VERSION);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
@@ -2112,11 +2138,16 @@ pinctrl_handler(void *arg_)
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
}
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
}
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ ovs_mutex_lock(&pinctrl_mutex);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ svc_monitors_run(swconn, &svc_monitors_next_run_time);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ ovs_mutex_unlock(&pinctrl_mutex);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
rconn_run_wait(swconn);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
rconn_recv_wait(swconn);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
send_garp_wait(send_garp_time);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
ipv6_ra_wait(send_ipv6_ra_time);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
ip_mcast_querier_wait(send_mcast_query_time);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ svc_monitors_wait(svc_monitors_next_run_time);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
new_seq = seq_read(pinctrl_handler_seq);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
seq_wait(pinctrl_handler_seq, new_seq);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
@@ -2142,6 +2173,7 @@ pinctrl_run(struct ovsdb_idl_txn *ovnsb_idl_txn,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
struct ovsdb_idl_index *sbrec_ip_multicast_opts,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
const struct sbrec_dns_table *dns_table,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
const struct sbrec_controller_event_table *ce_table,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ const struct sbrec_service_monitor_table *svc_mon_table,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
const struct ovsrec_bridge *br_int,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
const struct sbrec_chassis *chassis,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
const struct hmap *local_datapaths,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
@@ -2178,6 +2210,8 @@ pinctrl_run(struct ovsdb_idl_txn *ovnsb_idl_txn,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
run_buffered_binding(sbrec_port_binding_by_datapath,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
sbrec_mac_binding_by_lport_ip,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
local_datapaths);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ sync_svc_monitors(ovnsb_idl_txn, svc_mon_table, sbrec_port_binding_by_name,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ chassis);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
ovs_mutex_unlock(&pinctrl_mutex);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
}
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
@@ -2726,6 +2760,7 @@ pinctrl_destroy(void)
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
destroy_put_vport_bindings();
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
destroy_dns_cache();
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
ip_mcast_snoop_destroy();
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ destroy_svc_monitors();
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
seq_destroy(pinctrl_main_seq);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
seq_destroy(pinctrl_handler_seq);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
}
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
@@ -3158,6 +3193,36 @@ send_garp(struct rconn *swconn, struct garp_data *garp,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
return garp->announce_time;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
}
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+static void
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+pinctrl_compose_ipv4(struct dp_packet *packet, struct eth_addr eth_src,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ struct eth_addr eth_dst, ovs_be32 ipv4_src,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ ovs_be32 ipv4_dst, uint8_t ip_proto, uint8_t ttl,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ uint16_t ip_payload_len)
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+{
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ dp_packet_clear(packet);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ packet->packet_type = htonl(PT_ETH);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ struct eth_header *eh = dp_packet_put_zeros(packet, sizeof *eh);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ eh->eth_dst = eth_dst;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ eh->eth_src = eth_src;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ struct ip_header *nh = dp_packet_put_zeros(packet, sizeof *nh);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ eh->eth_type = htons(ETH_TYPE_IP);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ dp_packet_set_l3(packet, nh);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ nh->ip_ihl_ver = IP_IHL_VER(5, 4);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ nh->ip_tot_len = htons(sizeof(struct ip_header) + ip_payload_len);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ nh->ip_tos = IP_DSCP_CS6;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ nh->ip_proto = ip_proto;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ nh->ip_frag_off = htons(IP_DF);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ /* Setting tos and ttl to 0 and 1 respectively. */
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ packet_set_ipv4(packet, ipv4_src, ipv4_dst, 0, ttl);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ nh->ip_csum = 0;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ nh->ip_csum = csum(nh, sizeof *nh);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+}
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
/*
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
* Multicast snooping configuration.
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
*/
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
@@ -3775,32 +3840,11 @@ ip_mcast_querier_send(struct rconn *swconn, struct ip_mcast_snoop *ip_ms,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
struct dp_packet packet;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
dp_packet_use_stub(&packet, packet_stub, sizeof packet_stub);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
-
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
- uint8_t ip_tos = 0;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
- uint8_t igmp_ttl = 1;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
-
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
- dp_packet_clear(&packet);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
- packet.packet_type = htonl(PT_ETH);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
-
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
- struct eth_header *eh = dp_packet_put_zeros(&packet, sizeof *eh);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
- eh->eth_dst = ip_ms->cfg.query_eth_dst;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
- eh->eth_src = ip_ms->cfg.query_eth_src;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
-
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
- struct ip_header *nh = dp_packet_put_zeros(&packet, sizeof *nh);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
-
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
- eh->eth_type = htons(ETH_TYPE_IP);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
- dp_packet_set_l3(&packet, nh);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
- nh->ip_ihl_ver = IP_IHL_VER(5, 4);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
- nh->ip_tot_len = htons(sizeof(struct ip_header) +
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
- sizeof(struct igmpv3_query_header));
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
- nh->ip_tos = IP_DSCP_CS6;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
- nh->ip_proto = IPPROTO_IGMP;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
- nh->ip_frag_off = htons(IP_DF);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
- packet_set_ipv4(&packet, ip_ms->cfg.query_ipv4_src,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
- ip_ms->cfg.query_ipv4_dst, ip_tos, igmp_ttl);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
-
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
- nh->ip_csum = 0;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
- nh->ip_csum = csum(nh, sizeof *nh);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ pinctrl_compose_ipv4(&packet, ip_ms->cfg.query_eth_src,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ ip_ms->cfg.query_eth_dst,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ ip_ms->cfg.query_ipv4_src,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ ip_ms->cfg.query_ipv4_dst,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ IPPROTO_IGMP, 1, sizeof(struct igmpv3_query_header));
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
struct igmpv3_query_header *igh =
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
dp_packet_put_zeros(&packet, sizeof *igh);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
@@ -4693,3 +4737,682 @@ pinctrl_handle_bind_vport(
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
notify_pinctrl_main();
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
}
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+enum svc_monitor_state {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ SVC_MON_S_INIT,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ SVC_MON_S_WAITING,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ SVC_MON_S_ONLINE,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ SVC_MON_S_OFFLINE,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+};
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+enum svc_monitor_status {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ SVC_MON_ST_UNKNOWN,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ SVC_MON_ST_OFFLINE,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ SVC_MON_ST_ONLINE,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+};
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+enum svc_monitor_protocol {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ SVC_MON_PROTO_TCP,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ SVC_MON_PROTO_UDP,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+};
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+/* Service monitor health checks. */
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+struct svc_monitor {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ struct hmap_node hmap_node;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ struct ovs_list list_node;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ /* Should be accessed only with in the main ovn-controller
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ * thread. */
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ const struct sbrec_service_monitor *sb_svc_mon;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ /* key */
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ struct in6_addr ip;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ uint32_t dp_key;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ uint32_t port_key;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ uint32_t proto_port; /* tcp/udp port */
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ struct eth_addr ea;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ long long int timestamp;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ bool is_ip6;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ long long int wait_time;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ long long int next_send_time;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ struct smap options;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ /* The interval, in milli seconds, between service monitor checks. */
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ int interval;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ /* The time, in milli seconds, after which the service monitor check
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ * times out. */
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ int svc_timeout;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ /* The number of successful checks after which the service is
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ * considered online. */
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ int success_count;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ int n_success;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ /* The number of failure checks after which the service is
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ * considered offline. */
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ int failure_count;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ int n_failures;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ enum svc_monitor_protocol protocol;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ enum svc_monitor_state state;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ enum svc_monitor_status status;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ struct dp_packet pkt;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ uint32_t seq_no;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ ovs_be16 tp_src;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ bool delete;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+};
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+static struct hmap svc_monitors_map;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+static struct ovs_list svc_monitors;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+static void
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+init_svc_monitors(void)
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+{
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ hmap_init(&svc_monitors_map);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ ovs_list_init(&svc_monitors);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+}
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+static void
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+destroy_svc_monitors(void)
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+{
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ struct svc_monitor *svc;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ HMAP_FOR_EACH_POP (svc, hmap_node, &svc_monitors_map) {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ hmap_destroy(&svc_monitors_map);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ LIST_FOR_EACH_POP (svc, list_node, &svc_monitors) {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ smap_destroy(&svc->options);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ free(svc);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+}
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+static struct svc_monitor *
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+pinctrl_find_svc_monitor(uint32_t dp_key, uint32_t port_key,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ const struct in6_addr *ip_key, uint32_t port,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ enum svc_monitor_protocol protocol,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ uint32_t hash)
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+{
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ struct svc_monitor *svc;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ HMAP_FOR_EACH_WITH_HASH (svc, hmap_node, hash, &svc_monitors_map) {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ if (svc->dp_key == dp_key
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ && svc->port_key == port_key
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ && svc->proto_port == port
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ && IN6_ARE_ADDR_EQUAL(&svc->ip, ip_key)
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ && svc->protocol == protocol) {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ return svc;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ return NULL;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+}
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+static void
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+sync_svc_monitors(struct ovsdb_idl_txn *ovnsb_idl_txn,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ const struct sbrec_service_monitor_table *svc_mon_table,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ struct ovsdb_idl_index *sbrec_port_binding_by_name,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ const struct sbrec_chassis *our_chassis)
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ OVS_REQUIRES(pinctrl_mutex)
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+{
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ bool changed = false;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ struct svc_monitor *svc_mon;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ LIST_FOR_EACH (svc_mon, list_node, &svc_monitors) {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ svc_mon->delete = true;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ const struct sbrec_service_monitor *sb_svc_mon;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ SBREC_SERVICE_MONITOR_TABLE_FOR_EACH (sb_svc_mon, svc_mon_table) {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ const struct sbrec_port_binding *pb
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ = lport_lookup_by_name(sbrec_port_binding_by_name,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ sb_svc_mon->logical_port);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ if (!pb) {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ continue;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ if (pb->chassis != our_chassis) {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ continue;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ struct in6_addr ip_addr;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ ovs_be32 ip4;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ if (ip_parse(sb_svc_mon->ip, &ip4)) {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ ip_addr = in6_addr_mapped_ipv4(ip4);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ } else {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ continue;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ struct eth_addr ea;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ bool mac_found = false;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ for (size_t i = 0; i < pb->n_mac; i++) {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ struct lport_addresses laddrs;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ if (!extract_lsp_addresses(pb->mac[i], &laddrs)) {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ continue;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ for (size_t j = 0; j < laddrs.n_ipv4_addrs; j++) {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ if (ip4 == laddrs.ipv4_addrs[j].addr) {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ ea = laddrs.ea;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ mac_found = true;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ break;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ if (mac_found) {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ break;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ if (!mac_found) {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ continue;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ uint32_t dp_key = pb->datapath->tunnel_key;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ uint32_t port_key = pb->tunnel_key;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ uint32_t hash =
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ hash_bytes(&ip_addr, sizeof ip_addr,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ hash_3words(dp_key, port_key, sb_svc_mon->port));
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ enum svc_monitor_protocol protocol;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ if (!sb_svc_mon->protocol || strcmp(sb_svc_mon->protocol, "udp")) {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ protocol = SVC_MON_PROTO_TCP;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ } else {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ protocol = SVC_MON_PROTO_UDP;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ svc_mon = pinctrl_find_svc_monitor(dp_key, port_key, &ip_addr,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ sb_svc_mon->port, protocol, hash);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ if (!svc_mon) {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ svc_mon = xmalloc(sizeof *svc_mon);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ svc_mon->dp_key = dp_key;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ svc_mon->port_key = port_key;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ svc_mon->proto_port = sb_svc_mon->port;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ svc_mon->ip = ip_addr;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ svc_mon->is_ip6 = false;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ svc_mon->state = SVC_MON_S_INIT;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ svc_mon->status = SVC_MON_ST_UNKNOWN;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ svc_mon->protocol = protocol;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ smap_init(&svc_mon->options);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ svc_mon->interval =
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ smap_get_int(&svc_mon->options, "interval", 5) * 1000;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ svc_mon->svc_timeout =
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ smap_get_int(&svc_mon->options, "timeout", 3) * 1000;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ svc_mon->success_count =
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ smap_get_int(&svc_mon->options, "success_count", 1);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ svc_mon->failure_count =
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ smap_get_int(&svc_mon->options, "failure_count", 1);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ svc_mon->n_success = 0;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ svc_mon->n_failures = 0;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ hmap_insert(&svc_monitors_map, &svc_mon->hmap_node, hash);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ ovs_list_push_back(&svc_monitors, &svc_mon->list_node);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ changed = true;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ svc_mon->sb_svc_mon = sb_svc_mon;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ svc_mon->ea = ea;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ if (!smap_equal(&svc_mon->options, &sb_svc_mon->options)) {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ smap_destroy(&svc_mon->options);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ smap_clone(&svc_mon->options, &sb_svc_mon->options);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ svc_mon->interval =
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ smap_get_int(&svc_mon->options, "interval", 5) * 1000;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ svc_mon->svc_timeout =
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ smap_get_int(&svc_mon->options, "timeout", 3) * 1000;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ svc_mon->success_count =
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ smap_get_int(&svc_mon->options, "success_count", 1);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ svc_mon->failure_count =
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ smap_get_int(&svc_mon->options, "failure_count", 1);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ changed = true;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ svc_mon->delete = false;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ struct svc_monitor *next;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ LIST_FOR_EACH_SAFE (svc_mon, next, list_node, &svc_monitors) {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ if (svc_mon->delete) {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ hmap_remove(&svc_monitors_map, &svc_mon->hmap_node);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ ovs_list_remove(&svc_mon->list_node);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ smap_destroy(&svc_mon->options);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ free(svc_mon);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ changed = true;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ } else if (ovnsb_idl_txn) {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ /* Update the status of the service monitor. */
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ if (svc_mon->status != SVC_MON_ST_UNKNOWN) {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ if (svc_mon->status == SVC_MON_ST_ONLINE) {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ sbrec_service_monitor_set_status(svc_mon->sb_svc_mon,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ "online");
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ } else {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ sbrec_service_monitor_set_status(svc_mon->sb_svc_mon,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ "offline");
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ if (changed) {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ notify_pinctrl_handler();
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+}
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+static uint16_t
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+get_random_src_port(void)
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+{
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ uint16_t random_src_port = random_uint16();
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ while (random_src_port < 1024) {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ random_src_port = random_uint16();
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ return random_src_port;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+}
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+static void
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+svc_monitor_send_tcp_health_check__(struct rconn *swconn,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ struct svc_monitor *svc_mon,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ uint16_t ctl_flags,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ ovs_be32 tcp_seq,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ ovs_be32 tcp_ack,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ ovs_be16 tcp_src)
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+{
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ if (svc_mon->is_ip6) {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ return;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ /* Compose a TCP-SYN packet. */
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ uint64_t packet_stub[128 / 8];
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ struct dp_packet packet;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ struct eth_addr eth_src;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ eth_addr_from_string(svc_mon->sb_svc_mon->src_mac, ð_src);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ ovs_be32 ip4_src;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ ip_parse(svc_mon->sb_svc_mon->src_ip, &ip4_src);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ dp_packet_use_stub(&packet, packet_stub, sizeof packet_stub);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ pinctrl_compose_ipv4(&packet, eth_src, svc_mon->ea,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ ip4_src, in6_addr_get_mapped_ipv4(&svc_mon->ip),
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ IPPROTO_TCP, 63, TCP_HEADER_LEN);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ struct tcp_header *th = dp_packet_put_zeros(&packet, sizeof *th);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ dp_packet_set_l4(&packet, th);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ th->tcp_dst = htons(svc_mon->proto_port);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ th->tcp_src = tcp_src;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ th->tcp_ctl = htons((5 << 12) | ctl_flags);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ put_16aligned_be32(&th->tcp_seq, tcp_seq);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ put_16aligned_be32(&th->tcp_ack, tcp_ack);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ th->tcp_winsz = htons(65160);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ uint32_t csum;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ csum = packet_csum_pseudoheader(dp_packet_l3(&packet));
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ csum = csum_continue(csum, th, dp_packet_size(&packet) -
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ ((const unsigned char *)th -
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ (const unsigned char *)dp_packet_eth(&packet)));
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ th->tcp_csum = csum_finish(csum);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ uint64_t ofpacts_stub[4096 / 8];
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ struct ofpbuf ofpacts = OFPBUF_STUB_INITIALIZER(ofpacts_stub);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ enum ofp_version version = rconn_get_version(swconn);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ put_load(svc_mon->dp_key, MFF_LOG_DATAPATH, 0, 64, &ofpacts);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ put_load(svc_mon->port_key, MFF_LOG_OUTPORT, 0, 32, &ofpacts);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ put_load(1, MFF_LOG_FLAGS, MLF_LOCAL_ONLY, 1, &ofpacts);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ struct ofpact_resubmit *resubmit = ofpact_put_RESUBMIT(&ofpacts);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ resubmit->in_port = OFPP_CONTROLLER;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ resubmit->table_id = OFTABLE_LOCAL_OUTPUT;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ struct ofputil_packet_out po = {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ .packet = dp_packet_data(&packet),
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ .packet_len = dp_packet_size(&packet),
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ .buffer_id = UINT32_MAX,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ .ofpacts = ofpacts.data,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ .ofpacts_len = ofpacts.size,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ };
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ match_set_in_port(&po.flow_metadata, OFPP_CONTROLLER);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ enum ofputil_protocol proto = ofputil_protocol_from_ofp_version(version);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ queue_msg(swconn, ofputil_encode_packet_out(&po, proto));
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ dp_packet_uninit(&packet);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ ofpbuf_uninit(&ofpacts);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+}
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+static void
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+svc_monitor_send_udp_health_check(struct rconn *swconn,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ struct svc_monitor *svc_mon,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ ovs_be16 udp_src)
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+{
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ if (svc_mon->is_ip6) {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ return;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ struct eth_addr eth_src;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ eth_addr_from_string(svc_mon->sb_svc_mon->src_mac, ð_src);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ ovs_be32 ip4_src;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ ip_parse(svc_mon->sb_svc_mon->src_ip, &ip4_src);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ uint64_t packet_stub[128 / 8];
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ struct dp_packet packet;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ dp_packet_use_stub(&packet, packet_stub, sizeof packet_stub);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ pinctrl_compose_ipv4(&packet, eth_src, svc_mon->ea,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ ip4_src, in6_addr_get_mapped_ipv4(&svc_mon->ip),
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ IPPROTO_UDP, 63, UDP_HEADER_LEN + 8);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ struct udp_header *uh = dp_packet_put_zeros(&packet, sizeof *uh);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ dp_packet_set_l4(&packet, uh);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ uh->udp_dst = htons(svc_mon->proto_port);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ uh->udp_src = udp_src;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ uh->udp_len = htons(UDP_HEADER_LEN + 8);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ uh->udp_csum = 0;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ dp_packet_put_zeros(&packet, 8);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ uint64_t ofpacts_stub[4096 / 8];
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ struct ofpbuf ofpacts = OFPBUF_STUB_INITIALIZER(ofpacts_stub);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ enum ofp_version version = rconn_get_version(swconn);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ put_load(svc_mon->dp_key, MFF_LOG_DATAPATH, 0, 64, &ofpacts);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ put_load(svc_mon->port_key, MFF_LOG_OUTPORT, 0, 32, &ofpacts);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ put_load(1, MFF_LOG_FLAGS, MLF_LOCAL_ONLY, 1, &ofpacts);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ struct ofpact_resubmit *resubmit = ofpact_put_RESUBMIT(&ofpacts);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ resubmit->in_port = OFPP_CONTROLLER;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ resubmit->table_id = OFTABLE_LOCAL_OUTPUT;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ struct ofputil_packet_out po = {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ .packet = dp_packet_data(&packet),
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ .packet_len = dp_packet_size(&packet),
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ .buffer_id = UINT32_MAX,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ .ofpacts = ofpacts.data,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ .ofpacts_len = ofpacts.size,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ };
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ match_set_in_port(&po.flow_metadata, OFPP_CONTROLLER);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ enum ofputil_protocol proto = ofputil_protocol_from_ofp_version(version);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ queue_msg(swconn, ofputil_encode_packet_out(&po, proto));
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ dp_packet_uninit(&packet);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ ofpbuf_uninit(&ofpacts);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+}
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+static void
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+svc_monitor_send_health_check(struct rconn *swconn,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ struct svc_monitor *svc_mon)
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+{
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ if (svc_mon->protocol == SVC_MON_PROTO_TCP) {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ svc_mon->seq_no = random_uint32();
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ svc_mon->tp_src = htons(get_random_src_port());
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ svc_monitor_send_tcp_health_check__(swconn, svc_mon,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ TCP_SYN,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ htonl(svc_mon->seq_no), htonl(0),
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ svc_mon->tp_src);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ } else {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ if (!svc_mon->tp_src) {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ svc_mon->tp_src = htons(get_random_src_port());
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ svc_monitor_send_udp_health_check(swconn, svc_mon, svc_mon->tp_src);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ svc_mon->wait_time = time_msec() + svc_mon->svc_timeout;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ svc_mon->state = SVC_MON_S_WAITING;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+}
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+static void
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+svc_monitors_run(struct rconn *swconn,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ long long int *svc_monitors_next_run_time)
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ OVS_REQUIRES(pinctrl_mutex)
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+{
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ *svc_monitors_next_run_time = LLONG_MAX;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ struct svc_monitor *svc_mon;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ LIST_FOR_EACH (svc_mon, list_node, &svc_monitors) {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ char ip_[INET6_ADDRSTRLEN + 1];
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ memset(ip_, 0, INET6_ADDRSTRLEN + 1);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ ipv6_string_mapped(ip_, &svc_mon->ip);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ long long int current_time = time_msec();
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ long long int next_run_time = LLONG_MAX;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ enum svc_monitor_status old_status = svc_mon->status;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ switch (svc_mon->state) {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ case SVC_MON_S_INIT:
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ svc_monitor_send_health_check(swconn, svc_mon);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ next_run_time = svc_mon->wait_time;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ break;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ case SVC_MON_S_WAITING:
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ if (current_time > svc_mon->wait_time) {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ if (svc_mon->protocol == SVC_MON_PROTO_TCP) {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ svc_mon->n_failures++;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ svc_mon->state = SVC_MON_S_OFFLINE;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ } else {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ svc_mon->n_success++;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ svc_mon->state = SVC_MON_S_ONLINE;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ svc_mon->next_send_time = current_time + svc_mon->interval;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ next_run_time = svc_mon->next_send_time;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ } else {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ next_run_time = svc_mon->wait_time - current_time;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ next_run_time = svc_mon->wait_time;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ break;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ case SVC_MON_S_ONLINE:
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ if (svc_mon->n_success >= svc_mon->success_count) {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ svc_mon->status = SVC_MON_ST_ONLINE;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ svc_mon->n_success = 0;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ if (current_time >= svc_mon->next_send_time) {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ svc_monitor_send_health_check(swconn, svc_mon);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ next_run_time = svc_mon->wait_time;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ } else {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ next_run_time = svc_mon->next_send_time;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ break;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ case SVC_MON_S_OFFLINE:
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ if (svc_mon->n_failures >= svc_mon->failure_count) {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ svc_mon->status = SVC_MON_ST_OFFLINE;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ svc_mon->n_failures = 0;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ if (current_time >= svc_mon->next_send_time) {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ svc_monitor_send_health_check(swconn, svc_mon);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ next_run_time = svc_mon->wait_time;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ } else {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ next_run_time = svc_mon->next_send_time;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ break;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ default:
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ OVS_NOT_REACHED();
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ if (*svc_monitors_next_run_time > next_run_time) {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ *svc_monitors_next_run_time = next_run_time;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ if (old_status != svc_mon->status) {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ /* Notify the main thread to update the status in the SB DB. */
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ notify_pinctrl_main();
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+}
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+static void
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+svc_monitors_wait(long long int svc_monitors_next_run_time)
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+{
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ if (!ovs_list_is_empty(&svc_monitors)) {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ poll_timer_wait_until(svc_monitors_next_run_time);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+}
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+static bool
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+pinctrl_handle_tcp_svc_check(struct rconn *swconn,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ struct dp_packet *pkt_in,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ struct svc_monitor *svc_mon)
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+{
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ struct tcp_header *th = dp_packet_l4(pkt_in);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ if (!th) {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ return false;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ uint32_t tcp_seq = ntohl(get_16aligned_be32(&th->tcp_seq));
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ uint32_t tcp_ack = ntohl(get_16aligned_be32(&th->tcp_ack));
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ if (th->tcp_dst != svc_mon->tp_src) {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ return false;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ if (tcp_ack != (svc_mon->seq_no + 1)) {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ return false;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ /* Check for SYN flag and Ack flag. */
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ if ((TCP_FLAGS(th->tcp_ctl) & (TCP_SYN | TCP_ACK))
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ == (TCP_SYN | TCP_ACK)) {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ svc_mon->n_success++;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ svc_mon->state = SVC_MON_S_ONLINE;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ /* Send RST-ACK packet. */
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ svc_monitor_send_tcp_health_check__(swconn, svc_mon, TCP_RST | TCP_ACK,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ htonl(tcp_ack + 1),
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ htonl(tcp_seq + 1), th->tcp_dst);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ /* Calculate next_send_time. */
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ svc_mon->next_send_time = time_msec() + svc_mon->interval;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ return true;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ /* Check if RST flag is set. */
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ if (TCP_FLAGS(th->tcp_ctl) & TCP_RST) {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ svc_mon->n_failures++;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ svc_mon->state = SVC_MON_S_OFFLINE;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ /* Calculate next_send_time. */
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ svc_mon->next_send_time = time_msec() + svc_mon->interval;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ return false;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ return false;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+}
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+static void
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+pinctrl_handle_svc_check(struct rconn *swconn, const struct flow *ip_flow,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ struct dp_packet *pkt_in, const struct match *md)
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+{
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ uint32_t dp_key = ntohll(md->flow.metadata);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ uint32_t port_key = md->flow.regs[MFF_LOG_INPORT - MFF_REG0];
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ struct in6_addr ip_addr;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ struct eth_header *in_eth = dp_packet_data(pkt_in);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ struct ip_header *in_ip = dp_packet_l3(pkt_in);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ if (in_ip->ip_proto != IPPROTO_TCP && in_ip->ip_proto != IPPROTO_ICMP) {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ VLOG_WARN_RL(&rl,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ "handle service check: Unsupported protocol - [%x]",
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ in_ip->ip_proto);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ return;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ uint16_t in_ip_len = ntohs(in_ip->ip_tot_len);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ if (in_ip_len < IP_HEADER_LEN) {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ VLOG_WARN_RL(&rl,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ "IP packet with invalid length (%u)",
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ in_ip_len);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ return;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ if (in_eth->eth_type == htons(ETH_TYPE_IP)) {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ ip_addr = in6_addr_mapped_ipv4(ip_flow->nw_src);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ } else {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ ip_addr = ip_flow->ipv6_dst;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ if (in_ip->ip_proto == IPPROTO_TCP) {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ uint32_t hash =
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ hash_bytes(&ip_addr, sizeof ip_addr,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ hash_3words(dp_key, port_key, ntohs(ip_flow->tp_src)));
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ struct svc_monitor *svc_mon =
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ pinctrl_find_svc_monitor(dp_key, port_key, &ip_addr,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ ntohs(ip_flow->tp_src),
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ SVC_MON_PROTO_TCP, hash);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ if (!svc_mon) {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ VLOG_WARN_RL(&rl, "handle service check: Service monitor "
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ "not found");
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ return;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ pinctrl_handle_tcp_svc_check(swconn, pkt_in, svc_mon);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ } else {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ /* It's ICMP packet. */
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ struct icmp_header *ih = dp_packet_l4(pkt_in);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ if (!ih) {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ VLOG_WARN_RL(&rl, "ICMPv4 packet with invalid header");
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ return;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ if (ih->icmp_type != ICMP4_DST_UNREACH || ih->icmp_code != 3) {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ return;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ const char *end =
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ (char *)dp_packet_l4(pkt_in) + dp_packet_l4_size(pkt_in);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ const struct ip_header *orig_ip_hr =
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ dp_packet_get_icmp_payload(pkt_in);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ if (!orig_ip_hr) {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ VLOG_WARN_RL(&rl, "Original IP datagram not present in "
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ "ICMP packet");
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ return;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ if (ntohs(orig_ip_hr->ip_tot_len) !=
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ (IP_HEADER_LEN + UDP_HEADER_LEN + 8)) {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ VLOG_WARN_RL(&rl, "Invalid original IP datagram length present "
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ "in ICMP packet");
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ return;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ struct udp_header *orig_uh = (struct udp_header *) (orig_ip_hr + 1);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ if ((char *)orig_uh >= end) {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ VLOG_WARN_RL(&rl, "Invalid UDP header in the original "
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ "IP datagram");
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ return;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ uint32_t hash =
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ hash_bytes(&ip_addr, sizeof ip_addr,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ hash_3words(dp_key, port_key, ntohs(orig_uh->udp_dst)));
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ struct svc_monitor *svc_mon =
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ pinctrl_find_svc_monitor(dp_key, port_key, &ip_addr,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ ntohs(orig_uh->udp_dst),
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ SVC_MON_PROTO_UDP, hash);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ if (!svc_mon) {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ VLOG_WARN_RL(&rl, "handle service check: Service monitor not "
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ "found for ICMP packet");
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ return;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ if (orig_uh->udp_src != svc_mon->tp_src) {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ VLOG_WARN_RL(&rl, "handle service check: UDP src port doesn't "
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ "match in the Original IP datagram of ICMP packet");
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ return;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ /* The UDP service monitor is down. */
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ svc_mon->n_failures++;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ svc_mon->state = SVC_MON_S_OFFLINE;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ /* Calculate next_send_time. */
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ svc_mon->next_send_time = time_msec() + svc_mon->interval;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+}
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
diff --git a/ovn/controller/pinctrl.h b/ovn/controller/pinctrl.h
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
index fcfce6bcf..208272442 100644
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
--- a/ovn/controller/pinctrl.h
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+++ b/ovn/controller/pinctrl.h
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
@@ -30,6 +30,7 @@ struct ovsrec_bridge;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
struct sbrec_chassis;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
struct sbrec_dns_table;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
struct sbrec_controller_event_table;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+struct sbrec_service_monitor_table;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
void pinctrl_init(void);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
void pinctrl_run(struct ovsdb_idl_txn *ovnsb_idl_txn,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
@@ -42,6 +43,7 @@ void pinctrl_run(struct ovsdb_idl_txn *ovnsb_idl_txn,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
struct ovsdb_idl_index *sbrec_ip_multicast_opts,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
const struct sbrec_dns_table *,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
const struct sbrec_controller_event_table *,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ const struct sbrec_service_monitor_table *,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
const struct ovsrec_bridge *, const struct sbrec_chassis *,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
const struct hmap *local_datapaths,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
const struct sset *active_tunnels);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
diff --git a/ovn/northd/ovn-northd.8.xml b/ovn/northd/ovn-northd.8.xml
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
index 9515c7790..956a10362 100644
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
--- a/ovn/northd/ovn-northd.8.xml
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+++ b/ovn/northd/ovn-northd.8.xml
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
@@ -1009,6 +1009,16 @@ output;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ A priorirty-110 flow with the match
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ eth.src == E for all logical switch
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ datapaths and applies the action handle_svc_check(inport) .
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ Where E is the service monitor mac defined in the
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ db="OVN_Northbound"/> colum of
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ db="OVN_Northbound"/> table.
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
A priority-100 flow that punts all IGMP packets to
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
ovn-controller if IGMP snooping is enabled on the
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
diff --git a/ovn/northd/ovn-northd.c b/ovn/northd/ovn-northd.c
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
index 1ded5dd9b..ec8f9a70f 100644
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
--- a/ovn/northd/ovn-northd.c
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+++ b/ovn/northd/ovn-northd.c
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
@@ -6182,6 +6182,7 @@ build_lswitch_flows(struct hmap *datapaths, struct hmap *ports,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
}
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
}
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ char *svc_check_match = xasprintf("eth.dst == %s", svc_monitor_mac);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
/* Ingress table 17: Destination lookup, broadcast and multicast handling
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
* (priority 70 - 100). */
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
HMAP_FOR_EACH (od, key_node, datapaths) {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
@@ -6189,6 +6190,9 @@ build_lswitch_flows(struct hmap *datapaths, struct hmap *ports,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
continue;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
}
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ ovn_lflow_add(lflows, od, S_SWITCH_IN_L2_LKUP, 110, svc_check_match,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ "handle_svc_check(inport);");
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
struct mcast_switch_info *mcast_sw_info = &od->mcast_info.sw;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
if (mcast_sw_info->enabled) {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
@@ -6248,6 +6252,7 @@ build_lswitch_flows(struct hmap *datapaths, struct hmap *ports,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
ovn_lflow_add(lflows, od, S_SWITCH_IN_L2_LKUP, 70, "eth.mcast",
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
"outport = \""MC_FLOOD"\"; output;");
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
}
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ free(svc_check_match);
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
/* Ingress table 17: Add IP multicast flows learnt from IGMP
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
* (priority 90). */
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
@@ -10521,6 +10526,11 @@ static const char *rbac_mac_binding_auth[] =
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
static const char *rbac_mac_binding_update[] =
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
{"logical_port", "ip", "mac", "datapath"};
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+static const char *rbac_svc_monitor_auth[] =
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ {""};
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+static const char *rbac_svc_monitor_auth_update[] =
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ {"status"};
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
static struct rbac_perm_cfg {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
const char *table;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
const char **auth;
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
@@ -10562,6 +10572,14 @@ static struct rbac_perm_cfg {
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
.update = rbac_mac_binding_update,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
.n_update = ARRAY_SIZE(rbac_mac_binding_update),
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
.row = NULL
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ },{
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ .table = "Service_Monitor",
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ .auth = rbac_svc_monitor_auth,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ .n_auth = ARRAY_SIZE(rbac_svc_monitor_auth),
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ .insdel = false,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ .update = rbac_svc_monitor_auth_update,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ .n_update = ARRAY_SIZE(rbac_svc_monitor_auth_update),
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ .row = NULL
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
},{
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
.table = NULL,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
.auth = NULL,
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
diff --git a/tests/ovn.at b/tests/ovn.at
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
index f68ddcd33..e2565f274 100644
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
--- a/tests/ovn.at
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+++ b/tests/ovn.at
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
@@ -16932,5 +16932,124 @@ as hv4 ovs-ofctl show br-phys
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
as hv4 ovs-appctl fdb/show br-phys
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
OVN_CLEANUP([hv1],[hv2],[hv3],[hv4])
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+AT_CLEANUP
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+AT_SETUP([ovn -- Load balancer health checks])
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+AT_KEYWORDS([lb])
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn_start
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+net_add n1
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+sim_add hv1
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+as hv1
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovs-vsctl add-br br-phys
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn_attach n1 br-phys 192.168.0.1
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovs-vsctl -- add-port br-int hv1-vif1 -- \
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ set interface hv1-vif1 external-ids:iface-id=sw0-p1 \
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ options:tx_pcap=hv1/vif1-tx.pcap \
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ options:rxq_pcap=hv1/vif1-rx.pcap \
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ ofport-request=1
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovs-vsctl -- add-port br-int hv1-vif2 -- \
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ set interface hv1-vif2 external-ids:iface-id=sw0-p2 \
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ options:tx_pcap=hv1/vif2-tx.pcap \
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ options:rxq_pcap=hv1/vif2-rx.pcap \
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ ofport-request=2
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+sim_add hv2
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+as hv2
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovs-vsctl add-br br-phys
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn_attach n1 br-phys 192.168.0.2
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovs-vsctl -- add-port br-int hv2-vif1 -- \
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ set interface hv2-vif1 external-ids:iface-id=sw1-p1 \
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ options:tx_pcap=hv2/vif1-tx.pcap \
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ options:rxq_pcap=hv2/vif1-rx.pcap \
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ ofport-request=1
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl ls-add sw0
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl lsp-add sw0 sw0-p1
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl lsp-set-addresses sw0-p1 "50:54:00:00:00:03 10.0.0.3"
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl lsp-set-port-security sw0-p1 "50:54:00:00:00:03 10.0.0.3"
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl lsp-set-addresses sw0-p2 "50:54:00:00:00:04 10.0.0.4"
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl lsp-set-port-security sw0-p2 "50:54:00:00:00:04 10.0.0.4"
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+# Create the second logical switch with one port
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl ls-add sw1
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl lsp-add sw1 sw1-p1
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl lsp-set-addresses sw1-p1 "40:54:00:00:00:03 20.0.0.3"
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl lsp-set-port-security sw1-p1 "40:54:00:00:00:03 20.0.0.3"
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+# Create a logical router and attach both logical switches
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl lr-add lr0
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl lrp-add lr0 lr0-sw0 00:00:00:00:ff:01 10.0.0.1/24
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl lsp-add sw0 sw0-lr0
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl lsp-set-type sw0-lr0 router
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl lsp-set-addresses sw0-lr0 router
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl lsp-set-options sw0-lr0 router-port=lr0-sw0
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl lrp-add lr0 lr0-sw1 00:00:00:00:ff:02 20.0.0.1/24
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl lsp-add sw1 sw1-lr0
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl lsp-set-type sw1-lr0 router
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl lsp-set-addresses sw1-lr0 router
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl lsp-set-options sw1-lr0 router-port=lr0-sw1
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl lb-add lb1 10.0.0.10:80 10.0.0.3:80,20.0.0.3:80
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl --wait=sb set load_balancer . ip_port_mappings:10.0.0.3=sw0-p1:10.0.0.2
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl --wait=sb set load_balancer . ip_port_mappings:20.0.0.3=sw1-p1:20.0.0.2
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl --wait=sb -- --id=@hc create \
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+Load_Balancer_Health_Check vip="10.0.0.10\:80" -- add Load_Balancer . \
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+health_check @hc
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl --wait=sb ls-lb-add sw0 lb1
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl --wait=sb ls-lb-add sw1 lb1
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl --wait=sb lr-lb-add lr0 lb1
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+OVN_POPULATE_ARP
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl --wait=hv sync
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+OVS_WAIT_UNTIL([test 2 = `ovn-sbctl --bare --columns _uuid find \
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+service_monitor | sed '/^$/d' | wc -l`])
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-sbctl dump-flows sw0 | grep ct_lb | grep priority=120 > lflows.txt
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+AT_CHECK([cat lflows.txt], [0], [dnl
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ table=10(ls_in_stateful ), priority=120 , match=(ct.new && ip4.dst == 10.0.0.10 && tcp.dst == 80), action=(ct_lb(10.0.0.3:80,20.0.0.3:80);)
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+])
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+# get the svc monitor mac.
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+svc_mon_src_mac=`ovn-nbctl get NB_Global . options:svc_monitor_mac | \
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+sed s/":"//g | sed s/\"//g`
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+OVS_WAIT_UNTIL(
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ [test 1 = `$PYTHON "$top_srcdir/utilities/ovs-pcap.in" hv1/vif1-tx.pcap | \
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+grep "505400000003${svc_mon_src_mac}" | wc -l`]
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+)
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+OVS_WAIT_UNTIL(
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ [test 1 = `$PYTHON "$top_srcdir/utilities/ovs-pcap.in" hv2/vif1-tx.pcap | \
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+grep "405400000003${svc_mon_src_mac}" | wc -l`]
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+)
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+OVS_WAIT_UNTIL([test 2 = `ovn-sbctl --bare --columns status find \
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+service_monitor | grep offline | wc -l`])
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+OVS_WAIT_UNTIL(
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ [test 2 = `$PYTHON "$top_srcdir/utilities/ovs-pcap.in" hv1/vif1-tx.pcap | \
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+grep "505400000003${svc_mon_src_mac}" | wc -l`]
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+)
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+OVS_WAIT_UNTIL(
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ [test 2 = `$PYTHON "$top_srcdir/utilities/ovs-pcap.in" hv2/vif1-tx.pcap | \
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+grep "405400000003${svc_mon_src_mac}" | wc -l`]
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+)
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-sbctl dump-flows sw0 | grep "ip4.dst == 10.0.0.10 && tcp.dst == 80" \
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+| grep priority=120 > lflows.txt
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+AT_CHECK([cat lflows.txt], [0], [dnl
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ table=10(ls_in_stateful ), priority=120 , match=(ct.new && ip4.dst == 10.0.0.10 && tcp.dst == 80), action=(drop;)
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+])
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+OVN_CLEANUP([hv1], [hv2])
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
AT_CLEANUP
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
diff --git a/tests/system-common-macros.at b/tests/system-common-macros.at
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
index 64bf5ec63..c8fa6f03f 100644
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
--- a/tests/system-common-macros.at
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+++ b/tests/system-common-macros.at
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
@@ -267,6 +267,7 @@ m4_define([OVS_CHECK_FIREWALL],
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
#
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
m4_define([OVS_START_L7],
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
[PIDFILE=$(mktemp $2XXX.pid)
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ echo $PIDFILE > l7_pid_file
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
NETNS_DAEMONIZE([$1], [[$PYTHON $srcdir/test-l7.py $2]], [$PIDFILE])
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
dnl netstat doesn't print http over IPv6 as "http6"; drop the number.
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
diff --git a/tests/system-ovn.at b/tests/system-ovn.at
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
index b3f90aae2..7d1c65d85 100644
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
--- a/tests/system-ovn.at
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+++ b/tests/system-ovn.at
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
@@ -2523,3 +2523,183 @@ as
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
/connection dropped.*/d"])
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
AT_CLEANUP
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+AT_SETUP([ovn -- Load balancer health checks])
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+AT_KEYWORDS([lb])
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn_start
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+OVS_TRAFFIC_VSWITCHD_START()
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ADD_BR([br-int])
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+# Set external-ids in br-int needed for ovn-controller
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovs-vsctl \
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ -- set Open_vSwitch . external-ids:system-id=hv1 \
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ -- set Open_vSwitch . external-ids:ovn-remote=unix:$ovs_base/ovn-sb/ovn-sb.sock \
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ -- set Open_vSwitch . external-ids:ovn-encap-type=geneve \
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ -- set Open_vSwitch . external-ids:ovn-encap-ip=169.0.0.1 \
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ -- set bridge br-int fail-mode=secure other-config:disable-in-band=true
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+# Start ovn-controller
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+start_daemon ovn-controller
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl ls-add sw0
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl lsp-add sw0 sw0-p1
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl lsp-set-addresses sw0-p1 "50:54:00:00:00:03 10.0.0.3"
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl lsp-set-port-security sw0-p1 "50:54:00:00:00:03 10.0.0.3"
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl lsp-add sw0 sw0-p2
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl lsp-set-addresses sw0-p2 "50:54:00:00:00:04 10.0.0.4"
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl lsp-set-port-security sw0-p2 "50:54:00:00:00:04 10.0.0.4"
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+# Create the second logical switch with one port
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl ls-add sw1
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl lsp-add sw1 sw1-p1
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl lsp-set-addresses sw1-p1 "40:54:00:00:00:03 20.0.0.3"
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl lsp-set-port-security sw1-p1 "40:54:00:00:00:03 20.0.0.3"
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+# Create a logical router and attach both logical switches
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl lr-add lr0
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl lrp-add lr0 lr0-sw0 00:00:00:00:ff:01 10.0.0.1/24
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl lsp-add sw0 sw0-lr0
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl lsp-set-type sw0-lr0 router
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl lsp-set-addresses sw0-lr0 router
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl lsp-set-options sw0-lr0 router-port=lr0-sw0
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl lrp-add lr0 lr0-sw1 00:00:00:00:ff:02 20.0.0.1/24
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl lsp-add sw1 sw1-lr0
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl lsp-set-type sw1-lr0 router
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl lsp-set-addresses sw1-lr0 router
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl lsp-set-options sw1-lr0 router-port=lr0-sw1
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl lb-add lb1 10.0.0.10:80 10.0.0.3:80,20.0.0.3:80
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl --wait=sb set load_balancer . ip_port_mappings:10.0.0.3=sw0-p1:10.0.0.2
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl --wait=sb set load_balancer . ip_port_mappings:20.0.0.3=sw1-p1:20.0.0.2
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl --wait=sb -- --id=@hc create \
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+Load_Balancer_Health_Check vip="10.0.0.10\:80" -- add Load_Balancer . \
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+health_check @hc
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl --wait=sb ls-lb-add sw0 lb1
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl --wait=sb ls-lb-add sw1 lb1
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl --wait=sb lr-lb-add lr0 lb1
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+OVN_POPULATE_ARP
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl --wait=hv sync
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ADD_NAMESPACES(sw0-p1)
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ADD_VETH(sw0-p1, sw0-p1, br-int, "10.0.0.3/24", "50:54:00:00:00:03", \
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ "10.0.0.1")
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ADD_NAMESPACES(sw1-p1)
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ADD_VETH(sw1-p1, sw1-p1, br-int, "20.0.0.3/24", "40:54:00:00:00:03", \
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ "20.0.0.1")
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ADD_NAMESPACES(sw0-p2)
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ADD_VETH(sw0-p2, sw0-p2, br-int, "10.0.0.4/24", "50:54:00:00:00:04", \
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ "10.0.0.1")
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+# Wait until all the services are set to offline.
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+OVS_WAIT_UNTIL([test 2 = `ovn-sbctl --bare --columns status find \
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+service_monitor | sed '/^$/d' | grep offline | wc -l`])
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+# Start webservers in 'sw0-p1' and 'sw1-p1'.
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+OVS_START_L7([sw0-p1], [http])
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+sw0_p1_pid_file=`cat l7_pid_file`
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+OVS_START_L7([sw1-p1], [http])
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+# Wait until the services are set to online.
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+OVS_WAIT_UNTIL([test 2 = `ovn-sbctl --bare --columns status find \
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+service_monitor | sed '/^$/d' | grep online | wc -l`])
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+OVS_WAIT_UNTIL(
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ [ovn-sbctl dump-flows sw0 | grep ct_lb | grep priority=120 | grep "ip4.dst == 10.0.0.10" > lflows.txt
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ test 1 = `cat lflows.txt | grep "ct_lb(10.0.0.3:80,20.0.0.3:80)" | wc -l`]
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+)
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+# From sw0-p2 send traffic to vip - 10.0.0.10
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+for i in `seq 1 20`; do
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ echo Request $i
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ ovn-sbctl list service_monitor
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ NS_CHECK_EXEC([sw0-p2], [wget 10.0.0.10 -t 5 -T 1 --retry-connrefused -v -o wget$i.log])
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+done
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+dnl Each server should have at least one connection.
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+AT_CHECK([ovs-appctl dpctl/dump-conntrack | FORMAT_CT(10.0.0.10) | \
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+sed -e 's/zone=[[0-9]]*/zone=<cleared>/'], [0], [dnl
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+tcp,orig=(src=10.0.0.4,dst=10.0.0.10,sport=<cleared>,dport=<cleared>),reply=(src=10.0.0.3,dst=10.0.0.4,sport=<cleared>,dport=<cleared>),zone=<cleared>,protoinfo=(state=<cleared>)
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+tcp,orig=(src=10.0.0.4,dst=10.0.0.10,sport=<cleared>,dport=<cleared>),reply=(src=20.0.0.3,dst=10.0.0.4,sport=<cleared>,dport=<cleared>),zone=<cleared>,protoinfo=(state=<cleared>)
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+])
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+# Stop webserer in sw0-p1
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+kill `cat $sw0_p1_pid_file`
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+# Wait until service_monitor for sw0-p1 is set to offline
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+OVS_WAIT_UNTIL([test 1 = `ovn-sbctl --bare --columns status find \
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+service_monitor logical_port=sw0-p1 | sed '/^$/d' | grep offline | wc -l`])
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+OVS_WAIT_UNTIL(
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ [ovn-sbctl dump-flows sw0 | grep ct_lb | grep priority=120 | grep "ip4.dst == 10.0.0.10" > lflows.txt
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ test 1 = `cat lflows.txt | grep "ct_lb(20.0.0.3:80)" | wc -l`]
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+)
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovs-appctl dpctl/flush-conntrack
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+# From sw0-p2 send traffic to vip - 10.0.0.10
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+for i in `seq 1 20`; do
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ echo Request $i
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ NS_CHECK_EXEC([sw0-p2], [wget 10.0.0.10 -t 5 -T 1 --retry-connrefused -v -o wget$i.log])
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+done
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+AT_CHECK([ovs-appctl dpctl/dump-conntrack | FORMAT_CT(10.0.0.10) | \
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+sed -e 's/zone=[[0-9]]*/zone=<cleared>/'], [0], [dnl
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+tcp,orig=(src=10.0.0.4,dst=10.0.0.10,sport=<cleared>,dport=<cleared>),reply=(src=20.0.0.3,dst=10.0.0.4,sport=<cleared>,dport=<cleared>),zone=<cleared>,protoinfo=(state=<cleared>)
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+])
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+# Create udp load balancer.
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl lb-add lb2 10.0.0.10:80 10.0.0.3:80,20.0.0.3:80 udp
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+lb_udp=`ovn-nbctl lb-list | grep udp | awk '{print $1}'`
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+echo "lb udp uuid = $lb_udp"
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl list load_balancer
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl --wait=sb set load_balancer $lb_udp ip_port_mappings:10.0.0.3=sw0-p1:10.0.0.2
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl --wait=sb set load_balancer $lb_udp ip_port_mappings:20.0.0.3=sw1-p1:20.0.0.2
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl --wait=sb -- --id=@hc create \
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+Load_Balancer_Health_Check vip="10.0.0.10\:80" -- add Load_Balancer $lb_udp \
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+health_check @hc
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl --wait=sb ls-lb-add sw0 lb2
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl --wait=sb ls-lb-add sw1 lb2
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl --wait=sb lr-lb-add lr0 lb2
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+sleep 10
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl list load_balancer
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+echo "*******Next is health check*******"
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-nbctl list Load_Balancer_Health_Check
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+echo "********************"
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+ovn-sbctl list service_monitor
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+# Wait until udp service_monitor are set to offline
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+OVS_WAIT_UNTIL([test 2 = `ovn-sbctl --bare --columns status find \
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+service_monitor protocol=udp | sed '/^$/d' | grep offline | wc -l`])
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+OVS_APP_EXIT_AND_WAIT([ovn-controller])
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+as ovn-sb
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+OVS_APP_EXIT_AND_WAIT([ovsdb-server])
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+as ovn-nb
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+OVS_APP_EXIT_AND_WAIT([ovsdb-server])
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+as northd
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+OVS_APP_EXIT_AND_WAIT([ovn-northd])
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+as
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port patch-.*/d
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+/connection dropped.*/d"])
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
+AT_CLEANUP
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
--
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
2.23.0
|
|
![](https://seccdn.libravatar.org/avatar/679c4857c0e45278b16e700873c39a57c201b7d6565eb3306f15ffa8bcb7b889?s=16&d=retro) |
bbaaef |
|