@@ -1124,7 +1124,7 @@ static int check_unicast_packet(struct sk_buff *skb, int hdr_size)
/* not for me */
if (!is_my_mac(ethhdr->h_dest))
- return -1;
+ return 1;
return 0;
}
@@ -1214,8 +1214,10 @@ int recv_unicast_packet(struct sk_buff *skb, struct batman_if *recv_if)
{
struct unicast_packet *unicast_packet;
int hdr_size = sizeof(struct unicast_packet);
+ int check_ret;
- if (check_unicast_packet(skb, hdr_size) < 0)
+ check_ret = check_unicast_packet(skb, hdr_size);
+ if (check_ret < 0)
return NET_RX_DROP;
unicast_packet = (struct unicast_packet *)skb->data;
@@ -1226,6 +1228,9 @@ int recv_unicast_packet(struct sk_buff *skb, struct batman_if *recv_if)
return NET_RX_SUCCESS;
}
+ if (check_ret)
+ return NET_RX_DROP;
+
return route_unicast_packet(skb, recv_if, hdr_size);
}
@@ -1235,9 +1240,10 @@ int recv_ucast_frag_packet(struct sk_buff *skb, struct batman_if *recv_if)
struct unicast_frag_packet *unicast_packet;
int hdr_size = sizeof(struct unicast_frag_packet);
struct sk_buff *new_skb = NULL;
- int ret;
+ int ret, check_ret;
- if (check_unicast_packet(skb, hdr_size) < 0)
+ check_ret = check_unicast_packet(skb, hdr_size);
+ if (check_ret < 0)
return NET_RX_DROP;
unicast_packet = (struct unicast_frag_packet *)skb->data;
@@ -1259,6 +1265,9 @@ int recv_ucast_frag_packet(struct sk_buff *skb, struct batman_if *recv_if)
return NET_RX_SUCCESS;
}
+ if (check_ret)
+ return NET_RX_DROP;
+
return route_unicast_packet(skb, recv_if, hdr_size);
}