History

bonding: add new parameter ns_targets

Add a new bonding parameter ns_targets to store IPv6 address. Add required bond_ns_send/rcv functions first before adding IPv6 address option setting. Add two functions bond_send/rcv_validate so we can send/recv ARP and NS at the same time.

Hangbin Liu committed 4 years ago

Commit 4e24be01 parent 841e9563 files · +237 −21Browse files

Showing the changes to include (1 of 3 files). Show all

Unified · Split

include/net/bonding.h+18−1
@@ -29,8 +29,11 @@ · 28 unmodified lines
29#include <net/bond_3ad.h>29#include <net/bond_3ad.h>
30#include <net/bond_alb.h>30#include <net/bond_alb.h>
31#include <net/bond_options.h>31#include <net/bond_options.h>
32#include <net/ipv6.h>
33#include <net/addrconf.h>
32 34
33#define BOND_MAX_ARP_TARGETS 1635#define BOND_MAX_ARP_TARGETS 16
36#define BOND_MAX_NS_TARGETS BOND_MAX_ARP_TARGETS
34 37
35#define BOND_DEFAULT_MIIMON 10038#define BOND_DEFAULT_MIIMON 100
36 39
@@ -146,6 +149,7 @@ struct bond_params { · 109 unmodified lines
146 struct reciprocal_value reciprocal_packets_per_slave;149 struct reciprocal_value reciprocal_packets_per_slave;
147 u16 ad_actor_sys_prio;150 u16 ad_actor_sys_prio;
148 u16 ad_user_port_key;151 u16 ad_user_port_key;
152 struct in6_addr ns_targets[BOND_MAX_NS_TARGETS];
149 153
150 /* 2 bytes of padding : see ether_addr_equal_64bits() */154 /* 2 bytes of padding : see ether_addr_equal_64bits() */
151 u8 ad_actor_system[ETH_ALEN + 2];155 u8 ad_actor_system[ETH_ALEN + 2];
@@ -628,7 +632,7 @@ struct bond_net { · 476 unmodified lines
628 struct class_attribute class_attr_bonding_masters;632 struct class_attribute class_attr_bonding_masters;
629};633};
630 634
631int bond_arp_rcv(const struct sk_buff *skb, struct bonding *bond, struct slave *slave);635int bond_rcv_validate(const struct sk_buff *skb, struct bonding *bond, struct slave *slave);
632netdev_tx_t bond_dev_queue_xmit(struct bonding *bond, struct sk_buff *skb, struct net_device *slave_dev);636netdev_tx_t bond_dev_queue_xmit(struct bonding *bond, struct sk_buff *skb, struct net_device *slave_dev);
633int bond_create(struct net *net, const char *name);637int bond_create(struct net *net, const char *name);
634int bond_create_sysfs(struct bond_net *net);638int bond_create_sysfs(struct bond_net *net);
@@ -735,6 +739,19 @@ static inline int bond_get_targets_ip(__be32 *targets, __be32 ip) · 100 unmodified lines
735 return -1;739 return -1;
736}740}
737 741
742static inline int bond_get_targets_ip6(struct in6_addr *targets, struct in6_addr *ip)
743{
744 int i;
745
746 for (i = 0; i < BOND_MAX_NS_TARGETS; i++)
747 if (ipv6_addr_equal(&targets[i], ip))
748 return i;
749 else if (ipv6_addr_any(&targets[i]))
750 break;
751
752 return -1;
753}
754
738/* exported from bond_main.c */755/* exported from bond_main.c */
739extern unsigned int bond_net_id;756extern unsigned int bond_net_id;
740 757

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t