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.
Showing the changes to include (1 of 3 files). Show all
Unified · Split
| @@ -29,8 +29,11 @@ · 28 unmodified lines | ||
| 29 | 29 | #include <net/bond_3ad.h> |
| 30 | 30 | #include <net/bond_alb.h> |
| 31 | 31 | #include <net/bond_options.h> |
| 32 | +#include <net/ipv6.h> | |
| 33 | +#include <net/addrconf.h> | |
| 32 | 34 | |
| 33 | 35 | #define BOND_MAX_ARP_TARGETS 16 |
| 36 | +#define BOND_MAX_NS_TARGETS BOND_MAX_ARP_TARGETS | |
| 34 | 37 | |
| 35 | 38 | #define BOND_DEFAULT_MIIMON 100 |
| 36 | 39 | |
| @@ -146,6 +149,7 @@ struct bond_params { · 109 unmodified lines | ||
| 146 | 149 | struct reciprocal_value reciprocal_packets_per_slave; |
| 147 | 150 | u16 ad_actor_sys_prio; |
| 148 | 151 | u16 ad_user_port_key; |
| 152 | + struct in6_addr ns_targets[BOND_MAX_NS_TARGETS]; | |
| 149 | 153 | |
| 150 | 154 | /* 2 bytes of padding : see ether_addr_equal_64bits() */ |
| 151 | 155 | u8 ad_actor_system[ETH_ALEN + 2]; |
| @@ -628,7 +632,7 @@ struct bond_net { · 476 unmodified lines | ||
| 628 | 632 | struct class_attribute class_attr_bonding_masters; |
| 629 | 633 | }; |
| 630 | 634 | |
| 631 | −int bond_arp_rcv(const struct sk_buff *skb, struct bonding *bond, struct slave *slave); | |
| 635 | +int bond_rcv_validate(const struct sk_buff *skb, struct bonding *bond, struct slave *slave); | |
| 632 | 636 | netdev_tx_t bond_dev_queue_xmit(struct bonding *bond, struct sk_buff *skb, struct net_device *slave_dev); |
| 633 | 637 | int bond_create(struct net *net, const char *name); |
| 634 | 638 | int 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 | 739 | return -1; |
| 736 | 740 | } |
| 737 | 741 | |
| 742 | +static 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 | 755 | /* exported from bond_main.c */ |
| 739 | 756 | extern unsigned int bond_net_id; |
| 740 | 757 | |