Skip to content

Commit

Permalink
pinctrl: fix IP buffering with connection-tracking
Browse files Browse the repository at this point in the history
Whenever we need to reinject an IP packet buffered during L2 address
resolution we need to preserve ovs ofport in order to let ovs
connection tracking to properly SNAT/DNAT the packet.
Do not overwrite the MFF_IN_PORT in consider_port_binding routine

Signed-off-by: Numan Siddique <numans@ovn.org>
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: 0-day Robot <robot@bytheb.org>
  • Loading branch information
LorenzoBianconi authored and ovsrobot committed Feb 13, 2020
1 parent 672508f commit b24f23d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 0 additions & 1 deletion controller/physical.c
Expand Up @@ -905,7 +905,6 @@ consider_port_binding(struct ovsdb_idl_index *sbrec_port_binding_by_name,
for (int i = 0; i < MFF_N_LOG_REGS; i++) {
put_load(0, MFF_LOG_REG0 + i, 0, 32, ofpacts_p);
}
put_load(0, MFF_IN_PORT, 0, 16, ofpacts_p);
put_resubmit(OFTABLE_LOG_INGRESS_PIPELINE, ofpacts_p);
clone = ofpbuf_at_assert(ofpacts_p, clone_ofs, sizeof *clone);
ofpacts_p->header = clone;
Expand Down
5 changes: 4 additions & 1 deletion controller/pinctrl.c
Expand Up @@ -559,6 +559,7 @@ set_actions_and_enqueue_msg(struct rconn *swconn,

struct buffer_info {
struct ofpbuf ofpacts;
ofp_port_t ofp_port;
struct dp_packet *p;
};

Expand Down Expand Up @@ -629,6 +630,8 @@ buffered_push_packet(struct buffered_packets *bp,
ofpbuf_init(&bi->ofpacts, 4096);

reload_metadata(&bi->ofpacts, md);
bi->ofp_port = md->flow.in_port.ofp_port;

struct ofpact_resubmit *resubmit = ofpact_put_RESUBMIT(&bi->ofpacts);
resubmit->in_port = OFPP_CONTROLLER;
resubmit->table_id = OFTABLE_REMOTE_OUTPUT;
Expand Down Expand Up @@ -663,7 +666,7 @@ buffered_send_packets(struct rconn *swconn, struct buffered_packets *bp,
.ofpacts = bi->ofpacts.data,
.ofpacts_len = bi->ofpacts.size,
};
match_set_in_port(&po.flow_metadata, OFPP_CONTROLLER);
match_set_in_port(&po.flow_metadata, bi->ofp_port);
queue_msg(swconn, ofputil_encode_packet_out(&po, proto));

ofpbuf_uninit(&bi->ofpacts);
Expand Down

0 comments on commit b24f23d

Please sign in to comment.