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

fix(wireguard): add ivp6 rule #2526

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions internal/netlink/rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package netlink

import (
"fmt"
"strings"

"github.com/vishvananda/netlink"
)
Expand Down Expand Up @@ -40,10 +41,15 @@ func (n *NetLink) RuleList(family int) (rules []Rule, err error) {
return rules, nil
}

func (n *NetLink) RuleAdd(rule Rule) error {
func (n *NetLink) RuleAdd(rule Rule) (err error) {
n.debugLogger.Debug(ruleDbgMsg(true, rule))
netlinkRule := ruleToNetlinkRule(rule)
return netlink.RuleAdd(&netlinkRule)
err = netlink.RuleAdd(&netlinkRule)
if err != nil && strings.HasSuffix(err.Error(), "file exists") {
// See https://github.com/qdm12/gluetun/issues/2521
return nil
}
return err
}

func (n *NetLink) RuleDel(rule Rule) error {
Expand Down
Loading