bridge: Add support for IEEE 802.11 Proxy ARP for IPv6
Subsystems (4)
RFC 1/1 bridge: Add support for IEEE 802.11 Proxy ARP for IPv6
The patch below adds IPv6 version of the recently added IEEE 802.11 Proxy ARP functionality (BR_PROXYARP and BR_PROXYARP_WIFI) that covers IPv4 in current net-next. There was couple of different options on how to try to re-use existing functions for sending out NA either using an extended version of ndisc_send_na() or by implementing similar functionality in net/bridge to avoid changes in ndisc_send_na(). The patch below follows the latter alternative and exports couple of net/ipv6/ndisc.c functions to allow that to be done (or well, now that I look at it, it does not actually add EXPORT_SYMBOL, but would likely need to add that to make this work with modular IPv6 build). I do have another version that goes through the ndisc_send_na() version as well (i.e., add target_lladdr argument to it to enable the required change into the NA contents to be made for proxyarp purposes).
However, while both of these alternatives of reusing existing functions to build and send the NA seem to work at least when using Linux devices, one of the IEEE 802.11, or well, Hotspot 2.0, to be more exact, protocol requirements is not met. There is an expectation of the access point (i.e., the device that replies to NS on behalf of the real target) to use the MAC address of the real target as the source link layer MAC address in the IPv6 frame that carries the NA. This does not seem to be very convenient requirement from the view point of being able to use ndisc_send_skb() or normal means of sending a IPv6 packet in general.
Would anyone have any recommendations on how to be able to cleanly build an NA from net/bridge/*.c and send it using a specific (not local) MAC address as the link layer source address? Or would the only realistic way for achieving this require the full skb to be build from scratch with the specific source MAC address and not even trying to re-use ndisc_send_skb() for sending it?
The current RFC version:
This is an IPv6 extension of commit 958501163ddd ("bridge: Add support for IEEE 802.11 Proxy ARP"). The IEEE 802.11 Proxy ARP feature is defined in IEEE Std 802.11-2012, 10.23.13. It allows the AP devices to keep track of the hardware-address-to-IP-address mapping of the mobile devices within the WLAN network.
The AP will learn this mapping via observing NS/NA frames (this part is implemented in user space, e.g., in hostapd). When a request for such information is made (i.e., Neighbor Solicitation), the AP will respond on behalf of the associated mobile device. In the process of doing so, the AP will drop the multicast request frame that was intended to go out to the wireless medium.
--- include/net/ndisc.h | 5 +++ net/bridge/br_multicast.c | 112 ++++++++++++++++++++++++++++++++++++++++++++-- net/ipv6/ndisc.c | 11 +++-- 3 files changed, 118 insertions(+), 10 deletions(-)
include/net/ndisc.h +5 -0
@@ -190,6 +190,11 @@ void ndisc_send_na(struct net_device *dev, struct neighbour *neigh,const struct in6_addr *daddr, const struct in6_addr *solicited_addr, bool router, bool solicited, bool override, bool inc_opt); +void ndisc_fill_addr_option (struct sk_buff *skb,int type,const void *data); +struct sk_buff *ndisc_alloc_skb (struct net_device *dev,int len); +void ndisc_send_skb (struct sk_buff *skb, +const struct in6_addr *daddr, +const struct in6_addr *saddr);void ndisc_send_redirect (struct sk_buff *skb,const struct in6_addr *target);
net/bridge/br_multicast.c +108 -4
138 lines not on this page · raw message
net/ipv6/ndisc.c +5 -6
@@ -148,7 +148,7 @@ struct neigh_table nd_tbl = { .gc_thresh3 = 1024, }; -static void ndisc_fill_addr_option (struct sk_buff *skb,int type,void *data) +void ndisc_fill_addr_option (struct sk_buff *skb,int type,const void *data) {int pad =ndisc_addr_option_pad (skb->dev->type);int data_len = skb->dev->addr_len;
@@ -375,8 +375,7 @@ static void pndisc_destructor(struct pneigh_entry *n)ipv6_dev_mc_dec (dev, &maddr); } -static struct sk_buff *ndisc_alloc_skb (struct net_device *dev, -int len) +struct sk_buff *ndisc_alloc_skb (struct net_device *dev,int len) {int hlen =LL_RESERVED_SPACE (dev);int tlen = dev->needed_tailroom;
@@ -425,9 +424,9 @@ static void ip6_nd_hdr(struct sk_buff *skb, hdr->daddr = *daddr; } -static void ndisc_send_skb (struct sk_buff *skb, -const struct in6_addr *daddr, -const struct in6_addr *saddr) +void ndisc_send_skb (struct sk_buff *skb, +const struct in6_addr *daddr, +const struct in6_addr *saddr) {struct dst_entry *dst =skb_dst (skb);struct net *net =dev_net (skb->dev);
Signature · 5 lines
1.9.1 -- Jouni Malinen PGP id EFC895FA