Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
Signed-off-by: zhangzujian <[email protected]>
  • Loading branch information
zhangzujian committed Jan 19, 2024
1 parent 1d8ec22 commit 16cde0d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 16 deletions.
14 changes: 5 additions & 9 deletions lib/netdev-linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -3322,19 +3322,15 @@ netdev_linux_get_addr_list(const struct netdev *netdev_,
struct in6_addr **addr, struct in6_addr **mask, int *n_cnt)
{
struct netdev_linux *netdev = netdev_linux_cast(netdev_);
int ifindex;
int error;

ovs_mutex_lock(&netdev->mutex);
if (netdev_linux_netnsid_is_remote(netdev)) {
error = EOPNOTSUPP;
goto exit;
error = get_ifindex(netdev, &ifindex);
if (error) {
return error;
}

error = netdev_get_addrs(netdev_, addr, mask, n_cnt);

exit:
ovs_mutex_unlock(&netdev->mutex);
return error;
return netdev_get_addrs(ifindex, addr, mask, n_cnt);
}

static void
Expand Down
7 changes: 1 addition & 6 deletions lib/netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -2345,19 +2345,14 @@ netdev_get_addrs_list_flush(void)
}

int
netdev_get_addrs(const struct netdev *dev, struct in6_addr **paddr,
netdev_get_addrs(const int ifindex, struct in6_addr **paddr,
struct in6_addr **pmask, int *n_in)
{
struct in6_addr *addr_array, *mask_array;
int cnt = 0;

ovs_mutex_lock(&if_addr_list_lock);

int ifindex = netdev_get_ifindex(dev);
if (ifindex < 0) {
return -ifindex;
}

if (!if_addr_list) {
int err = netdev_linux_get_addr_list(&if_addr_list);
if (err) {
Expand Down
2 changes: 1 addition & 1 deletion lib/netdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ extern struct seq *tnl_conf_seq;

#ifndef _WIN32
void netdev_get_addrs_list_flush(void);
int netdev_get_addrs(const struct netdev *dev, struct in6_addr **paddr,
int netdev_get_addrs(const int ifindex, struct in6_addr **paddr,
struct in6_addr **pmask, int *n_in6);
#endif

Expand Down

0 comments on commit 16cde0d

Please sign in to comment.