Hi,
I’m placing my question in this discussion as well as the more I try to debug 
it the more it seems like an ovs bug to me, I hope not.
In userspace I’m implementing a new action which for now stores the packets 
received in an array of struct dp_packets, however if I try to print these 
packets I notice that as packets come in, they overlap as if for every packet 
received the previous ctx->xin->packet is overwritten.

My code looks something like:


Dp_packet_buff[index] = ctx->xin->packet;
VLOG_ERR(   “%s”     ,      (char *) 
dp_packet_get_udp_payload(dp_packet_buff[index]    );
Index++

e.g:
3 packets arrive: “everyone”, “hello”, ”aa”

The array stores [“everyone”, “hello ne”, “aa  lo ne”]
Instead of [“everyone”, “hello”, “aa”]

Basically if the received packet is smaller than the one before it, it 
overwrites what is contained in ctx->xin->packet + 1 character,  and it keeps 
the remainder of the previous “non-overwritten” string.
Is anyone able to tell me how to fix this, is there a way to cancel what is 
contained in ctx->xin->packet after saving it in the buffer? I’ve tried setting 
it to NULL but the overwriting still occurs.


Same thing happens if I don’t do any assignment to an array of dp_packet 
pointers, so if I just do:

Compose_foo(struct xlate_ctx *ctx):
    //packet arrives and I print i
     If(index < 5):
VLOG_ERR(     "%s",         (char *)   
dp_packet_get_udp_payload(ctx->xin->packet)  );
Index ++


In addition, sometimes the packets don’t overlap but very often they do and 
when they do it always happens with the same number of characters being 
overwritten as explained in the beginning, so the overlap consistently happens 
with the same “pattern”.


Been working on this bug for a week now, hopefully someone can help me out,
Thanks

Luca


_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to