diff options
author | Matteo Croce <mcroce@redhat.com> | 2020-02-15 14:20:56 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-02-16 19:34:44 -0800 |
commit | 744676e777207f4992ba4cc728a8a71352963c5b (patch) | |
tree | 6e5ebfb7f6a28103ae554e949fefe2eba5ab8ff9 /net/openvswitch/vport.c | |
parent | 7458bd540fa0a90220b9e8c349d910d9dde9caf8 (diff) | |
download | linux-744676e777207f4992ba4cc728a8a71352963c5b.tar.gz linux-744676e777207f4992ba4cc728a8a71352963c5b.tar.bz2 linux-744676e777207f4992ba4cc728a8a71352963c5b.zip |
openvswitch: add TTL decrement action
New action to decrement TTL instead of setting it to a fixed value.
This action will decrement the TTL and, in case of expired TTL, drop it
or execute an action passed via a nested attribute.
The default TTL expired action is to drop the packet.
Supports both IPv4 and IPv6 via the ttl and hop_limit fields, respectively.
Tested with a corresponding change in the userspace:
# ovs-dpctl dump-flows
in_port(2),eth(),eth_type(0x0800), packets:0, bytes:0, used:never, actions:dec_ttl{ttl<=1 action:(drop)},1
in_port(1),eth(),eth_type(0x0800), packets:0, bytes:0, used:never, actions:dec_ttl{ttl<=1 action:(drop)},2
in_port(1),eth(),eth_type(0x0806), packets:0, bytes:0, used:never, actions:2
in_port(2),eth(),eth_type(0x0806), packets:0, bytes:0, used:never, actions:1
# ping -c1 192.168.0.2 -t 42
IP (tos 0x0, ttl 41, id 61647, offset 0, flags [DF], proto ICMP (1), length 84)
192.168.0.1 > 192.168.0.2: ICMP echo request, id 386, seq 1, length 64
# ping -c1 192.168.0.2 -t 120
IP (tos 0x0, ttl 119, id 62070, offset 0, flags [DF], proto ICMP (1), length 84)
192.168.0.1 > 192.168.0.2: ICMP echo request, id 388, seq 1, length 64
# ping -c1 192.168.0.2 -t 1
#
Co-developed-by: Bindiya Kurle <bindiyakurle@gmail.com>
Signed-off-by: Bindiya Kurle <bindiyakurle@gmail.com>
Signed-off-by: Matteo Croce <mcroce@redhat.com>
Acked-by: Pravin B Shelar <pshelar@ovn.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/openvswitch/vport.c')
0 files changed, 0 insertions, 0 deletions