diff options
author | Fahad Naeem <fahadnaeemkhan@gmail.com> | 2022-05-10 01:03:52 -0500 |
---|---|---|
committer | Ole Tr�an <otroan@employees.org> | 2022-05-12 07:30:33 +0000 |
commit | 0891b6aa449cca525b61d0cc23759b2efcd158dc (patch) | |
tree | d2010d7871c420fd9631ec3ea57e62eba738e52e /src/plugins/nat/pnat/pnat.c | |
parent | e2159bd2d3721592edee90a511647f83ea9a4781 (diff) |
pnat: add support to wildcard IP Protocol field if not specified
- add pnat_binding_add_v2 which explicitly requires match mask to
set to PNAT_PROTO if we want to match on IP Protocol
- fix pnat_binding_add backward compatibility i.e. no need to set
match mast to PNAT_PROTO
Type: improvement
Signed-off-by: Fahad Naeem <fahadnaeemkhan@gmail.com>
Change-Id: I5a23244be55b7d4c10552c555881527a4b2f325f
Diffstat (limited to 'src/plugins/nat/pnat/pnat.c')
-rw-r--r-- | src/plugins/nat/pnat/pnat.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/plugins/nat/pnat/pnat.c b/src/plugins/nat/pnat/pnat.c index 547b063f286..2b4a6b49e96 100644 --- a/src/plugins/nat/pnat/pnat.c +++ b/src/plugins/nat/pnat/pnat.c @@ -56,7 +56,9 @@ static pnat_mask_fast_t pnat_mask2fast(pnat_mask_t lookup_mask) { m.as_u64[0] = 0xffffffff00000000; if (lookup_mask & PNAT_DA) m.as_u64[0] |= 0x00000000ffffffff; - m.as_u64[1] = 0xffffffff00000000; + m.as_u64[1] = 0x00ffffff00000000; + if (lookup_mask & PNAT_PROTO) + m.as_u64[1] |= 0xff00000000000000; if (lookup_mask & PNAT_SPORT) m.as_u64[1] |= 0x00000000ffff0000; if (lookup_mask & PNAT_DPORT) |