Skip to content

Commit 24e5992

Browse files
gfreewinddavem330
authored andcommitted
ipvlan: Eliminate duplicated codes with existing function
The recv flow of ipvlan l2 mode performs as same as l3 mode for non-multicast packet, so use the existing func ipvlan_handle_mode_l3 instead of these duplicated statements in non-multicast case. Signed-off-by: Gao Feng <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 9454d93 commit 24e5992

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

drivers/net/ipvlan/ipvlan_core.c

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -664,8 +664,6 @@ static rx_handler_result_t ipvlan_handle_mode_l2(struct sk_buff **pskb,
664664
struct sk_buff *skb = *pskb;
665665
struct ethhdr *eth = eth_hdr(skb);
666666
rx_handler_result_t ret = RX_HANDLER_PASS;
667-
void *lyr3h;
668-
int addr_type;
669667

670668
if (is_multicast_ether_addr(eth->h_dest)) {
671669
if (ipvlan_external_frame(skb, port)) {
@@ -683,15 +681,8 @@ static rx_handler_result_t ipvlan_handle_mode_l2(struct sk_buff **pskb,
683681
}
684682
}
685683
} else {
686-
struct ipvl_addr *addr;
687-
688-
lyr3h = ipvlan_get_L3_hdr(port, skb, &addr_type);
689-
if (!lyr3h)
690-
return ret;
691-
692-
addr = ipvlan_addr_lookup(port, lyr3h, addr_type, true);
693-
if (addr)
694-
ret = ipvlan_rcv_frame(addr, pskb, false);
684+
/* Perform like l3 mode for non-multicast packet */
685+
ret = ipvlan_handle_mode_l3(pskb, port);
695686
}
696687

697688
return ret;

0 commit comments

Comments
 (0)