Skip to content

Commit

Permalink
fix ovn-speaker router bug (#2433)
Browse files Browse the repository at this point in the history
Co-authored-by: Edison Meng (孟志慧)-浪潮数据 <mengzhihui01@inspur.com>
  • Loading branch information
KillMaster9 and Edison Meng (孟志慧)-浪潮数据 committed Mar 7, 2023
1 parent 497260e commit f4bef89
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/speaker/subnet.go
Expand Up @@ -4,6 +4,7 @@ package speaker
import (
"context"
"fmt"
"golang.org/x/sys/unix"
"net"
"strconv"
"strings"
Expand Down Expand Up @@ -90,7 +91,8 @@ func (c *Controller) syncSubnetRoutes() {
attrInterfaces, _ := bgpapiutil.UnmarshalPathAttributes(path.Pattrs)
nextHop := getNextHopFromPathAttributes(attrInterfaces)
klog.V(5).Infof("nexthop is %s, routerID is %s", nextHop.String(), c.config.RouterId)
if nextHop.String() == c.config.RouterId {
route, _ := netlink.RouteGet(nextHop)
if len(route) == 1 && route[0].Type == unix.RTN_LOCAL || nextHop.String() == c.config.RouterId {
bgpExists = append(bgpExists, d.Prefix)
return
}
Expand Down

0 comments on commit f4bef89

Please sign in to comment.