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

Normalize non standard CIDRs to fix OVS error #1767

Merged
merged 1 commit into from
Jan 22, 2021
Merged

Conversation

tnqn
Copy link
Member

@tnqn tnqn commented Jan 20, 2021

K8s allows non standard CIDRs to be specified (e.g. 10.0.1.1/16,
fe80::7015:efff:fe9a:146b/64). However, OVS will report
OFPBMC_BAD_WILDCARDS error if using them in the OpenFlow messages.
antrea-agent has normalized IPv6 CIDRs before installing Openflows but
hasn't done it for IPv4 CIDRs. This patch fixes the IPv4 case.

Fixes #1764

@tnqn
Copy link
Member Author

tnqn commented Jan 20, 2021

/test-all

@codecov-io
Copy link

codecov-io commented Jan 20, 2021

Codecov Report

Merging #1767 (5cc20c9) into master (9d3d10b) will increase coverage by 0.71%.
The diff coverage is 67.65%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1767      +/-   ##
==========================================
+ Coverage   63.31%   64.02%   +0.71%     
==========================================
  Files         170      192      +22     
  Lines       14250    16355    +2105     
==========================================
+ Hits         9023    10472    +1449     
- Misses       4292     4820     +528     
- Partials      935     1063     +128     
Flag Coverage Δ
e2e-tests 45.57% <53.33%> (?)
kind-e2e-tests 50.47% <48.88%> (-4.92%) ⬇️
unit-tests 42.81% <37.53%> (+1.54%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
.../agent/apiserver/handlers/networkpolicy/handler.go 58.33% <ø> (ø)
...gent/controller/noderoute/node_route_controller.go 60.98% <0.00%> (+14.51%) ⬆️
pkg/agent/flowexporter/flowrecords/flow_records.go 81.81% <ø> (-7.93%) ⬇️
pkg/agent/interfacestore/types.go 81.81% <ø> (+1.81%) ⬆️
pkg/agent/nodeportlocal/k8s/annotations.go 0.00% <ø> (ø)
pkg/agent/nodeportlocal/k8s/controller.go 0.00% <ø> (ø)
pkg/agent/nodeportlocal/npl_agent_init.go 65.62% <ø> (ø)
pkg/agent/nodeportlocal/portcache/port_table.go 0.00% <ø> (ø)
pkg/agent/nodeportlocal/rules/iptable_rule.go 0.00% <ø> (ø)
pkg/agent/nodeportlocal/rules/rules.go 0.00% <ø> (ø)
... and 157 more

srikartati
srikartati previously approved these changes Jan 20, 2021
Copy link
Member

@srikartati srikartati left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for fixing it.

jianjuns
jianjuns previously approved these changes Jan 20, 2021
pkg/util/ip/ip.go Outdated Show resolved Hide resolved
abhiraut
abhiraut previously approved these changes Jan 20, 2021
Copy link
Contributor

@abhiraut abhiraut left a comment

Choose a reason for hiding this comment

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

not sure

K8s allows non standard CIDRs to be specified (e.g. 10.0.1.1/16,
fe80::7015:efff:fe9a:146b/64). However, OVS will report
OFPBMC_BAD_WILDCARDS error if using them in the OpenFlow messages.
antrea-agent has normalized IPv6 CIDRs before installing Openflows but
hasn't done it for IPv4 CIDRs. This patch fixes the IPv4 case.
@tnqn
Copy link
Member Author

tnqn commented Jan 21, 2021

/test-all

@tnqn
Copy link
Member Author

tnqn commented Jan 21, 2021

not sure

@abhiraut Did you want to say something? :)

@abhiraut
Copy link
Contributor

not sure

@abhiraut Did you want to say something? :)

i was going to say something which probably got erased by mistake and i forgot it now.. but anyway .. change looks good to me :D

@tnqn
Copy link
Member Author

tnqn commented Jan 22, 2021

Thanks @srikartati @jianjuns @abhiraut for the review.

@tnqn tnqn merged commit 4d6bdaf into antrea-io:master Jan 22, 2021
@tnqn tnqn deleted the cidr branch January 22, 2021 04:54
antoninbas pushed a commit to antoninbas/antrea that referenced this pull request Feb 10, 2021
K8s allows non standard CIDRs to be specified (e.g. 10.0.1.1/16,
fe80::7015:efff:fe9a:146b/64). However, OVS will report
OFPBMC_BAD_WILDCARDS error if using them in the OpenFlow messages.
antrea-agent has normalized IPv6 CIDRs before installing Openflows but
hasn't done it for IPv4 CIDRs. This patch fixes the IPv4 case.
antoninbas pushed a commit to antoninbas/antrea that referenced this pull request Feb 11, 2021
K8s allows non standard CIDRs to be specified (e.g. 10.0.1.1/16,
fe80::7015:efff:fe9a:146b/64). However, OVS will report
OFPBMC_BAD_WILDCARDS error if using them in the OpenFlow messages.
antrea-agent has normalized IPv6 CIDRs before installing Openflows but
hasn't done it for IPv4 CIDRs. This patch fixes the IPv4 case.
antoninbas pushed a commit that referenced this pull request Feb 11, 2021
K8s allows non standard CIDRs to be specified (e.g. 10.0.1.1/16,
fe80::7015:efff:fe9a:146b/64). However, OVS will report
OFPBMC_BAD_WILDCARDS error if using them in the OpenFlow messages.
antrea-agent has normalized IPv6 CIDRs before installing Openflows but
hasn't done it for IPv4 CIDRs. This patch fixes the IPv4 case.
antoninbas pushed a commit that referenced this pull request Feb 11, 2021
K8s allows non standard CIDRs to be specified (e.g. 10.0.1.1/16,
fe80::7015:efff:fe9a:146b/64). However, OVS will report
OFPBMC_BAD_WILDCARDS error if using them in the OpenFlow messages.
antrea-agent has normalized IPv6 CIDRs before installing Openflows but
hasn't done it for IPv4 CIDRs. This patch fixes the IPv4 case.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NetworkPolicy: unable to allow ingress by CIDR
6 participants