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
2929 #include <net/bond_3ad.h>
3030 #include <net/bond_alb.h>
3131 #include <net/bond_options.h>
32+#include <net/ipv6.h>
33+#include <net/addrconf.h>
3234
3335 #define BOND_MAX_ARP_TARGETS 16
36+#define BOND_MAX_NS_TARGETS BOND_MAX_ARP_TARGETS
3437
3538 #define BOND_DEFAULT_MIIMON 100
3639
@@ -146,6 +149,7 @@ struct bond_params { · 109 unmodified lines
146149 struct reciprocal_value reciprocal_packets_per_slave;
147150 u16 ad_actor_sys_prio;
148151 u16 ad_user_port_key;
152+ struct in6_addr ns_targets[BOND_MAX_NS_TARGETS];
149153
150154 /* 2 bytes of padding : see ether_addr_equal_64bits() */
151155 u8 ad_actor_system[ETH_ALEN + 2];
@@ -628,7 +632,7 @@ struct bond_net { · 476 unmodified lines
628632 struct class_attribute class_attr_bonding_masters;
629633 };
630634
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);
632636 netdev_tx_t bond_dev_queue_xmit(struct bonding *bond, struct sk_buff *skb, struct net_device *slave_dev);
633637 int bond_create(struct net *net, const char *name);
634638 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
735739 return -1;
736740 }
737741
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+
738755 /* exported from bond_main.c */
739756 extern unsigned int bond_net_id;
740757

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