diff mbox

[ovs-dev] Avoid segfault in sFlow when datapath input port for tunnel sample is unknown.

Message ID CAB1FvaKyoBneMAUdDbX3U_r4wb8PW9-kfryitD7UjBWhbq2GEQ@mail.gmail.com
State Accepted
Headers show

Commit Message

Neil McKee Aug. 29, 2016, 5:13 p.m. UTC
This patch avoids a segfault that was found and documented here:
http://openvswitch.org/pipermail/discuss/2016-August/022513.html

I raised a pull-request on github.

Signed-off-by: Neil McKee <neil.mckee@inmon.com>
---
 ofproto/ofproto-dpif-sflow.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

                             &tnlInElem.flowType.ipv4);

Comments

Ben Pfaff Sept. 2, 2016, 6:41 p.m. UTC | #1
On Mon, Aug 29, 2016 at 10:13:11AM -0700, Neil McKee wrote:
> This patch avoids a segfault that was found and documented here:
> http://openvswitch.org/pipermail/discuss/2016-August/022513.html
> 
> I raised a pull-request on github.
> 
> Signed-off-by: Neil McKee <neil.mckee@inmon.com>

Thanks, applied to master, branch-2.6, and branch-2.5.
diff mbox

Patch

diff --git a/ofproto/ofproto-dpif-sflow.c b/ofproto/ofproto-dpif-sflow.c
index 1252d39..c3234ee 100644
--- a/ofproto/ofproto-dpif-sflow.c
+++ b/ofproto/ofproto-dpif-sflow.c
@@ -1287,7 +1287,7 @@  dpif_sflow_received(struct dpif_sflow *ds, const
struct dp_packet *packet,
     if (flow->tunnel.ip_dst) {
        memset(&tnlInElem, 0, sizeof(tnlInElem));
        tnlInElem.tag = SFLFLOW_EX_IPV4_TUNNEL_INGRESS;
-       tnlInProto = dpif_sflow_tunnel_proto(in_dsp->tunnel_type);
+       tnlInProto = in_dsp ? dpif_sflow_tunnel_proto(in_dsp->tunnel_type) : 0;
        dpif_sflow_tunnel_v4(tnlInProto,
                             &flow->tunnel,