@@ -287,6 +287,7 @@ type InternalDataplane struct {
287
287
ipSets []common.IPSetsDataplane
288
288
289
289
ipipManager * ipipManager
290
+ ipipParentC chan string
290
291
291
292
vxlanManager * vxlanManager
292
293
vxlanParentC chan string
@@ -806,10 +807,29 @@ func NewIntDataplaneDriver(config Config) *InternalDataplane {
806
807
dp .RegisterManager (newFloatingIPManager (natTableV4 , ruleRenderer , 4 , config .FloatingIPsEnabled ))
807
808
dp .RegisterManager (newMasqManager (ipSetsV4 , natTableV4 , ruleRenderer , config .MaxIPSetSize , 4 ))
808
809
if config .RulesConfig .IPIPEnabled {
810
+ var routeTableIPIP routetable.RouteTableInterface
811
+ if ! config .RouteSyncDisabled {
812
+ log .Debug ("RouteSyncDisabled is false." )
813
+ routeTableIPIP = routetable .New ([]string {"^" + IPIPIfaceName + "$" }, 4 , config .NetlinkTimeout ,
814
+ config .DeviceRouteSourceAddress , config .DeviceRouteProtocol , true , unix .RT_TABLE_MAIN ,
815
+ dp .loopSummarizer , featureDetector , routetable .WithLivenessCB (dp .reportHealth ))
816
+ } else {
817
+ log .Info ("RouteSyncDisabled is true, using DummyTable." )
818
+ routeTableIPIP = & routetable.DummyTable {}
819
+ }
809
820
log .Info ("IPIP enabled, starting thread to keep tunnel configuration in sync." )
810
821
// Add a manager to keep the all-hosts IP set up to date.
811
- dp .ipipManager = newIPIPManager (ipSetsV4 , config .MaxIPSetSize , config .ExternalNodesCidrs )
812
- go dp .ipipManager .KeepIPIPDeviceInSync (config .IPIPMTU , config .RulesConfig .IPIPTunnelAddress , dataplaneFeatures .ChecksumOffloadBroken )
822
+ dp .ipipManager = newIPIPManager (
823
+ ipSetsV4 ,
824
+ routeTableIPIP ,
825
+ IPIPIfaceName ,
826
+ config ,
827
+ dp .loopSummarizer ,
828
+ 4 ,
829
+ featureDetector ,
830
+ )
831
+ dp .ipipParentC = make (chan string , 1 )
832
+ go dp .ipipManager .KeepIPIPDeviceInSync (context .Background (), config .IPIPMTU , config .RulesConfig .IPIPTunnelAddress , dataplaneFeatures .ChecksumOffloadBroken , 10 * time .Second , dp .ipipParentC )
813
833
dp .RegisterManager (dp .ipipManager ) // IPv4-only
814
834
} else {
815
835
// Only clean up IPIP addresses if IPIP is implicitly disabled (no IPIP pools and not explicitly set in FelixConfig)
@@ -1225,7 +1245,7 @@ func cleanUpVXLANDevice(deviceName string) {
1225
1245
1226
1246
type Manager interface {
1227
1247
// OnUpdate is called for each protobuf message from the datastore. May either directly
1228
- // send updates to the IPSets and iptables.Table objects (which will queue the updates
1248
+ // send updates to the IPSets and iptables. Table objects (which will queue the updates
1229
1249
// until the main loop instructs them to act) or (for efficiency) may wait until
1230
1250
// a call to CompleteDeferredWork() to flush updates to the dataplane.
1231
1251
OnUpdate (protoBufMsg interface {})
@@ -1773,6 +1793,8 @@ func (d *InternalDataplane) loopUpdatingDataplane() {
1773
1793
d .vxlanManager .OnParentNameUpdate (name )
1774
1794
case name := <- d .vxlanParentCV6 :
1775
1795
d .vxlanManagerV6 .OnParentNameUpdate (name )
1796
+ case name := <- d .ipipParentC :
1797
+ d .ipipManager .OnParentNameUpdate (name )
1776
1798
case <- ipSetsRefreshC :
1777
1799
log .Debug ("Refreshing IP sets state" )
1778
1800
d .forceIPSetsRefresh = true
0 commit comments