In current version, manipulating entries in a LPM table with only IP will add mask /0 to the keys which eventually affect entry 0.0.0.0/0. This is caused by :
parse_table_key will consider 192.168.2.12 as PSABPF_EXACT and fill_key_btf_info will add 192.168.2.12 to the IP part of LPM key_buffer and leave 0 to the mask part. In the end, the match key is 0.0.0.0/0.
example:
after run cmd with
psabpf-ctl table add pipe 1 lpm action id 1 key 192.168.2.12 data 15
all get command without mask with return value of 0.0.0.0/0 and key with The Signs IP and type exact
I think type exact should not be the key type of LPM table. If mask is not presented, it should run with mask 32 or throwing an error, rather than manipulating 0.0.0.0/0.
In current version, manipulating entries in a LPM table with only IP will add mask
/0
to the keys which eventually affect entry0.0.0.0/0
. This is caused by :parse_table_key
will consider192.168.2.12
asPSABPF_EXACT
andfill_key_btf_info
will add192.168.2.12
to the IP part of LPMkey_buffer
and leave0
to the mask part. In the end, the match key is0.0.0.0/0
.example: after run cmd with
psabpf-ctl table add pipe 1 lpm action id 1 key 192.168.2.12 data 15
all get command without mask with return value of
0.0.0.0/0
and key withThe Signs IP
and typeexact
psabpf-ctl table get pipe 1 lpm key 8.8.8.8
I think type
exact
should not be the key type of LPM table. If mask is not presented, it should run with mask32
or throwing an error, rather than manipulating0.0.0.0/0
.BRs, Stuart