From 368ad03792eb2e1f814a13b4093233cbe2facd4d Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 23 Feb 2019 14:29:36 +0100 Subject: [PATCH] [P4] only apply tables on valid headers --- p4src/static-mapping.p4 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/p4src/static-mapping.p4 b/p4src/static-mapping.p4 index 77c7602..7f60884 100644 --- a/p4src/static-mapping.p4 +++ b/p4src/static-mapping.p4 @@ -46,8 +46,12 @@ control MyIngress(inout headers hdr, } apply { - v6_routing.apply() - v4_routing.apply() + if(hdr.ipv6.isValid()) { + v6_routing.apply(); + } + if(hdr.ipv4.isValid()) { + v4_routing.apply(); + } } }