openflow/learn_flow_spec: Fix to use src field if dst field is omitted, as dst field.

This commit is contained in:
Eishun Kondoh 2019-07-24 02:05:39 +09:00
parent 6ce014ea91
commit 6dc3cfd500
3 changed files with 34 additions and 33 deletions

View file

@ -29,8 +29,8 @@ defmodule Openflow.Action.NxFlowSpecMatch do
dst_offset: non_neg_integer()
) :: t()
def new(options \\ []) do
dst = options[:dst] || raise ":dst must be specified"
src = options[:src] || raise ":src must be specified"
dst = options[:dst] || src
n_bits = options[:n_bits] || Openflow.Match.n_bits_of(dst)
%NxFlowSpecMatch{