X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=datapath%2Ftunnel.c;h=1db60d213c63a38d15ff49109cc82d78af062e06;hb=79f827fa8be86099eb1523a51acc5dd1a5901505;hp=fb4854af83bf261bc5c8ec60b13cce444cfd2d74;hpb=5b8ab80c0897d9cc91488505a447dcf4a4e4b448;p=sliver-openvswitch.git diff --git a/datapath/tunnel.c b/datapath/tunnel.c index fb4854af8..1db60d213 100644 --- a/datapath/tunnel.c +++ b/datapath/tunnel.c @@ -1042,6 +1042,7 @@ static const struct nla_policy tnl_policy[OVS_TUNNEL_ATTR_MAX + 1] = { [OVS_TUNNEL_ATTR_IN_KEY] = { .type = NLA_U64 }, [OVS_TUNNEL_ATTR_TOS] = { .type = NLA_U8 }, [OVS_TUNNEL_ATTR_TTL] = { .type = NLA_U8 }, + [OVS_TUNNEL_ATTR_DST_PORT] = { .type = NLA_U16 }, }; /* Sets OVS_TUNNEL_ATTR_* fields in 'mutable', which must initially be @@ -1087,6 +1088,10 @@ static int tnl_set_config(struct net *net, struct nlattr *options, if (a[OVS_TUNNEL_ATTR_TTL]) mutable->ttl = nla_get_u8(a[OVS_TUNNEL_ATTR_TTL]); + if (a[OVS_TUNNEL_ATTR_DST_PORT]) + mutable->dst_port = + htons(nla_get_u16(a[OVS_TUNNEL_ATTR_DST_PORT])); + if (!a[OVS_TUNNEL_ATTR_IN_KEY]) { mutable->key.tunnel_type |= TNL_T_KEY_MATCH; mutable->flags |= TNL_F_IN_KEY_MATCH; @@ -1242,6 +1247,9 @@ int ovs_tnl_get_options(const struct vport *vport, struct sk_buff *skb) goto nla_put_failure; if (mutable->ttl && nla_put_u8(skb, OVS_TUNNEL_ATTR_TTL, mutable->ttl)) goto nla_put_failure; + if (mutable->dst_port && nla_put_u16(skb, OVS_TUNNEL_ATTR_DST_PORT, + ntohs(mutable->dst_port))) + goto nla_put_failure; return 0;