@@ -36,6 +36,10 @@ import (
36
36
"github.com/projectcalico/calico/felix/rules"
37
37
)
38
38
39
+ const (
40
+ IPIPIfaceName = "tunl0"
41
+ )
42
+
39
43
// ipipManager manages the all-hosts IP set, which is used by some rules in our static chains
40
44
// when IPIP is enabled. It doesn't actually program the rules, because they are part of the
41
45
// top-level static chains.
@@ -112,7 +116,6 @@ func newIPIPManager(
112
116
brt = routetable .New (
113
117
[]string {routetable .InterfaceNone },
114
118
4 ,
115
- false ,
116
119
dpConfig .NetlinkTimeout ,
117
120
dpConfig .DeviceRouteSourceAddress ,
118
121
blackHoleProto ,
@@ -135,7 +138,7 @@ func newIPIPManager(
135
138
realIPIPNetlink {},
136
139
func (interfaceRegexes []string , ipVersion uint8 , vxlan bool , netlinkTimeout time.Duration ,
137
140
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 ,
139
142
deviceRouteSourceAddress , deviceRouteProtocol , removeExternalRoutes , unix .RT_TABLE_MAIN ,
140
143
opRecorder , featureDetector ,
141
144
)
@@ -461,19 +464,19 @@ func (m *ipipManager) configureIPIPDevice(mtu int, address net.IP) error {
461
464
"device" : m .ipipDevice ,
462
465
})
463
466
logCxt .Debug ("Configuring IPIP tunnel" )
464
- link , err := m .dataplane .LinkByName ("tunl0" )
467
+ link , err := m .dataplane .LinkByName (IPIPIfaceName )
465
468
if err != nil {
466
469
m .logCtx .WithError (err ).Info ("Failed to get IPIP tunnel device, assuming it isn't present" )
467
470
// We call out to "ip tunnel", which takes care of loading the kernel module if
468
471
// needed. The tunl0 device is actually created automatically by the kernel
469
472
// module.
470
473
// 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" )
472
475
if err != nil {
473
476
m .logCtx .WithError (err ).Warning ("Failed to add IPIP tunnel device" )
474
477
return err
475
478
}
476
- link , err = m .dataplane .LinkByName ("tunl0" )
479
+ link , err = m .dataplane .LinkByName (IPIPIfaceName )
477
480
if err != nil {
478
481
m .logCtx .WithError (err ).Warning ("Failed to get tunnel device" )
479
482
return err
@@ -499,7 +502,7 @@ func (m *ipipManager) configureIPIPDevice(mtu int, address net.IP) error {
499
502
logCxt .Info ("Set tunnel admin up" )
500
503
}
501
504
502
- if err := m .setLinkAddressV4 ("tunl0" , address ); err != nil {
505
+ if err := m .setLinkAddressV4 (IPIPIfaceName , address ); err != nil {
503
506
m .logCtx .WithError (err ).Warn ("Failed to set tunnel device IP" )
504
507
return err
505
508
}
0 commit comments