X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fdpif-linux.c;h=cbdbbabc569347001d4b7904e4716eddfb5272eb;hb=9f2e8c9ef975181317ded7d71c8b5bec172ccb8f;hp=c323494b30c6f83b3bfc3bafac8eaa712446a10f;hpb=f7cd0081f525dd1d45fafc68397b5393196e978d;p=openvswitch diff --git a/lib/dpif-linux.c b/lib/dpif-linux.c index c323494b..cbdbbabc 100644 --- a/lib/dpif-linux.c +++ b/lib/dpif-linux.c @@ -686,7 +686,7 @@ dpif_linux_execute(struct dpif *dpif_, const struct ofpbuf *packet) { struct dpif_linux *dpif = dpif_linux_cast(dpif_); - struct odp_upcall *execute; + struct odp_packet *execute; struct ofpbuf *buf; int error; @@ -779,6 +779,7 @@ parse_odp_packet(struct ofpbuf *buf, struct dpif_upcall *upcall) struct odp_packet *odp_packet = buf->data; struct nlattr *a[ARRAY_SIZE(odp_packet_policy)]; + uint32_t type; if (!nl_policy_parse(buf, sizeof *odp_packet, odp_packet_policy, a, ARRAY_SIZE(odp_packet_policy))) { @@ -786,7 +787,13 @@ parse_odp_packet(struct ofpbuf *buf, struct dpif_upcall *upcall) } memset(upcall, 0, sizeof *upcall); - upcall->type = nl_attr_get_u32(a[ODP_PACKET_ATTR_TYPE]); + + type = nl_attr_get_u32(a[ODP_PACKET_ATTR_TYPE]); + upcall->type = (type == _ODPL_MISS_NR ? DPIF_UC_MISS + : type == _ODPL_ACTION_NR ? DPIF_UC_ACTION + : type == _ODPL_SFLOW_NR ? DPIF_UC_SAMPLE + : -1); + upcall->packet = buf; upcall->packet->data = (void *) nl_attr_get(a[ODP_PACKET_ATTR_PACKET]); upcall->packet->size = nl_attr_get_size(a[ODP_PACKET_ATTR_PACKET]);