@@ -300,7 +300,7 @@ func Load(configBlob []byte) (*config.Config, error) {
300300 if c .OriginStandardCommunities == nil {
301301 c .OriginStandardCommunities = []string {}
302302 }
303- c .OriginStandardCommunities = append (c .OriginStandardCommunities , community )
303+ c .OriginStandardCommunities = append (c .OriginStandardCommunities , strings . ReplaceAll ( community , ":" , "," ) )
304304 } else if communityType == "large" {
305305 if c .OriginLargeCommunities == nil {
306306 c .OriginLargeCommunities = []string {}
@@ -312,6 +312,25 @@ func Load(configBlob []byte) (*config.Config, error) {
312312 }
313313 }
314314
315+ if c .LocalCommunities != nil {
316+ for _ , community := range c .LocalCommunities {
317+ communityType := categorizeCommunity (community )
318+ if communityType == "standard" {
319+ if c .LocalStandardCommunities == nil {
320+ c .LocalStandardCommunities = []string {}
321+ }
322+ c .LocalStandardCommunities = append (c .LocalStandardCommunities , strings .ReplaceAll (community , ":" , "," ))
323+ } else if communityType == "large" {
324+ if c .LocalLargeCommunities == nil {
325+ c .LocalLargeCommunities = []string {}
326+ }
327+ c .LocalLargeCommunities = append (c .LocalLargeCommunities , strings .ReplaceAll (community , ":" , "," ))
328+ } else {
329+ return nil , errors .New ("Invalid local community: " + community )
330+ }
331+ }
332+ }
333+
315334 // Parse static routes
316335 for prefix , nexthop := range c .Kernel .Statics {
317336 // Handle interface suffix
0 commit comments