mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-14 16:04:49 +00:00
zebra: Remove unnecessary function parameter
The snl variable is no longer needed to be passed around, so remove it from the calling path. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
parent
783827ae61
commit
2414abd3b0
@ -557,10 +557,11 @@ static int netlink_bridge_interface(struct nlmsghdr *h, int len, ns_id_t ns_id,
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Called from interface_lookup_netlink(). This function is only used
|
||||
during bootstrap. */
|
||||
static int netlink_interface(struct sockaddr_nl *snl, struct nlmsghdr *h,
|
||||
ns_id_t ns_id, int startup)
|
||||
/*
|
||||
* Called from interface_lookup_netlink(). This function is only used
|
||||
* during bootstrap.
|
||||
*/
|
||||
static int netlink_interface(struct nlmsghdr *h, ns_id_t ns_id, int startup)
|
||||
{
|
||||
int len;
|
||||
struct ifinfomsg *ifi;
|
||||
@ -874,8 +875,7 @@ int kernel_address_delete_ipv6(struct interface *ifp, struct connected *ifc)
|
||||
return netlink_address(RTM_DELADDR, AF_INET6, ifp, ifc);
|
||||
}
|
||||
|
||||
int netlink_interface_addr(struct sockaddr_nl *snl, struct nlmsghdr *h,
|
||||
ns_id_t ns_id, int startup)
|
||||
int netlink_interface_addr(struct nlmsghdr *h, ns_id_t ns_id, int startup)
|
||||
{
|
||||
int len;
|
||||
struct ifaddrmsg *ifa;
|
||||
@ -1078,8 +1078,7 @@ static void if_netlink_check_ifp_instance_consistency(uint16_t cmd,
|
||||
*/
|
||||
}
|
||||
|
||||
int netlink_link_change(struct sockaddr_nl *snl, struct nlmsghdr *h,
|
||||
ns_id_t ns_id, int startup)
|
||||
int netlink_link_change(struct nlmsghdr *h, ns_id_t ns_id, int startup)
|
||||
{
|
||||
int len;
|
||||
struct ifinfomsg *ifi;
|
||||
|
@ -23,10 +23,9 @@
|
||||
|
||||
#ifdef HAVE_NETLINK
|
||||
|
||||
extern int netlink_interface_addr(struct sockaddr_nl *snl, struct nlmsghdr *h,
|
||||
ns_id_t ns_id, int startup);
|
||||
extern int netlink_link_change(struct sockaddr_nl *snl, struct nlmsghdr *h,
|
||||
ns_id_t ns_id, int startup);
|
||||
extern int netlink_interface_addr(struct nlmsghdr *h, ns_id_t ns_id,
|
||||
int startup);
|
||||
extern int netlink_link_change(struct nlmsghdr *h, ns_id_t ns_id, int startup);
|
||||
extern int interface_lookup_netlink(struct zebra_ns *zns);
|
||||
|
||||
#endif /* HAVE_NETLINK */
|
||||
|
@ -128,8 +128,7 @@ extern uint32_t nl_rcvbufsize;
|
||||
|
||||
extern struct zebra_privs_t zserv_privs;
|
||||
|
||||
int netlink_talk_filter(struct sockaddr_nl *snl, struct nlmsghdr *h,
|
||||
ns_id_t ns_id, int startup)
|
||||
int netlink_talk_filter(struct nlmsghdr *h, ns_id_t ns_id, int startup)
|
||||
{
|
||||
/*
|
||||
* This is an error condition that must be handled during
|
||||
@ -244,8 +243,7 @@ static int netlink_socket(struct nlsock *nl, unsigned long groups,
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int netlink_information_fetch(struct sockaddr_nl *snl,
|
||||
struct nlmsghdr *h, ns_id_t ns_id,
|
||||
static int netlink_information_fetch(struct nlmsghdr *h, ns_id_t ns_id,
|
||||
int startup)
|
||||
{
|
||||
/*
|
||||
@ -259,25 +257,25 @@ static int netlink_information_fetch(struct sockaddr_nl *snl,
|
||||
*/
|
||||
switch (h->nlmsg_type) {
|
||||
case RTM_NEWROUTE:
|
||||
return netlink_route_change(snl, h, ns_id, startup);
|
||||
return netlink_route_change(h, ns_id, startup);
|
||||
case RTM_DELROUTE:
|
||||
return netlink_route_change(snl, h, ns_id, startup);
|
||||
return netlink_route_change(h, ns_id, startup);
|
||||
case RTM_NEWLINK:
|
||||
return netlink_link_change(snl, h, ns_id, startup);
|
||||
return netlink_link_change(h, ns_id, startup);
|
||||
case RTM_DELLINK:
|
||||
return netlink_link_change(snl, h, ns_id, startup);
|
||||
return netlink_link_change(h, ns_id, startup);
|
||||
case RTM_NEWADDR:
|
||||
return netlink_interface_addr(snl, h, ns_id, startup);
|
||||
return netlink_interface_addr(h, ns_id, startup);
|
||||
case RTM_DELADDR:
|
||||
return netlink_interface_addr(snl, h, ns_id, startup);
|
||||
return netlink_interface_addr(h, ns_id, startup);
|
||||
case RTM_NEWNEIGH:
|
||||
return netlink_neigh_change(snl, h, ns_id);
|
||||
return netlink_neigh_change(h, ns_id);
|
||||
case RTM_DELNEIGH:
|
||||
return netlink_neigh_change(snl, h, ns_id);
|
||||
return netlink_neigh_change(h, ns_id);
|
||||
case RTM_NEWRULE:
|
||||
return netlink_rule_change(snl, h, ns_id, startup);
|
||||
return netlink_rule_change(h, ns_id, startup);
|
||||
case RTM_DELRULE:
|
||||
return netlink_rule_change(snl, h, ns_id, startup);
|
||||
return netlink_rule_change(h, ns_id, startup);
|
||||
default:
|
||||
/*
|
||||
* If we have received this message then
|
||||
@ -512,8 +510,7 @@ const char *nl_rttype_to_str(uint8_t rttype)
|
||||
* startup -> Are we reading in under startup conditions? passed to
|
||||
* the filter.
|
||||
*/
|
||||
int netlink_parse_info(int (*filter)(struct sockaddr_nl *, struct nlmsghdr *,
|
||||
ns_id_t, int),
|
||||
int netlink_parse_info(int (*filter)(struct nlmsghdr *, ns_id_t, int),
|
||||
struct nlsock *nl, struct zebra_ns *zns, int count,
|
||||
int startup)
|
||||
{
|
||||
@ -691,7 +688,7 @@ int netlink_parse_info(int (*filter)(struct sockaddr_nl *, struct nlmsghdr *,
|
||||
continue;
|
||||
}
|
||||
|
||||
error = (*filter)(&snl, h, zns->ns_id, startup);
|
||||
error = (*filter)(h, zns->ns_id, startup);
|
||||
if (error < 0) {
|
||||
zlog_err("%s filter function error", nl->name);
|
||||
ret = error;
|
||||
@ -725,8 +722,7 @@ int netlink_parse_info(int (*filter)(struct sockaddr_nl *, struct nlmsghdr *,
|
||||
* startup -> Are we reading in under startup conditions
|
||||
* This is passed through eventually to filter.
|
||||
*/
|
||||
int netlink_talk(int (*filter)(struct sockaddr_nl *, struct nlmsghdr *, ns_id_t,
|
||||
int startup),
|
||||
int netlink_talk(int (*filter)(struct nlmsghdr *, ns_id_t, int startup),
|
||||
struct nlmsghdr *n, struct nlsock *nl, struct zebra_ns *zns,
|
||||
int startup)
|
||||
{
|
||||
|
@ -45,14 +45,11 @@ extern const char *nl_rtproto_to_str(uint8_t rtproto);
|
||||
extern const char *nl_family_to_str(uint8_t family);
|
||||
extern const char *nl_rttype_to_str(uint8_t rttype);
|
||||
|
||||
extern int netlink_parse_info(int (*filter)(struct sockaddr_nl *,
|
||||
struct nlmsghdr *, ns_id_t, int),
|
||||
extern int netlink_parse_info(int (*filter)(struct nlmsghdr *, ns_id_t, int),
|
||||
struct nlsock *nl, struct zebra_ns *zns,
|
||||
int count, int startup);
|
||||
extern int netlink_talk_filter(struct sockaddr_nl *, struct nlmsghdr *, ns_id_t,
|
||||
int startup);
|
||||
extern int netlink_talk(int (*filter)(struct sockaddr_nl *, struct nlmsghdr *,
|
||||
ns_id_t, int startup),
|
||||
extern int netlink_talk_filter(struct nlmsghdr *h, ns_id_t ns, int startup);
|
||||
extern int netlink_talk(int (*filter)(struct nlmsghdr *, ns_id_t, int startup),
|
||||
struct nlmsghdr *n, struct nlsock *nl,
|
||||
struct zebra_ns *zns, int startup);
|
||||
extern int netlink_request(struct nlsock *nl, struct nlmsghdr *n);
|
||||
|
@ -246,8 +246,7 @@ static vrf_id_t vrf_lookup_by_table(uint32_t table_id, ns_id_t ns_id)
|
||||
}
|
||||
|
||||
/* Looking up routing table by netlink interface. */
|
||||
static int netlink_route_change_read_unicast(struct sockaddr_nl *snl,
|
||||
struct nlmsghdr *h, ns_id_t ns_id,
|
||||
static int netlink_route_change_read_unicast(struct nlmsghdr *h, ns_id_t ns_id,
|
||||
int startup)
|
||||
{
|
||||
int len;
|
||||
@ -627,8 +626,7 @@ static int netlink_route_change_read_unicast(struct sockaddr_nl *snl,
|
||||
|
||||
static struct mcast_route_data *mroute = NULL;
|
||||
|
||||
static int netlink_route_change_read_multicast(struct sockaddr_nl *snl,
|
||||
struct nlmsghdr *h,
|
||||
static int netlink_route_change_read_multicast(struct nlmsghdr *h,
|
||||
ns_id_t ns_id, int startup)
|
||||
{
|
||||
int len;
|
||||
@ -717,8 +715,7 @@ static int netlink_route_change_read_multicast(struct sockaddr_nl *snl,
|
||||
return 0;
|
||||
}
|
||||
|
||||
int netlink_route_change(struct sockaddr_nl *snl, struct nlmsghdr *h,
|
||||
ns_id_t ns_id, int startup)
|
||||
int netlink_route_change(struct nlmsghdr *h, ns_id_t ns_id, int startup)
|
||||
{
|
||||
int len;
|
||||
struct rtmsg *rtm;
|
||||
@ -749,9 +746,9 @@ int netlink_route_change(struct sockaddr_nl *snl, struct nlmsghdr *h,
|
||||
return -1;
|
||||
|
||||
if (rtm->rtm_type == RTN_MULTICAST)
|
||||
netlink_route_change_read_multicast(snl, h, ns_id, startup);
|
||||
netlink_route_change_read_multicast(h, ns_id, startup);
|
||||
else
|
||||
netlink_route_change_read_unicast(snl, h, ns_id, startup);
|
||||
netlink_route_change_read_unicast(h, ns_id, startup);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1810,8 +1807,7 @@ int kernel_del_vtep(vni_t vni, struct interface *ifp, struct in_addr *vtep_ip)
|
||||
((struct rtattr *)(((char *)(r)) + NLMSG_ALIGN(sizeof(struct ndmsg))))
|
||||
#endif
|
||||
|
||||
static int netlink_macfdb_change(struct sockaddr_nl *snl, struct nlmsghdr *h,
|
||||
int len, ns_id_t ns_id)
|
||||
static int netlink_macfdb_change(struct nlmsghdr *h, int len, ns_id_t ns_id)
|
||||
{
|
||||
struct ndmsg *ndm;
|
||||
struct interface *ifp;
|
||||
@ -1946,8 +1942,7 @@ static int netlink_macfdb_change(struct sockaddr_nl *snl, struct nlmsghdr *h,
|
||||
return zebra_vxlan_local_mac_del(ifp, br_if, &mac, vid);
|
||||
}
|
||||
|
||||
static int netlink_macfdb_table(struct sockaddr_nl *snl, struct nlmsghdr *h,
|
||||
ns_id_t ns_id, int startup)
|
||||
static int netlink_macfdb_table(struct nlmsghdr *h, ns_id_t ns_id, int startup)
|
||||
{
|
||||
int len;
|
||||
struct ndmsg *ndm;
|
||||
@ -1965,7 +1960,7 @@ static int netlink_macfdb_table(struct sockaddr_nl *snl, struct nlmsghdr *h,
|
||||
if (ndm->ndm_family != AF_BRIDGE)
|
||||
return 0;
|
||||
|
||||
return netlink_macfdb_change(snl, h, len, ns_id);
|
||||
return netlink_macfdb_change(h, len, ns_id);
|
||||
}
|
||||
|
||||
/* Request for MAC FDB information from the kernel */
|
||||
@ -2121,8 +2116,7 @@ static int netlink_macfdb_update(struct interface *ifp, vlanid_t vid,
|
||||
(NUD_PERMANENT | NUD_NOARP | NUD_REACHABLE | NUD_PROBE | NUD_STALE \
|
||||
| NUD_DELAY)
|
||||
|
||||
static int netlink_ipneigh_change(struct sockaddr_nl *snl, struct nlmsghdr *h,
|
||||
int len, ns_id_t ns_id)
|
||||
static int netlink_ipneigh_change(struct nlmsghdr *h, int len, ns_id_t ns_id)
|
||||
{
|
||||
struct ndmsg *ndm;
|
||||
struct interface *ifp;
|
||||
@ -2265,8 +2259,7 @@ static int netlink_ipneigh_change(struct sockaddr_nl *snl, struct nlmsghdr *h,
|
||||
return zebra_vxlan_handle_kernel_neigh_del(ifp, link_if, &ip);
|
||||
}
|
||||
|
||||
static int netlink_neigh_table(struct sockaddr_nl *snl, struct nlmsghdr *h,
|
||||
ns_id_t ns_id, int startup)
|
||||
static int netlink_neigh_table(struct nlmsghdr *h, ns_id_t ns_id, int startup)
|
||||
{
|
||||
int len;
|
||||
struct ndmsg *ndm;
|
||||
@ -2284,7 +2277,7 @@ static int netlink_neigh_table(struct sockaddr_nl *snl, struct nlmsghdr *h,
|
||||
if (ndm->ndm_family != AF_INET && ndm->ndm_family != AF_INET6)
|
||||
return 0;
|
||||
|
||||
return netlink_neigh_change(snl, h, len);
|
||||
return netlink_neigh_change(h, len);
|
||||
}
|
||||
|
||||
/* Request for IP neighbor information from the kernel */
|
||||
@ -2344,8 +2337,7 @@ int netlink_neigh_read_for_vlan(struct zebra_ns *zns, struct interface *vlan_if)
|
||||
return ret;
|
||||
}
|
||||
|
||||
int netlink_neigh_change(struct sockaddr_nl *snl, struct nlmsghdr *h,
|
||||
ns_id_t ns_id)
|
||||
int netlink_neigh_change(struct nlmsghdr *h, ns_id_t ns_id)
|
||||
{
|
||||
int len;
|
||||
struct ndmsg *ndm;
|
||||
@ -2361,13 +2353,13 @@ int netlink_neigh_change(struct sockaddr_nl *snl, struct nlmsghdr *h,
|
||||
/* Is this a notification for the MAC FDB or IP neighbor table? */
|
||||
ndm = NLMSG_DATA(h);
|
||||
if (ndm->ndm_family == AF_BRIDGE)
|
||||
return netlink_macfdb_change(snl, h, len, ns_id);
|
||||
return netlink_macfdb_change(h, len, ns_id);
|
||||
|
||||
if (ndm->ndm_type != RTN_UNICAST)
|
||||
return 0;
|
||||
|
||||
if (ndm->ndm_family == AF_INET || ndm->ndm_family == AF_INET6)
|
||||
return netlink_ipneigh_change(snl, h, len, ns_id);
|
||||
return netlink_ipneigh_change(h, len, ns_id);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -58,12 +58,10 @@ void rt_netlink_init(void);
|
||||
|
||||
extern int netlink_mpls_multipath(int cmd, zebra_lsp_t *lsp);
|
||||
|
||||
extern int netlink_route_change(struct sockaddr_nl *snl, struct nlmsghdr *h,
|
||||
ns_id_t ns_id, int startup);
|
||||
extern int netlink_route_change(struct nlmsghdr *h, ns_id_t ns_id, int startup);
|
||||
extern int netlink_route_read(struct zebra_ns *zns);
|
||||
|
||||
extern int netlink_neigh_change(struct sockaddr_nl *snl, struct nlmsghdr *h,
|
||||
ns_id_t ns_id);
|
||||
extern int netlink_neigh_change(struct nlmsghdr *h, ns_id_t ns_id);
|
||||
extern int netlink_macfdb_read(struct zebra_ns *zns);
|
||||
extern int netlink_macfdb_read_for_bridge(struct zebra_ns *zns,
|
||||
struct interface *ifp,
|
||||
|
@ -166,8 +166,7 @@ void kernel_del_pbr_rule(struct zebra_pbr_rule *rule)
|
||||
* notification of interest. The expectation is that if this corresponds
|
||||
* to a PBR rule added by FRR, it will be readded.
|
||||
*/
|
||||
int netlink_rule_change(struct sockaddr_nl *snl, struct nlmsghdr *h,
|
||||
ns_id_t ns_id, int startup)
|
||||
int netlink_rule_change(struct nlmsghdr *h, ns_id_t ns_id, int startup)
|
||||
{
|
||||
struct zebra_ns *zns;
|
||||
struct fib_rule_hdr *frh;
|
||||
|
@ -29,8 +29,7 @@
|
||||
/*
|
||||
* Handle netlink notification informing a rule add or delete.
|
||||
*/
|
||||
extern int netlink_rule_change(struct sockaddr_nl *snl, struct nlmsghdr *h,
|
||||
ns_id_t ns_id, int startup);
|
||||
extern int netlink_rule_change(struct nlmsghdr *h, ns_id_t ns_id, int startup);
|
||||
|
||||
/*
|
||||
* Get to know existing PBR rules in the kernel - typically called at startup.
|
||||
|
Loading…
Reference in New Issue
Block a user