Commit a37c5c26 authored by Kangmin Park's avatar Kangmin Park Committed by Jakub Kicinski

net: bridge: change return type of br_handle_ingress_vlan_tunnel

br_handle_ingress_vlan_tunnel() is only referenced in
br_handle_frame(). If br_handle_ingress_vlan_tunnel() is called and
return non-zero value, goto drop in br_handle_frame().

But, br_handle_ingress_vlan_tunnel() always return 0. So, the
routines that check the return value and goto drop has no meaning.

Therefore, change return type of br_handle_ingress_vlan_tunnel() to
void and remove if statement of br_handle_frame().
Signed-off-by: default avatarKangmin Park <l4stpr0gr4m@gmail.com>
Acked-by: default avatarNikolay Aleksandrov <nikolay@nvidia.com>
Link: https://lore.kernel.org/r/20210823102118.17966-1-l4stpr0gr4m@gmail.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 7844ec21
...@@ -294,11 +294,8 @@ static rx_handler_result_t br_handle_frame(struct sk_buff **pskb) ...@@ -294,11 +294,8 @@ static rx_handler_result_t br_handle_frame(struct sk_buff **pskb)
memset(skb->cb, 0, sizeof(struct br_input_skb_cb)); memset(skb->cb, 0, sizeof(struct br_input_skb_cb));
p = br_port_get_rcu(skb->dev); p = br_port_get_rcu(skb->dev);
if (p->flags & BR_VLAN_TUNNEL) { if (p->flags & BR_VLAN_TUNNEL)
if (br_handle_ingress_vlan_tunnel(skb, p, br_handle_ingress_vlan_tunnel(skb, p, nbp_vlan_group_rcu(p));
nbp_vlan_group_rcu(p)))
goto drop;
}
if (unlikely(is_link_local_ether_addr(dest))) { if (unlikely(is_link_local_ether_addr(dest))) {
u16 fwd_mask = p->br->group_fwd_mask_required; u16 fwd_mask = p->br->group_fwd_mask_required;
......
...@@ -38,7 +38,7 @@ int nbp_vlan_tunnel_info_add(const struct net_bridge_port *port, u16 vid, ...@@ -38,7 +38,7 @@ int nbp_vlan_tunnel_info_add(const struct net_bridge_port *port, u16 vid,
void nbp_vlan_tunnel_info_flush(struct net_bridge_port *port); void nbp_vlan_tunnel_info_flush(struct net_bridge_port *port);
void vlan_tunnel_info_del(struct net_bridge_vlan_group *vg, void vlan_tunnel_info_del(struct net_bridge_vlan_group *vg,
struct net_bridge_vlan *vlan); struct net_bridge_vlan *vlan);
int br_handle_ingress_vlan_tunnel(struct sk_buff *skb, void br_handle_ingress_vlan_tunnel(struct sk_buff *skb,
struct net_bridge_port *p, struct net_bridge_port *p,
struct net_bridge_vlan_group *vg); struct net_bridge_vlan_group *vg);
int br_handle_egress_vlan_tunnel(struct sk_buff *skb, int br_handle_egress_vlan_tunnel(struct sk_buff *skb,
......
...@@ -158,7 +158,7 @@ void vlan_tunnel_deinit(struct net_bridge_vlan_group *vg) ...@@ -158,7 +158,7 @@ void vlan_tunnel_deinit(struct net_bridge_vlan_group *vg)
rhashtable_destroy(&vg->tunnel_hash); rhashtable_destroy(&vg->tunnel_hash);
} }
int br_handle_ingress_vlan_tunnel(struct sk_buff *skb, void br_handle_ingress_vlan_tunnel(struct sk_buff *skb,
struct net_bridge_port *p, struct net_bridge_port *p,
struct net_bridge_vlan_group *vg) struct net_bridge_vlan_group *vg)
{ {
...@@ -166,22 +166,20 @@ int br_handle_ingress_vlan_tunnel(struct sk_buff *skb, ...@@ -166,22 +166,20 @@ int br_handle_ingress_vlan_tunnel(struct sk_buff *skb,
struct net_bridge_vlan *vlan; struct net_bridge_vlan *vlan;
if (!vg || !tinfo) if (!vg || !tinfo)
return 0; return;
/* if already tagged, ignore */ /* if already tagged, ignore */
if (skb_vlan_tagged(skb)) if (skb_vlan_tagged(skb))
return 0; return;
/* lookup vid, given tunnel id */ /* lookup vid, given tunnel id */
vlan = br_vlan_tunnel_lookup(&vg->tunnel_hash, tinfo->key.tun_id); vlan = br_vlan_tunnel_lookup(&vg->tunnel_hash, tinfo->key.tun_id);
if (!vlan) if (!vlan)
return 0; return;
skb_dst_drop(skb); skb_dst_drop(skb);
__vlan_hwaccel_put_tag(skb, p->br->vlan_proto, vlan->vid); __vlan_hwaccel_put_tag(skb, p->br->vlan_proto, vlan->vid);
return 0;
} }
int br_handle_egress_vlan_tunnel(struct sk_buff *skb, int br_handle_egress_vlan_tunnel(struct sk_buff *skb,
......
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