Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
26e7d8b6
Commit
26e7d8b6
authored
Jun 15, 2015
by
Fabio Yeon
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #9679 from BenTheElder/export_iptables_getversion
Export GetIptablesVersion utility in pkg/util/iptables
parents
0f370746
c5baf1f2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
iptables.go
pkg/util/iptables/iptables.go
+10
-0
No files found.
pkg/util/iptables/iptables.go
View file @
26e7d8b6
...
...
@@ -343,6 +343,16 @@ func getIptablesVersionString(exec utilexec.Interface) (string, error) {
return
string
(
bytes
),
nil
}
// GetIptablesVersion returns the major minor and patch version of iptables
// which will all be zero in case of error, and any error encountered.
func
GetIptablesVersion
(
exec
utilexec
.
Interface
)
(
int
,
int
,
int
,
error
)
{
s
,
err
:=
getIptablesVersionString
(
exec
)
if
err
!=
nil
{
return
0
,
0
,
0
,
err
}
return
extractIptablesVersion
(
s
)
}
// Checks if an iptables version is after 1.4.11, when --check was added
func
iptablesHasCheckCommand
(
v1
int
,
v2
int
,
v3
int
)
bool
{
if
v1
>
1
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment