Skip to content

Commit 41ba5d8

Browse files
committed
Simplify logic
1 parent 14f4293 commit 41ba5d8

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

gobgp.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,17 +105,12 @@ func (bh Blackhole) addPath(ipnet *net.IPNet, comms ...uint32) error {
105105
})
106106
}
107107

108-
var isWithdraw bool
109-
if len(comms) < 1 {
110-
isWithdraw = true
111-
}
112-
113108
_, err = bh.server.AddPath(context.Background(), &api.AddPathRequest{
114109
Path: &api.Path{
115110
Family: family,
116111
Nlri: nlri,
117112
Pattrs: []*any.Any{originAttr, nextHopAttr, communitiesAttr},
118-
IsWithdraw: isWithdraw,
113+
IsWithdraw: len(comms) < 1,
119114
}})
120115

121116
return err

0 commit comments

Comments
 (0)