> On Mar 30, 2015, at 10:19 PM, Sree Vidya S D <vidya...@gmail.com> wrote: > > I am trying to edit the Ip source and destination address in > > void ovs_dp_process_received_packet(struct vport *p, struct sk_buff *skb) > > in datapath.c file. I am able to edit mac headers successfully using > > memcpy(eth_hdr(skb), str, 2) > > // str contains my target data > > I tried a similar approach with Ip headers as well > > memcpy(ip_hdr(skb), str, 2) > > But it isnt giving the expected results, in fact the rewriting isnt getting > executed. > > Could anyone please help me with the proper code segment to implement the > above?? >
You should not write to packet headers like that. Instead, you should set up a flow and use set field action to modify the packet headers. This might be a good place to start: https://www.opennetworking.org/images/stories/downloads/sdn-resources/onf-specifications/openflow/openflow-spec-v1.4.0.pdf <https://www.opennetworking.org/images/stories/downloads/sdn-resources/onf-specifications/openflow/openflow-spec-v1.4.0.pdf> Regards, Jarno > > Thanks in advance! > _______________________________________________ > dev mailing list > dev@openvswitch.org > http://openvswitch.org/mailman/listinfo/dev _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev