Ok I think I figured out the issue, basically while the dp_packet_get_udp_payload is called, sometimes, the execution goes back to do_xlate_Actions, “rewriting” ctx and therefore causing the overlap. Is there a way to “freeze” the ctx value until the printing is done?
L From: William Tu<mailto:[email protected]> Sent: Tuesday, May 19, 2020 17:41 To: Luca Mancini<mailto:[email protected]> Cc: [email protected]<mailto:[email protected]> Subject: Re: [ovs-discuss] ctx->xin-packet overlap On Mon, May 18, 2020 at 7:10 AM Luca Mancini <[email protected]> wrote: > > > > Hi William, > > > > Thanks for replying so promptly. > > I’m still not quite sure what you mean, when I print I use: > > > > VLOG_ERR( “%s” , (char *) > dp_packet_get_udp_payload(dp_packet_buff[index]) ); > > > > Why would the second packet received assigned from ctx->xin->packet and > stored in dp_packet_buff[index + 1] overlap with the first packet. > > So using the example from before upon first packet: > > > > 1. Index=0 > > 2. Ctx->xin->packet = “everyone” > > 3. dp_packet_buff[0] = {“Everyone”} > > 4. print with VLOG_ERR as above > > 5. index++ > > 6. Ctx->xin->packet = “hello” > > 7. But dp_packet_buff[1] ={“hello ne”} instead of {“hello”} > > > > Isn’t the problem due to ctx->xin->packet being overwritten by subsequent > packets? To explain better, on point 6 the actual packet contained in > ctx->xin-packet is “hello ne” and not “hello” > > Oh, I see your point. Maybe you can try add a break point using gdb, and see where the memory address is when assigning string to different indexes. William
_______________________________________________ discuss mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-discuss
