Skip to content

Commit b1a5d6a

Browse files
committed
fix merg
1 parent 199474d commit b1a5d6a

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

felix/dataplane/linux/int_dataplane.go

+5-3
Original file line numberDiff line numberDiff line change
@@ -807,9 +807,11 @@ func NewIntDataplaneDriver(config Config) *InternalDataplane {
807807
var routeTableIPIP routetable.RouteTableInterface
808808
if !config.RouteSyncDisabled {
809809
log.Debug("RouteSyncDisabled is false.")
810-
routeTableIPIP = routetable.New([]string{"^tunl0$"}, 4, false, config.NetlinkTimeout,
811-
nil, config.DeviceRouteProtocol, true, unix.RT_TABLE_MAIN,
812-
dp.loopSummarizer, featureDetector, routetable.WithLivenessCB(dp.reportHealth))
810+
routeTableIPIP = routetable.New(
811+
[]string{"^tunl0$"}, 4, config.NetlinkTimeout,
812+
config.DeviceRouteSourceAddress, config.DeviceRouteProtocol, config.RemoveExternalRoutes,
813+
unix.RT_TABLE_MAIN, dp.loopSummarizer, featureDetector, routetable.WithLivenessCB(dp.reportHealth),
814+
routetable.WithRouteCleanupGracePeriod(routeCleanupGracePeriod))
813815
} else {
814816
log.Info("RouteSyncDisabled is true, using DummyTable.")
815817
routeTableIPIP = &routetable.DummyTable{}

felix/dataplane/linux/ipip_mgr.go

+9-6
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ import (
3636
"github.com/projectcalico/calico/felix/rules"
3737
)
3838

39+
const (
40+
IPIPIfaceName = "tunl0"
41+
)
42+
3943
// ipipManager manages the all-hosts IP set, which is used by some rules in our static chains
4044
// when IPIP is enabled. It doesn't actually program the rules, because they are part of the
4145
// top-level static chains.
@@ -112,7 +116,6 @@ func newIPIPManager(
112116
brt = routetable.New(
113117
[]string{routetable.InterfaceNone},
114118
4,
115-
false,
116119
dpConfig.NetlinkTimeout,
117120
dpConfig.DeviceRouteSourceAddress,
118121
blackHoleProto,
@@ -135,7 +138,7 @@ func newIPIPManager(
135138
realIPIPNetlink{},
136139
func(interfaceRegexes []string, ipVersion uint8, vxlan bool, netlinkTimeout time.Duration,
137140
deviceRouteSourceAddress net.IP, deviceRouteProtocol netlink.RouteProtocol, removeExternalRoutes bool) routetable.RouteTableInterface {
138-
return routetable.New(interfaceRegexes, ipVersion, vxlan, netlinkTimeout,
141+
return routetable.New(interfaceRegexes, ipVersion, netlinkTimeout,
139142
deviceRouteSourceAddress, deviceRouteProtocol, removeExternalRoutes, unix.RT_TABLE_MAIN,
140143
opRecorder, featureDetector,
141144
)
@@ -461,19 +464,19 @@ func (m *ipipManager) configureIPIPDevice(mtu int, address net.IP) error {
461464
"device": m.ipipDevice,
462465
})
463466
logCxt.Debug("Configuring IPIP tunnel")
464-
link, err := m.dataplane.LinkByName("tunl0")
467+
link, err := m.dataplane.LinkByName(IPIPIfaceName)
465468
if err != nil {
466469
m.logCtx.WithError(err).Info("Failed to get IPIP tunnel device, assuming it isn't present")
467470
// We call out to "ip tunnel", which takes care of loading the kernel module if
468471
// needed. The tunl0 device is actually created automatically by the kernel
469472
// module.
470473
// TODO: fix this:
471-
err := m.dataplane.RunCmd("ip", "tunnel", "add", "tunl0", "mode", "ipip")
474+
err := m.dataplane.RunCmd("ip", "tunnel", "add", IPIPIfaceName, "mode", "ipip")
472475
if err != nil {
473476
m.logCtx.WithError(err).Warning("Failed to add IPIP tunnel device")
474477
return err
475478
}
476-
link, err = m.dataplane.LinkByName("tunl0")
479+
link, err = m.dataplane.LinkByName(IPIPIfaceName)
477480
if err != nil {
478481
m.logCtx.WithError(err).Warning("Failed to get tunnel device")
479482
return err
@@ -499,7 +502,7 @@ func (m *ipipManager) configureIPIPDevice(mtu int, address net.IP) error {
499502
logCxt.Info("Set tunnel admin up")
500503
}
501504

502-
if err := m.setLinkAddressV4("tunl0", address); err != nil {
505+
if err := m.setLinkAddressV4(IPIPIfaceName, address); err != nil {
503506
m.logCtx.WithError(err).Warn("Failed to set tunnel device IP")
504507
return err
505508
}

felix/dataplane/linux/vxlan_mgr.go

+1
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ func newVXLANManagerWithShims(
194194
noEncapProtocol = dpConfig.DeviceRouteProtocol
195195
}
196196

197+
logCtx := logrus.WithField("ipVersion", ipVersion)
197198
return &vxlanManager{
198199
ipsetsDataplane: ipsetsDataplane,
199200
ipSetMetadata: ipsets.IPSetMetadata{

0 commit comments

Comments
 (0)