Commit eab3227b authored by Nikolay Aleksandrov's avatar Nikolay Aleksandrov Committed by David S. Miller

net: bridge: mcast: rename br_ip's u member to dst

Since now we have src in br_ip, u no longer makes sense so rename
it to dst. No functional changes.

v2: fix build with CONFIG_BATMAN_ADV_MCAST

CC: Marek Lindner <mareklindner@neomailbox.ch>
CC: Simon Wunderlich <sw@simonwunderlich.de>
CC: Antonio Quartulli <a@unstable.cc>
CC: Sven Eckelmann <sven@narfation.org>
CC: b.a.t.m.a.n@lists.open-mesh.org
Signed-off-by: default avatarNikolay Aleksandrov <nikolay@nvidia.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent deb96566
...@@ -25,7 +25,7 @@ struct br_ip { ...@@ -25,7 +25,7 @@ struct br_ip {
#if IS_ENABLED(CONFIG_IPV6) #if IS_ENABLED(CONFIG_IPV6)
struct in6_addr ip6; struct in6_addr ip6;
#endif #endif
} u; } dst;
__be16 proto; __be16 proto;
__u16 vid; __u16 vid;
}; };
......
...@@ -221,7 +221,7 @@ static u8 batadv_mcast_mla_rtr_flags_bridge_get(struct batadv_priv *bat_priv, ...@@ -221,7 +221,7 @@ static u8 batadv_mcast_mla_rtr_flags_bridge_get(struct batadv_priv *bat_priv,
* address here, only IPv6 ones * address here, only IPv6 ones
*/ */
if (br_ip_entry->addr.proto == htons(ETH_P_IPV6) && if (br_ip_entry->addr.proto == htons(ETH_P_IPV6) &&
ipv6_addr_is_ll_all_routers(&br_ip_entry->addr.u.ip6)) ipv6_addr_is_ll_all_routers(&br_ip_entry->addr.dst.ip6))
flags &= ~BATADV_MCAST_WANT_NO_RTR6; flags &= ~BATADV_MCAST_WANT_NO_RTR6;
list_del(&br_ip_entry->list); list_del(&br_ip_entry->list);
...@@ -562,10 +562,10 @@ batadv_mcast_mla_softif_get(struct net_device *dev, ...@@ -562,10 +562,10 @@ batadv_mcast_mla_softif_get(struct net_device *dev,
static void batadv_mcast_mla_br_addr_cpy(char *dst, const struct br_ip *src) static void batadv_mcast_mla_br_addr_cpy(char *dst, const struct br_ip *src)
{ {
if (src->proto == htons(ETH_P_IP)) if (src->proto == htons(ETH_P_IP))
ip_eth_mc_map(src->u.ip4, dst); ip_eth_mc_map(src->dst.ip4, dst);
#if IS_ENABLED(CONFIG_IPV6) #if IS_ENABLED(CONFIG_IPV6)
else if (src->proto == htons(ETH_P_IPV6)) else if (src->proto == htons(ETH_P_IPV6))
ipv6_eth_mc_map(&src->u.ip6, dst); ipv6_eth_mc_map(&src->dst.ip6, dst);
#endif #endif
else else
eth_zero_addr(dst); eth_zero_addr(dst);
...@@ -609,11 +609,11 @@ static int batadv_mcast_mla_bridge_get(struct net_device *dev, ...@@ -609,11 +609,11 @@ static int batadv_mcast_mla_bridge_get(struct net_device *dev,
continue; continue;
if (tvlv_flags & BATADV_MCAST_WANT_ALL_UNSNOOPABLES && if (tvlv_flags & BATADV_MCAST_WANT_ALL_UNSNOOPABLES &&
ipv4_is_local_multicast(br_ip_entry->addr.u.ip4)) ipv4_is_local_multicast(br_ip_entry->addr.dst.ip4))
continue; continue;
if (!(tvlv_flags & BATADV_MCAST_WANT_NO_RTR4) && if (!(tvlv_flags & BATADV_MCAST_WANT_NO_RTR4) &&
!ipv4_is_local_multicast(br_ip_entry->addr.u.ip4)) !ipv4_is_local_multicast(br_ip_entry->addr.dst.ip4))
continue; continue;
} }
...@@ -623,11 +623,11 @@ static int batadv_mcast_mla_bridge_get(struct net_device *dev, ...@@ -623,11 +623,11 @@ static int batadv_mcast_mla_bridge_get(struct net_device *dev,
continue; continue;
if (tvlv_flags & BATADV_MCAST_WANT_ALL_UNSNOOPABLES && if (tvlv_flags & BATADV_MCAST_WANT_ALL_UNSNOOPABLES &&
ipv6_addr_is_ll_all_nodes(&br_ip_entry->addr.u.ip6)) ipv6_addr_is_ll_all_nodes(&br_ip_entry->addr.dst.ip6))
continue; continue;
if (!(tvlv_flags & BATADV_MCAST_WANT_NO_RTR6) && if (!(tvlv_flags & BATADV_MCAST_WANT_NO_RTR6) &&
IPV6_ADDR_MC_SCOPE(&br_ip_entry->addr.u.ip6) > IPV6_ADDR_MC_SCOPE(&br_ip_entry->addr.dst.ip6) >
IPV6_ADDR_SCOPE_LINKLOCAL) IPV6_ADDR_SCOPE_LINKLOCAL)
continue; continue;
} }
......
...@@ -70,10 +70,10 @@ static void __mdb_entry_to_br_ip(struct br_mdb_entry *entry, struct br_ip *ip) ...@@ -70,10 +70,10 @@ static void __mdb_entry_to_br_ip(struct br_mdb_entry *entry, struct br_ip *ip)
ip->vid = entry->vid; ip->vid = entry->vid;
ip->proto = entry->addr.proto; ip->proto = entry->addr.proto;
if (ip->proto == htons(ETH_P_IP)) if (ip->proto == htons(ETH_P_IP))
ip->u.ip4 = entry->addr.u.ip4; ip->dst.ip4 = entry->addr.u.ip4;
#if IS_ENABLED(CONFIG_IPV6) #if IS_ENABLED(CONFIG_IPV6)
else else
ip->u.ip6 = entry->addr.u.ip6; ip->dst.ip6 = entry->addr.u.ip6;
#endif #endif
} }
...@@ -158,10 +158,10 @@ static int __mdb_fill_info(struct sk_buff *skb, ...@@ -158,10 +158,10 @@ static int __mdb_fill_info(struct sk_buff *skb,
e.ifindex = ifindex; e.ifindex = ifindex;
e.vid = mp->addr.vid; e.vid = mp->addr.vid;
if (mp->addr.proto == htons(ETH_P_IP)) if (mp->addr.proto == htons(ETH_P_IP))
e.addr.u.ip4 = mp->addr.u.ip4; e.addr.u.ip4 = mp->addr.dst.ip4;
#if IS_ENABLED(CONFIG_IPV6) #if IS_ENABLED(CONFIG_IPV6)
if (mp->addr.proto == htons(ETH_P_IPV6)) if (mp->addr.proto == htons(ETH_P_IPV6))
e.addr.u.ip6 = mp->addr.u.ip6; e.addr.u.ip6 = mp->addr.dst.ip6;
#endif #endif
e.addr.proto = mp->addr.proto; e.addr.proto = mp->addr.proto;
nest_ent = nla_nest_start_noflag(skb, nest_ent = nla_nest_start_noflag(skb,
...@@ -474,10 +474,10 @@ static void br_mdb_switchdev_host_port(struct net_device *dev, ...@@ -474,10 +474,10 @@ static void br_mdb_switchdev_host_port(struct net_device *dev,
}; };
if (mp->addr.proto == htons(ETH_P_IP)) if (mp->addr.proto == htons(ETH_P_IP))
ip_eth_mc_map(mp->addr.u.ip4, mdb.addr); ip_eth_mc_map(mp->addr.dst.ip4, mdb.addr);
#if IS_ENABLED(CONFIG_IPV6) #if IS_ENABLED(CONFIG_IPV6)
else else
ipv6_eth_mc_map(&mp->addr.u.ip6, mdb.addr); ipv6_eth_mc_map(&mp->addr.dst.ip6, mdb.addr);
#endif #endif
mdb.obj.orig_dev = dev; mdb.obj.orig_dev = dev;
...@@ -520,10 +520,10 @@ void br_mdb_notify(struct net_device *dev, ...@@ -520,10 +520,10 @@ void br_mdb_notify(struct net_device *dev,
if (pg) { if (pg) {
if (mp->addr.proto == htons(ETH_P_IP)) if (mp->addr.proto == htons(ETH_P_IP))
ip_eth_mc_map(mp->addr.u.ip4, mdb.addr); ip_eth_mc_map(mp->addr.dst.ip4, mdb.addr);
#if IS_ENABLED(CONFIG_IPV6) #if IS_ENABLED(CONFIG_IPV6)
else else
ipv6_eth_mc_map(&mp->addr.u.ip6, mdb.addr); ipv6_eth_mc_map(&mp->addr.dst.ip6, mdb.addr);
#endif #endif
mdb.obj.orig_dev = pg->port->dev; mdb.obj.orig_dev = pg->port->dev;
switch (type) { switch (type) {
......
...@@ -86,7 +86,7 @@ static struct net_bridge_mdb_entry *br_mdb_ip4_get(struct net_bridge *br, ...@@ -86,7 +86,7 @@ static struct net_bridge_mdb_entry *br_mdb_ip4_get(struct net_bridge *br,
struct br_ip br_dst; struct br_ip br_dst;
memset(&br_dst, 0, sizeof(br_dst)); memset(&br_dst, 0, sizeof(br_dst));
br_dst.u.ip4 = dst; br_dst.dst.ip4 = dst;
br_dst.proto = htons(ETH_P_IP); br_dst.proto = htons(ETH_P_IP);
br_dst.vid = vid; br_dst.vid = vid;
...@@ -101,7 +101,7 @@ static struct net_bridge_mdb_entry *br_mdb_ip6_get(struct net_bridge *br, ...@@ -101,7 +101,7 @@ static struct net_bridge_mdb_entry *br_mdb_ip6_get(struct net_bridge *br,
struct br_ip br_dst; struct br_ip br_dst;
memset(&br_dst, 0, sizeof(br_dst)); memset(&br_dst, 0, sizeof(br_dst));
br_dst.u.ip6 = *dst; br_dst.dst.ip6 = *dst;
br_dst.proto = htons(ETH_P_IPV6); br_dst.proto = htons(ETH_P_IPV6);
br_dst.vid = vid; br_dst.vid = vid;
...@@ -126,11 +126,11 @@ struct net_bridge_mdb_entry *br_mdb_get(struct net_bridge *br, ...@@ -126,11 +126,11 @@ struct net_bridge_mdb_entry *br_mdb_get(struct net_bridge *br,
switch (skb->protocol) { switch (skb->protocol) {
case htons(ETH_P_IP): case htons(ETH_P_IP):
ip.u.ip4 = ip_hdr(skb)->daddr; ip.dst.ip4 = ip_hdr(skb)->daddr;
break; break;
#if IS_ENABLED(CONFIG_IPV6) #if IS_ENABLED(CONFIG_IPV6)
case htons(ETH_P_IPV6): case htons(ETH_P_IPV6):
ip.u.ip6 = ipv6_hdr(skb)->daddr; ip.dst.ip6 = ipv6_hdr(skb)->daddr;
break; break;
#endif #endif
default: default:
...@@ -625,9 +625,9 @@ static struct sk_buff *br_multicast_alloc_query(struct net_bridge *br, ...@@ -625,9 +625,9 @@ static struct sk_buff *br_multicast_alloc_query(struct net_bridge *br,
switch (group->proto) { switch (group->proto) {
case htons(ETH_P_IP): case htons(ETH_P_IP):
ip4_dst = ip_dst ? ip_dst->u.ip4 : htonl(INADDR_ALLHOSTS_GROUP); ip4_dst = ip_dst ? ip_dst->dst.ip4 : htonl(INADDR_ALLHOSTS_GROUP);
return br_ip4_multicast_alloc_query(br, pg, return br_ip4_multicast_alloc_query(br, pg,
ip4_dst, group->u.ip4, ip4_dst, group->dst.ip4,
with_srcs, over_lmqt, with_srcs, over_lmqt,
sflag, igmp_type, sflag, igmp_type,
need_rexmit); need_rexmit);
...@@ -636,13 +636,13 @@ static struct sk_buff *br_multicast_alloc_query(struct net_bridge *br, ...@@ -636,13 +636,13 @@ static struct sk_buff *br_multicast_alloc_query(struct net_bridge *br,
struct in6_addr ip6_dst; struct in6_addr ip6_dst;
if (ip_dst) if (ip_dst)
ip6_dst = ip_dst->u.ip6; ip6_dst = ip_dst->dst.ip6;
else else
ipv6_addr_set(&ip6_dst, htonl(0xff020000), 0, 0, ipv6_addr_set(&ip6_dst, htonl(0xff020000), 0, 0,
htonl(1)); htonl(1));
return br_ip6_multicast_alloc_query(br, pg, return br_ip6_multicast_alloc_query(br, pg,
&ip6_dst, &group->u.ip6, &ip6_dst, &group->dst.ip6,
with_srcs, over_lmqt, with_srcs, over_lmqt,
sflag, igmp_type, sflag, igmp_type,
need_rexmit); need_rexmit);
...@@ -906,7 +906,7 @@ static int br_ip4_multicast_add_group(struct net_bridge *br, ...@@ -906,7 +906,7 @@ static int br_ip4_multicast_add_group(struct net_bridge *br,
return 0; return 0;
memset(&br_group, 0, sizeof(br_group)); memset(&br_group, 0, sizeof(br_group));
br_group.u.ip4 = group; br_group.dst.ip4 = group;
br_group.proto = htons(ETH_P_IP); br_group.proto = htons(ETH_P_IP);
br_group.vid = vid; br_group.vid = vid;
filter_mode = igmpv2 ? MCAST_EXCLUDE : MCAST_INCLUDE; filter_mode = igmpv2 ? MCAST_EXCLUDE : MCAST_INCLUDE;
...@@ -930,7 +930,7 @@ static int br_ip6_multicast_add_group(struct net_bridge *br, ...@@ -930,7 +930,7 @@ static int br_ip6_multicast_add_group(struct net_bridge *br,
return 0; return 0;
memset(&br_group, 0, sizeof(br_group)); memset(&br_group, 0, sizeof(br_group));
br_group.u.ip6 = *group; br_group.dst.ip6 = *group;
br_group.proto = htons(ETH_P_IPV6); br_group.proto = htons(ETH_P_IPV6);
br_group.vid = vid; br_group.vid = vid;
filter_mode = mldv1 ? MCAST_EXCLUDE : MCAST_INCLUDE; filter_mode = mldv1 ? MCAST_EXCLUDE : MCAST_INCLUDE;
...@@ -1079,7 +1079,7 @@ static void br_multicast_send_query(struct net_bridge *br, ...@@ -1079,7 +1079,7 @@ static void br_multicast_send_query(struct net_bridge *br,
!br_opt_get(br, BROPT_MULTICAST_QUERIER)) !br_opt_get(br, BROPT_MULTICAST_QUERIER))
return; return;
memset(&br_group.u, 0, sizeof(br_group.u)); memset(&br_group.dst, 0, sizeof(br_group.dst));
if (port ? (own_query == &port->ip4_own_query) : if (port ? (own_query == &port->ip4_own_query) :
(own_query == &br->ip4_own_query)) { (own_query == &br->ip4_own_query)) {
...@@ -2506,7 +2506,7 @@ static void br_ip4_multicast_leave_group(struct net_bridge *br, ...@@ -2506,7 +2506,7 @@ static void br_ip4_multicast_leave_group(struct net_bridge *br,
own_query = port ? &port->ip4_own_query : &br->ip4_own_query; own_query = port ? &port->ip4_own_query : &br->ip4_own_query;
memset(&br_group, 0, sizeof(br_group)); memset(&br_group, 0, sizeof(br_group));
br_group.u.ip4 = group; br_group.dst.ip4 = group;
br_group.proto = htons(ETH_P_IP); br_group.proto = htons(ETH_P_IP);
br_group.vid = vid; br_group.vid = vid;
...@@ -2530,7 +2530,7 @@ static void br_ip6_multicast_leave_group(struct net_bridge *br, ...@@ -2530,7 +2530,7 @@ static void br_ip6_multicast_leave_group(struct net_bridge *br,
own_query = port ? &port->ip6_own_query : &br->ip6_own_query; own_query = port ? &port->ip6_own_query : &br->ip6_own_query;
memset(&br_group, 0, sizeof(br_group)); memset(&br_group, 0, sizeof(br_group));
br_group.u.ip6 = *group; br_group.dst.ip6 = *group;
br_group.proto = htons(ETH_P_IPV6); br_group.proto = htons(ETH_P_IPV6);
br_group.vid = vid; br_group.vid = vid;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment