X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=ofproto%2Fofproto.c;h=14570be9dbe13b84eac11f2cd5ecce28dd950edc;hb=7f7ae89d2477e14b11c1355668366030fc590c64;hp=0bc31a5f049ae1f3a828b29e89e58903b6ebee9a;hpb=d530fcd2425c2443c1a1c093903b6932c4c5814c;p=openvswitch diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index 0bc31a5f..14570be9 100644 --- a/ofproto/ofproto.c +++ b/ofproto/ofproto.c @@ -180,8 +180,8 @@ static void facet_install(struct ofproto *, struct facet *, bool zero_stats); static void facet_uninstall(struct ofproto *, struct facet *); static void facet_flush_stats(struct ofproto *, struct facet *); -static bool facet_make_actions(struct ofproto *, struct facet *, - const struct ofpbuf *packet); +static void facet_make_actions(struct ofproto *, struct facet *, + const struct ofpbuf *packet); static void facet_update_stats(struct ofproto *, struct facet *, const struct odp_flow_stats *); @@ -2156,9 +2156,8 @@ facet_remove(struct ofproto *ofproto, struct facet *facet) facet_free(facet); } -/* Composes the ODP actions for 'facet' based on its rule's actions. - * Returns true if the actions changed, false otherwise. */ -static bool +/* Composes the ODP actions for 'facet' based on its rule's actions. */ +static void facet_make_actions(struct ofproto *p, struct facet *facet, const struct ofpbuf *packet) { @@ -2171,15 +2170,12 @@ facet_make_actions(struct ofproto *p, struct facet *facet, &facet->nf_flow.output_iface); actions_len = a.n_actions * sizeof *a.actions; - if (facet->n_actions == a.n_actions - && !memcmp(facet->actions, a.actions, actions_len)) { - return false; + if (facet->n_actions != a.n_actions + || memcmp(facet->actions, a.actions, actions_len)) { + free(facet->actions); + facet->n_actions = a.n_actions; + facet->actions = xmemdup(a.actions, actions_len); } - - free(facet->actions); - facet->n_actions = a.n_actions; - facet->actions = xmemdup(a.actions, actions_len); - return true; } static int