diff --git a/SOURCES/openvswitch-3.1.0.patch b/SOURCES/openvswitch-3.1.0.patch index a152e8c..71c2edb 100644 --- a/SOURCES/openvswitch-3.1.0.patch +++ b/SOURCES/openvswitch-3.1.0.patch @@ -1753,6 +1753,18 @@ index 134496ef3..5d2635946 100644 invalidate_cache(ctx); } +diff --git a/lib/dp-packet.c b/lib/dp-packet.c +index 61e405460..d33cee854 100644 +--- a/lib/dp-packet.c ++++ b/lib/dp-packet.c +@@ -167,6 +167,7 @@ dp_packet_new_with_headroom(size_t size, size_t headroom) + struct dp_packet * + dp_packet_clone(const struct dp_packet *buffer) + { ++ ovs_assert(buffer); + return dp_packet_clone_with_headroom(buffer, 0); + } + diff --git a/lib/dpctl.c b/lib/dpctl.c index d12d9b8a5..41b23d8ae 100644 --- a/lib/dpctl.c @@ -3617,6 +3629,28 @@ index 4fcde9ba1..492bfcffb 100644 nl_msg_put_be16(buf, CTA_PROTO_SRC_PORT, tuple->src_port); nl_msg_put_be16(buf, CTA_PROTO_DST_PORT, tuple->dst_port); } else { +diff --git a/lib/odp-execute.c b/lib/odp-execute.c +index 5cf6fbec0..44b2cd360 100644 +--- a/lib/odp-execute.c ++++ b/lib/odp-execute.c +@@ -147,6 +147,8 @@ odp_set_ipv4(struct dp_packet *packet, const struct ovs_key_ipv4 *key, + uint8_t new_tos; + uint8_t new_ttl; + ++ ovs_assert(nh); ++ + if (mask->ipv4_src) { + ip_src_nh = get_16aligned_be32(&nh->ip_src); + new_ip_src = key->ipv4_src | (ip_src_nh & ~mask->ipv4_src); +@@ -276,6 +278,8 @@ set_arp(struct dp_packet *packet, const struct ovs_key_arp *key, + { + struct arp_eth_header *arp = dp_packet_l3(packet); + ++ ovs_assert(arp); ++ + if (!mask) { + arp->ar_op = key->arp_op; + arp->ar_sha = key->arp_sha; diff --git a/lib/ofp-parse.c b/lib/ofp-parse.c index a90b926ef..102b183a8 100644 --- a/lib/ofp-parse.c @@ -3666,6 +3700,41 @@ index 5f8f20afa..97b6fa3df 100644 .. . . +diff --git a/lib/rtnetlink.c b/lib/rtnetlink.c +index f67352603..37078d00e 100644 +--- a/lib/rtnetlink.c ++++ b/lib/rtnetlink.c +@@ -112,7 +112,7 @@ rtnetlink_parse(struct ofpbuf *buf, struct rtnetlink_change *change) + if (parsed) { + const struct ifinfomsg *ifinfo; + +- ifinfo = ofpbuf_at(buf, NLMSG_HDRLEN, sizeof *ifinfo); ++ ifinfo = ofpbuf_at_assert(buf, NLMSG_HDRLEN, sizeof *ifinfo); + + /* Wireless events can be spammy and cause a + * lot of unnecessary churn and CPU load in +@@ -175,7 +175,7 @@ rtnetlink_parse(struct ofpbuf *buf, struct rtnetlink_change *change) + if (parsed) { + const struct ifaddrmsg *ifaddr; + +- ifaddr = ofpbuf_at(buf, NLMSG_HDRLEN, sizeof *ifaddr); ++ ifaddr = ofpbuf_at_assert(buf, NLMSG_HDRLEN, sizeof *ifaddr); + + change->nlmsg_type = nlmsg->nlmsg_type; + change->if_index = ifaddr->ifa_index; +diff --git a/lib/shash.c b/lib/shash.c +index a7b2c6458..1b7354bf6 100644 +--- a/lib/shash.c ++++ b/lib/shash.c +@@ -263,7 +263,7 @@ void * + shash_find_and_delete_assert(struct shash *sh, const char *name) + { + void *data = shash_find_and_delete(sh, name); +- ovs_assert(data != NULL); ++ ovs_assert(data); + return data; + } + diff --git a/lib/smap.c b/lib/smap.c index c1633e2a1..47fb34502 100644 --- a/lib/smap.c @@ -3849,9 +3918,18 @@ index 4c07e2216..270dc95ce 100644 id->prio = tc_get_major(tc->tcm_info); id->handle = tc->tcm_handle; diff --git a/ofproto/connmgr.c b/ofproto/connmgr.c -index 7b14cae77..b092e9e04 100644 +index 7b14cae77..f7f7b1279 100644 --- a/ofproto/connmgr.c +++ b/ofproto/connmgr.c +@@ -1209,7 +1209,7 @@ ofconn_create(struct ofservice *ofservice, struct rconn *rconn, + hmap_init(&ofconn->bundles); + ofconn->next_bundle_expiry_check = time_msec() + BUNDLE_EXPIRY_INTERVAL; + +- ofconn_set_rate_limit(ofconn, settings->rate_limit, settings->burst_limit); ++ ofservice_reconfigure(ofservice, settings); + + ovs_mutex_unlock(&ofproto_mutex); + } @@ -1649,6 +1649,8 @@ connmgr_send_table_status(struct connmgr *mgr, } } @@ -3881,6 +3959,36 @@ index 7b14cae77..b092e9e04 100644 } } +@@ -1907,10 +1915,7 @@ connmgr_count_hidden_rules(const struct connmgr *mgr) + } + + /* Creates a new ofservice for 'target' in 'mgr'. Returns 0 if successful, +- * otherwise a positive errno value. +- * +- * ofservice_reconfigure() must be called to fully configure the new +- * ofservice. */ ++ * otherwise a positive errno value. */ + static void + ofservice_create(struct connmgr *mgr, const char *target, + const struct ofproto_controller *c) +@@ -1920,7 +1925,8 @@ ofservice_create(struct connmgr *mgr, const char *target, + struct rconn *rconn = NULL; + if (!vconn_verify_name(target)) { + char *name = ofconn_make_name(mgr, target); +- rconn = rconn_create(5, 8, c->dscp, c->allowed_versions); ++ rconn = rconn_create(c->probe_interval, c->max_backoff, ++ c->dscp, c->allowed_versions); + rconn_connect(rconn, target, name); + free(name); + } else if (!pvconn_verify_name(target)) { +@@ -1943,7 +1949,6 @@ ofservice_create(struct connmgr *mgr, const char *target, + ofservice->rconn = rconn; + ofservice->pvconn = pvconn; + ofservice->s = *c; +- ofservice_reconfigure(ofservice, c); + + VLOG_INFO("%s: added %s controller \"%s\"", + mgr->name, ofconn_type_to_string(ofservice->type), target); diff --git a/ofproto/ofproto-dpif-ipfix.c b/ofproto/ofproto-dpif-ipfix.c index 742eed399..f13478a88 100644 --- a/ofproto/ofproto-dpif-ipfix.c @@ -5511,6 +5619,28 @@ index fdc289ad1..a3273229b 100644 if (error) { ovsdb_row_destroy(new); } else { +diff --git a/ovsdb/jsonrpc-server.c b/ovsdb/jsonrpc-server.c +index 17868f5b7..9a77760c3 100644 +--- a/ovsdb/jsonrpc-server.c ++++ b/ovsdb/jsonrpc-server.c +@@ -1131,6 +1131,8 @@ static void + ovsdb_jsonrpc_trigger_create(struct ovsdb_jsonrpc_session *s, struct ovsdb *db, + struct jsonrpc_msg *request) + { ++ ovs_assert(db); ++ + /* Check for duplicate ID. */ + size_t hash = json_hash(request->id, 0); + struct ovsdb_jsonrpc_trigger *t +@@ -1391,6 +1393,8 @@ ovsdb_jsonrpc_monitor_create(struct ovsdb_jsonrpc_session *s, struct ovsdb *db, + enum ovsdb_monitor_version version, + const struct json *request_id) + { ++ ovs_assert(db); ++ + struct ovsdb_jsonrpc_monitor *m = NULL; + struct ovsdb_monitor *dbmon = NULL; + struct json *monitor_id, *monitor_requests; diff --git a/ovsdb/log.c b/ovsdb/log.c index e42f00246..fff7c6ba1 100644 --- a/ovsdb/log.c @@ -5554,7 +5684,7 @@ index 90714ea13..63e5681a0 100644 struct ds *header, struct ds *data); diff --git a/ovsdb/monitor.c b/ovsdb/monitor.c -index 191befcae..bf5d083cc 100644 +index 191befcae..34aea5452 100644 --- a/ovsdb/monitor.c +++ b/ovsdb/monitor.c @@ -474,6 +474,7 @@ ovsdb_monitor_add_column(struct ovsdb_monitor *dbmon, @@ -5596,6 +5726,23 @@ index 191befcae..bf5d083cc 100644 } else if (mcs == dbmon->new_change_set) { dbmon->new_change_set = NULL; } +@@ -1279,6 +1295,7 @@ ovsdb_monitor_table_add_select(struct ovsdb_monitor *dbmon, + struct ovsdb_monitor_table * mt; + + mt = shash_find_data(&dbmon->tables, table->schema->name); ++ ovs_assert(mt); + mt->select |= select; + } + +@@ -1660,6 +1677,8 @@ ovsdb_monitor_hash(const struct ovsdb_monitor *dbmon, size_t basis) + for (i = 0; i < n; i++) { + struct ovsdb_monitor_table *mt = nodes[i]->data; + ++ ovs_assert(mt); ++ + basis = hash_pointer(mt->table, basis); + basis = hash_3words(mt->select, mt->n_columns, basis); + diff --git a/ovsdb/ovsdb-doc b/ovsdb/ovsdb-doc index 10d0c0c13..099770d25 100755 --- a/ovsdb/ovsdb-doc @@ -5610,7 +5757,7 @@ index 10d0c0c13..099770d25 100755 argv0 = sys.argv[0] diff --git a/ovsdb/ovsdb-server.c b/ovsdb/ovsdb-server.c -index 33ca4910d..b7b4d1559 100644 +index 33ca4910d..e286c4c57 100644 --- a/ovsdb/ovsdb-server.c +++ b/ovsdb/ovsdb-server.c @@ -233,7 +233,7 @@ main_loop(struct server_config *config, @@ -5739,6 +5886,14 @@ index 33ca4910d..b7b4d1559 100644 } static void +@@ -2195,6 +2219,7 @@ sset_from_json(struct sset *sset, const struct json *array) + + sset_clear(sset); + ++ ovs_assert(array); + ovs_assert(array->type == JSON_ARRAY); + for (i = 0; i < array->array.n; i++) { + const struct json *elem = array->array.elems[i]; diff --git a/ovsdb/ovsdb-tool.c b/ovsdb/ovsdb-tool.c index 60f353197..facd680ff 100644 --- a/ovsdb/ovsdb-tool.c @@ -6031,10 +6186,26 @@ index 66071ce2f..0792e1580 100644 if (!error && (xor || !ovsdb_row_equal_columns(row, update, &columns))) { error = ovsdb_row_update_columns(ovsdb_txn_row_modify(txn, row), diff --git a/ovsdb/transaction.c b/ovsdb/transaction.c -index 03541af85..f01de2a34 100644 +index 03541af85..8f2445082 100644 --- a/ovsdb/transaction.c +++ b/ovsdb/transaction.c -@@ -1251,7 +1251,7 @@ ovsdb_txn_precheck_prereq(const struct ovsdb *db) +@@ -34,6 +34,7 @@ + #include "storage.h" + #include "table.h" + #include "uuid.h" ++#include "util.h" + + VLOG_DEFINE_THIS_MODULE(transaction); + +@@ -576,6 +577,7 @@ ovsdb_txn_update_weak_refs(struct ovsdb_txn *txn OVS_UNUSED, + dst_row = CONST_CAST(struct ovsdb_row *, + ovsdb_table_get_row(weak->dst_table, &weak->dst)); + ++ ovs_assert(dst_row); + ovs_assert(!ovsdb_row_find_weak_ref(dst_row, weak)); + hmap_insert(&dst_row->dst_refs, &weak->dst_node, + ovsdb_weak_ref_hash(weak)); +@@ -1251,7 +1253,7 @@ ovsdb_txn_precheck_prereq(const struct ovsdb *db) struct ovsdb_txn_progress * ovsdb_txn_propose_schema_change(struct ovsdb *db, @@ -6577,10 +6748,10 @@ index fa6111c1e..450483bee 100644 Translation failed (Recursion too deep), packet is dropped. ]) diff --git a/tests/ofproto.at b/tests/ofproto.at -index a666bebca..2fa8486a8 100644 +index a666bebca..2889f81fb 100644 --- a/tests/ofproto.at +++ b/tests/ofproto.at -@@ -6538,3 +6538,185 @@ verify_deleted +@@ -6538,3 +6538,213 @@ verify_deleted OVS_VSWITCHD_STOP(["/unix:testcontroller: connection failed/d"]) ++AT_CLEANUP diff --git a/tests/ovs-vsctl.at b/tests/ovs-vsctl.at index a92156f00..a368bff6e 100644 --- a/tests/ovs-vsctl.at @@ -8080,6 +8279,18 @@ index fc8245bfb..c5ad24fb7 100644 # Original inspiration from # http://stackoverflow.com/questions/10060500/bash-how-to-evaluate-ps1-ps2, # but changed quite a lot to make it more robust. +diff --git a/utilities/ovs-vsctl.c b/utilities/ovs-vsctl.c +index 2f5ac1a26..6d7ce4a4e 100644 +--- a/utilities/ovs-vsctl.c ++++ b/utilities/ovs-vsctl.c +@@ -818,6 +818,7 @@ vsctl_context_populate_cache(struct ctl_context *ctx) + continue; + } + br = shash_find_data(&vsctl_ctx->bridges, br_cfg->name); ++ ovs_assert(br); + for (j = 0; j < br_cfg->n_ports; j++) { + struct ovsrec_port *port_cfg = br_cfg->ports[j]; + struct vsctl_port *port; diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index bfb2adef1..0deca14b9 100644 --- a/vswitchd/bridge.c @@ -8225,6 +8436,18 @@ index 2b57fc0e3..1204805b1 100644 +diff --git a/vtep/vtep-ctl.c b/vtep/vtep-ctl.c +index e5d99714d..61ec4801e 100644 +--- a/vtep/vtep-ctl.c ++++ b/vtep/vtep-ctl.c +@@ -1065,6 +1065,7 @@ vtep_ctl_context_populate_cache(struct ctl_context *ctx) + continue; + } + ps = shash_find_data(&vtepctl_ctx->pswitches, ps_cfg->name); ++ ovs_assert(ps); + for (j = 0; j < ps_cfg->n_ports; j++) { + struct vteprec_physical_port *port_cfg = ps_cfg->ports[j]; + struct vtep_ctl_port *port; Submodule dpdk 9dae7a15a..3812e23f6: diff --git a/dpdk/drivers/net/i40e/i40e_ethdev.c b/dpdk/drivers/net/i40e/i40e_ethdev.c index 7726a89d99..a982e42264 100644 diff --git a/SPECS/openvswitch3.1.spec b/SPECS/openvswitch3.1.spec index 4672a30..ab2873f 100644 --- a/SPECS/openvswitch3.1.spec +++ b/SPECS/openvswitch3.1.spec @@ -57,7 +57,7 @@ Summary: Open vSwitch Group: System Environment/Daemons daemon/database/utilities URL: http://www.openvswitch.org/ Version: 3.1.0 -Release: 55%{?dist} +Release: 58%{?dist} # Nearly all of openvswitch is ASL 2.0. The bugtool is LGPLv2+, and the # lib/sflow*.[ch] files are SISSL @@ -754,6 +754,28 @@ exit 0 %endif %changelog +* Thu Oct 12 2023 Timothy Redaelli - 3.1.0-58 +- redhat: use rhpkg push instead of git push [RH git: 60672fd20d] + + +* Thu Oct 12 2023 Timothy Redaelli - 3.1.0-57 +- treewide: Add `ovs_assert` to check for null pointers. [RH git: aaa7f51420] + This patch adds an assortment of `ovs_assert` statements to check for + null pointers. We use assertions since it should be impossible for any + of these pointers to be NULL. + + Reviewed-by: Simon Horman + Acked-by: Eelco Chaudron + Signed-off-by: James Raphael Tiovalen + Signed-off-by: Ilya Maximets + + +* Mon Oct 09 2023 Open vSwitch CI - 3.1.0-56 +- Merging upstream branch-3.1 [RH git: 7f4f4b85d5] + Commit list: + aa130966d1 connmgr: Fix ofconn configuration on vswitchd startup. + + * Mon Sep 18 2023 Open vSwitch CI - 3.1.0-55 - Merging upstream branch-3.1 [RH git: e7379c38f3] Commit list: