From 2eeb6e08decb2dd3e793647a38596950278a1610 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Fri, 14 May 2010 15:01:06 -0700 Subject: [PATCH] wdp-xflow: Copy client_data from old rule to new rule when displacing a rule. If client_data is not copied when a new rule displaces an old one, then the old rule's client data will be leaked and the new rule will have a null pointer. This causes a segfault with, e.g.: ovs-ofctl add-flow br0 "dl_type=0x800,nw_dst=10.245.7.0/16,actions=output:148" ovs-ofctl mod-flows --strict br0 "dl_type=0x800,nw_dst=10.245.7.0/16,actions=output:149" ovs-ofctl del-flows --strict br0 "dl_type=0x800,nw_dst=10.245.7.0/16" Reported by partner. --- ofproto/wdp-xflow.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ofproto/wdp-xflow.c b/ofproto/wdp-xflow.c index 1c5fb929b..4a7154b5a 100644 --- a/ofproto/wdp-xflow.c +++ b/ofproto/wdp-xflow.c @@ -447,6 +447,7 @@ wx_rule_insert(struct wx *wx, struct wx_rule *rule, struct ofpbuf *packet, /* Free the rule that was displaced, if any. */ if (displaced_rule) { + rule->wr.client_data = displaced_rule->wr.client_data; wx_rule_destroy(wx, displaced_rule); } } -- 2.43.0