NetworkManager/src/core/nm-bond-manager.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

39 lines
1.5 KiB
C
Raw Permalink Normal View History

/* SPDX-License-Identifier: LGPL-2.1-or-later */
#ifndef __NM_BOND_MANAGER_H__
#define __NM_BOND_MANAGER_H__
typedef struct _NMBondManager NMBondManager;
struct _NMPlatform;
typedef enum {
NM_BOND_MANAGER_EVENT_TYPE_STATE,
} NMBondManagerEventType;
typedef void (*NMBondManagerCallback)(NMBondManager *self,
NMBondManagerEventType event_type,
gpointer user_data);
NMBondManager *nm_bond_manager_new(struct _NMPlatform *platform,
int ifindex,
const char *connection_uuid,
NMBondManagerCallback callback,
gpointer user_data);
void nm_bond_manager_reapply(NMBondManager *self);
bonding: send ARP announcement on bonding-slb link/carrier down When a bond in balance-slb is created, the ports are enabled or disabled based on carrier and link state. If the link/carrier goes down, the port becomes disabled and we must make sure the MAC tables of the switches are updated properly so the traffic is redirected. In order to solve this, we send a GARP or RARP broadcast packet on the bond. This fix cover 3 different balance-slb scenarios. Scenario 1: The bond in balance-slb mode has IPv4 address configured and some ports connected. Here the bond is acting like active-backup as the packets will always have as source MAC the address of the bond interface. When a port goes down, NetworkManager will send a GARP broadcast announcing the address configured on the bond with the MAC address configured on the port. Scenario 2: The bond in balance-slb mode is connected to a bridge and has some ports connected. The bridge has IPv4 configured. When a port goes down, NetworkManager will send a GARP broadcast announcing the address configured on the bridge with the MAC address configured on the port. Scenario 3: The bond in balance-slb mode is connected to a bridge and has some ports connected. The bridge does not have IP configuration and therefore everything is L2. When a port goes down, NetworkManager will query the FDB table and filter the entries by the ones belonging to the bridge and the bond ifindexes. Then, it will send a RARP broadcast announcing every learned MAC address from FDB. Fixes: e9268e392418 ('firewall: add mlag firewall utils for multi chassis link aggregation (MLAG) for bonding-slb')
2024-11-07 09:10:20 +01:00
gboolean nm_bond_manager_send_arp(int bond_ifindex,
int bridge_ifindex,
struct _NMPlatform *platform,
in_addr_t *addrs_array,
gsize addrs_len);
void nm_bond_manager_destroy(NMBondManager *self);
int nm_bond_manager_get_ifindex(NMBondManager *self);
const char *nm_bond_manager_get_connection_uuid(NMBondManager *self);
NMOptionBool nm_bond_manager_get_state(NMBondManager *self);
#endif /* __NM_BOND_MANAGER_H__ */