Commit 8780dad9 authored by Marek Lindner's avatar Marek Lindner

batman-adv: simplify bat_ogm_receive API call

Most of the values in that call are derived from the skb, so we can hand
over the skb instead.
Reported-by: default avatarSimon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: default avatarMarek Lindner <lindner_marek@yahoo.de>
parent 76543d14
...@@ -1140,13 +1140,16 @@ static void bat_ogm_process(const struct ethhdr *ethhdr, ...@@ -1140,13 +1140,16 @@ static void bat_ogm_process(const struct ethhdr *ethhdr,
orig_node_free_ref(orig_node); orig_node_free_ref(orig_node);
} }
void bat_ogm_receive(const struct ethhdr *ethhdr, unsigned char *packet_buff, void bat_ogm_receive(struct hard_iface *if_incoming, struct sk_buff *skb)
int packet_len, struct hard_iface *if_incoming)
{ {
struct batman_ogm_packet *batman_ogm_packet; struct batman_ogm_packet *batman_ogm_packet;
int buff_pos = 0; struct ethhdr *ethhdr;
unsigned char *tt_buff; int buff_pos = 0, packet_len;
unsigned char *tt_buff, *packet_buff;
packet_len = skb_headlen(skb);
ethhdr = (struct ethhdr *)skb_mac_header(skb);
packet_buff = skb->data;
batman_ogm_packet = (struct batman_ogm_packet *)packet_buff; batman_ogm_packet = (struct batman_ogm_packet *)packet_buff;
/* unpack the aggregated packets and process them one by one */ /* unpack the aggregated packets and process them one by one */
......
...@@ -29,7 +29,6 @@ void bat_ogm_init_primary(struct hard_iface *hard_iface); ...@@ -29,7 +29,6 @@ void bat_ogm_init_primary(struct hard_iface *hard_iface);
void bat_ogm_update_mac(struct hard_iface *hard_iface); void bat_ogm_update_mac(struct hard_iface *hard_iface);
void bat_ogm_schedule(struct hard_iface *hard_iface, int tt_num_changes); void bat_ogm_schedule(struct hard_iface *hard_iface, int tt_num_changes);
void bat_ogm_emit(struct forw_packet *forw_packet); void bat_ogm_emit(struct forw_packet *forw_packet);
void bat_ogm_receive(const struct ethhdr *ethhdr, unsigned char *packet_buff, void bat_ogm_receive(struct hard_iface *if_incoming, struct sk_buff *skb);
int packet_len, struct hard_iface *if_incoming);
#endif /* _NET_BATMAN_ADV_OGM_H_ */ #endif /* _NET_BATMAN_ADV_OGM_H_ */
...@@ -272,9 +272,7 @@ int recv_bat_ogm_packet(struct sk_buff *skb, struct hard_iface *hard_iface) ...@@ -272,9 +272,7 @@ int recv_bat_ogm_packet(struct sk_buff *skb, struct hard_iface *hard_iface)
if (skb_linearize(skb) < 0) if (skb_linearize(skb) < 0)
return NET_RX_DROP; return NET_RX_DROP;
ethhdr = (struct ethhdr *)skb_mac_header(skb); bat_ogm_receive(hard_iface, skb);
bat_ogm_receive(ethhdr, skb->data, skb_headlen(skb), hard_iface);
kfree_skb(skb); kfree_skb(skb);
return NET_RX_SUCCESS; return NET_RX_SUCCESS;
......
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