Skip to content

Commit

Permalink
datapath-windows: check vport attribute before access
Browse files Browse the repository at this point in the history
OVS_VPORT_ATTR_OPTIONS being an optional attribute should be
preceded by a check for valid value before access.

Signed-off-by: Nithin Raju <[email protected]>
Acked-by: Sairam Venugopal <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
  • Loading branch information
nithinrajub authored and blp committed Sep 4, 2015
1 parent 25030d4 commit c42d0da
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions datapath-windows/ovsext/Vport.c
Original file line number Diff line number Diff line change
Expand Up @@ -2177,10 +2177,12 @@ OvsNewVportCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx,
break;
}

PNL_ATTR attr = NlAttrFindNested(vportAttrs[OVS_VPORT_ATTR_OPTIONS],
OVS_TUNNEL_ATTR_DST_PORT);
if (attr) {
transportPortDest = NlAttrGetU16(attr);
if (vportAttrs[OVS_VPORT_ATTR_OPTIONS]) {
PNL_ATTR attr = NlAttrFindNested(vportAttrs[OVS_VPORT_ATTR_OPTIONS],
OVS_TUNNEL_ATTR_DST_PORT);
if (attr) {
transportPortDest = NlAttrGetU16(attr);
}
}

status = OvsInitTunnelVport(usrParamsCtx,
Expand Down

0 comments on commit c42d0da

Please sign in to comment.