X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=ofproto%2Fin-band.c;h=9655f105c8a555c1b4b4a3c23d9ad36280c61496;hb=cdee00fd635d1e0f1eeb5d9c009daeb59abd4777;hp=aebdb7e4b226aaa47733edacb927d7245bd6c218;hpb=7f8ca6459c37ede8faf13f730bcd4d9f05dfd13b;p=sliver-openvswitch.git diff --git a/ofproto/in-band.c b/ofproto/in-band.c index aebdb7e4b..9655f105c 100644 --- a/ofproto/in-band.c +++ b/ofproto/in-band.c @@ -28,6 +28,7 @@ #include "dpif.h" #include "flow.h" #include "netdev.h" +#include "netlink.h" #include "odp-util.h" #include "ofproto.h" #include "ofpbuf.h" @@ -428,7 +429,7 @@ in_band_msg_in_hook(struct in_band *in_band, const struct flow *flow, * allowed to be set up in the datapath. */ bool in_band_rule_check(struct in_band *in_band, const struct flow *flow, - const struct odp_actions *actions) + const struct nlattr *actions, unsigned int actions_len) { if (!in_band) { return true; @@ -440,11 +441,12 @@ in_band_rule_check(struct in_band *in_band, const struct flow *flow, && flow->nw_proto == IP_TYPE_UDP && flow->tp_src == htons(DHCP_SERVER_PORT) && flow->tp_dst == htons(DHCP_CLIENT_PORT)) { - int i; + const struct nlattr *a; + unsigned int left; - for (i=0; in_actions; i++) { - if (actions->actions[i].output.type == ODPAT_OUTPUT - && actions->actions[i].output.port == ODPP_LOCAL) { + NL_ATTR_FOR_EACH_UNSAFE (a, left, actions, actions_len) { + if (nl_attr_type(a) == ODPAT_OUTPUT + && nl_attr_get_u32(a) == ODPP_LOCAL) { return true; } }