Skip to content

Commit

Permalink
zebra: Remove some unused functions on linux build
Browse files Browse the repository at this point in the history
The functions:
if_get_flags
if_flags_update
if_flags_mangle

are never invoked from a linux netlink build.  Put a #ifdef
around those functions so that they are not included on the
linux build as that they are not needed there.

Signed-off-by: Donald Sharp <[email protected]>
  • Loading branch information
donaldsharp committed Sep 20, 2024
1 parent b78392c commit af1d337
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions zebra/interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ int if_subnet_delete(struct interface *ifp, struct connected *ifc)
return 0;
}

#ifndef HAVE_NETLINK
/* if_flags_mangle: A place for hacks that require mangling
* or tweaking the interface flags.
*
Expand Down Expand Up @@ -484,6 +485,7 @@ void if_flags_update(struct interface *ifp, uint64_t newflags)
if_up(ifp, true);
}
}
#endif

/* Wake up configured address if it is not in current kernel
address. */
Expand Down
2 changes: 2 additions & 0 deletions zebra/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,7 @@ int if_unset_prefix_ctx(const struct zebra_dplane_ctx *ctx)
#endif /* HAVE_STRUCT_IFALIASREQ */
#endif /* HAVE_NETLINK */

#ifndef HAVE_NETLINK
/* get interface flags */
void if_get_flags(struct interface *ifp)
{
Expand Down Expand Up @@ -485,6 +486,7 @@ void if_get_flags(struct interface *ifp)
out:
if_flags_update(ifp, (ifreqflags.ifr_flags & 0x0000ffff));
}
#endif

/* Set interface flags */
int if_set_flags(struct interface *ifp, uint64_t flags)
Expand Down

0 comments on commit af1d337

Please sign in to comment.