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

[dhcp6relay] Add dhcpv6 option check #10486

Merged
merged 5 commits into from
May 6, 2022

Conversation

kellyyeh
Copy link
Contributor

@kellyyeh kellyyeh commented Apr 6, 2022

Why I did it

To prevent relaying client packets with malformed payload

How I did it

Check for invalid dhcpv6 options

How to verify it

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111

Description for the changelog

Link to config_db schema for YANG module changes

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

@kellyyeh kellyyeh marked this pull request as ready for review April 6, 2022 23:56
@kellyyeh kellyyeh requested a review from lguohan as a code owner April 6, 2022 23:56
@yxieca
Copy link
Contributor

yxieca commented Apr 13, 2022

Add unit test?

@kellyyeh
Copy link
Contributor Author

Add unit test?

Noted

auto option = parse_dhcpv6_opt(option_position, &tmp);
option_position = tmp;
if(ntohs(option->option_code) > DHCPv6_OPTION_LIMIT) {
syslog(LOG_INFO, "DHCPv6 option is invalid or contains malformed payload\n");
Copy link
Contributor

Choose a reason for hiding this comment

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

We should raise the log level to warning and add a counter for this.

@kellyyeh kellyyeh requested a review from yxieca May 3, 2022 18:43
@kellyyeh
Copy link
Contributor Author

kellyyeh commented May 5, 2022

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@kellyyeh kellyyeh merged commit cfdb843 into sonic-net:master May 6, 2022
@kellyyeh kellyyeh deleted the dhcp6relay-payload branch May 6, 2022 01:04
@qiluo-msft
Copy link
Collaborator

This commit could not be cleanly cherry-picked to 202012. Please submit another PR.

kellyyeh added a commit to kellyyeh/sonic-buildimage that referenced this pull request May 11, 2022
kellyyeh added a commit to kellyyeh/sonic-buildimage that referenced this pull request May 25, 2022
lguohan pushed a commit that referenced this pull request Jun 4, 2022
liushilongbuaa pushed a commit to liushilongbuaa/sonic-buildimage that referenced this pull request Jun 20, 2022
@liuh-80
Copy link
Contributor

liuh-80 commented Feb 2, 2023

202012 branch PR merged: #10808

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.

[dhcpv6 relay] - DHCPv6 relay forwards request from client with malformed payload
6 participants