Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pfx_filter]: Add a prefix mask by default in pfx_filter, when there is no one #4860

Merged
merged 4 commits into from
Jul 2, 2020

Conversation

pavel-shirshov
Copy link
Contributor

@pavel-shirshov pavel-shirshov commented Jun 27, 2020

- Why I did it
If some table with a list of tuples (interface name, ip prefix) has ip prefixes without a mask length, it will cause issues in SONiC. For example quagga and frr will treat ipv4 address without a mask, so "10.20.30.40" address will be treated as "10.0.0.0/8", which is dangerous.

- How I did it
If pfx_filter get a tuple (interface name, ip prefix), where the ip prefix doesn't have prefix mask length, add a mask by default: "/32 for ipv4 addresses, /128 for ipv6 addresses".

- How to verify it
Run the unit tests from this PR.

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

prsunny
prsunny previously approved these changes Jun 27, 2020
Copy link
Contributor

@prsunny prsunny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@lguohan
Copy link
Collaborator

lguohan commented Jun 27, 2020

thanksk , looks like there are some test failures.

lguohan
lguohan previously approved these changes Jun 27, 2020
@pavel-shirshov pavel-shirshov dismissed stale reviews from lguohan and prsunny via 15f55e7 June 29, 2020 18:43
@pavel-shirshov
Copy link
Contributor Author

retest vsimage please

@pavel-shirshov
Copy link
Contributor Author

retest mellanox please

@pavel-shirshov
Copy link
Contributor Author

retest vsimage please

@lguohan lguohan merged commit 2e0aa4f into sonic-net:master Jul 2, 2020
@pavel-shirshov pavel-shirshov deleted the pavelsh/pfx branch July 2, 2020 14:36
abdosi pushed a commit that referenced this pull request Jul 5, 2020
…is no one (#4860)

If some table with a list of tuples (interface name, ip prefix) has ip prefixes without a mask length, it will cause issues in SONiC. For example quagga and frr will treat ipv4 address without a mask, so "10.20.30.40" address will be treated as "10.0.0.0/8", which is dangerous.

The fix here is that when pfx_filter get a tuple (interface name, ip prefix), where the ip prefix doesn't have prefix mask length, add a mask by default: "/32 for ipv4 addresses, /128 for ipv6 addresses".

Co-authored-by: Pavel Shirshov <pavel.contrib@gmail.com>
qiluo-msft pushed a commit to qiluo-msft/sonic-buildimage that referenced this pull request Jul 12, 2020
…is no one (sonic-net#4860)

If some table with a list of tuples (interface name, ip prefix) has ip prefixes without a mask length, it will cause issues in SONiC. For example quagga and frr will treat ipv4 address without a mask, so "10.20.30.40" address will be treated as "10.0.0.0/8", which is dangerous.

The fix here is that when pfx_filter get a tuple (interface name, ip prefix), where the ip prefix doesn't have prefix mask length, add a mask by default: "/32 for ipv4 addresses, /128 for ipv6 addresses".

Co-authored-by: Pavel Shirshov <pavel.contrib@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants