X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=datapath%2Fvport-capwap.c;h=39aec423f0d3fd292b6d74a21e113789284a37ef;hb=99e375bc5de8ac752b6cdd5c27ff3efd4cd5a49e;hp=8a63416b9fbeb3fe9f61d0f1b756e047afbb8986;hpb=a3d3ad0c04a7b8db1cabd7ca89aca6961708d076;p=sliver-openvswitch.git diff --git a/datapath/vport-capwap.c b/datapath/vport-capwap.c index 8a63416b9..39aec423f 100644 --- a/datapath/vport-capwap.c +++ b/datapath/vport-capwap.c @@ -155,7 +155,7 @@ static struct inet_frags frag_state = { .secret_interval = CAPWAP_FRAG_SECRET_INTERVAL, }; -static int get_capwap_param(const struct tnl_mutable_config *mutable, +static void get_capwap_param(const struct tnl_mutable_config *mutable, const struct ovs_key_ipv4_tunnel *tun_key, u32 *flags, __be64 *out_key) { @@ -169,18 +169,12 @@ static int get_capwap_param(const struct tnl_mutable_config *mutable, *out_key = tun_key->tun_id; } else { *flags = mutable->flags; - if (mutable->flags & TNL_F_OUT_KEY_ACTION) { - if (likely(tun_key->tun_flags & OVS_FLOW_TNL_F_KEY)) { - *out_key = tun_key->tun_id; - } else { - *out_key = 0; - return -EINVAL; - } - } else + if (mutable->flags & TNL_F_OUT_KEY_ACTION) + *out_key = tun_key->tun_id; + else *out_key = mutable->out_key; } - return 0; } static int capwap_hdr_len(const struct tnl_mutable_config *mutable, @@ -189,11 +183,8 @@ static int capwap_hdr_len(const struct tnl_mutable_config *mutable, int size = CAPWAP_MIN_HLEN; u32 flags; __be64 out_key; - int err; - err = get_capwap_param(mutable, tun_key, &flags, &out_key); - if (err) - return err; + get_capwap_param(mutable, tun_key, &flags, &out_key); /* CAPWAP has no checksums. */ if (flags & TNL_F_CSUM) @@ -259,10 +250,7 @@ static struct sk_buff *capwap_update_header(const struct vport *vport, u32 flags; __be64 out_key; - if (get_capwap_param(mutable, tun_key, &flags, &out_key)) { - kfree_skb(skb); - return NULL; - } + get_capwap_param(mutable, tun_key, &flags, &out_key); if (flags & TNL_F_OUT_KEY_ACTION) { /* first field in WSI is key */