diff options
author | Marek Lindner <lindner_marek@yahoo.de> | 2011-12-05 00:01:51 +0400 |
---|---|---|
committer | Marek Lindner <lindner_marek@yahoo.de> | 2012-02-16 22:50:19 +0400 |
commit | 8780dad9e97f564da0eb3443009c3203122e7e7d (patch) | |
tree | 9c291c379f5d94793162e24b22452f9ffe5277a3 /net/batman-adv/bat_iv_ogm.c | |
parent | 76543d14aec6ce5cb3fc7be9b39c50fcebd2043b (diff) | |
download | linux-8780dad9e97f564da0eb3443009c3203122e7e7d.tar.xz |
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: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Diffstat (limited to 'net/batman-adv/bat_iv_ogm.c')
-rw-r--r-- | net/batman-adv/bat_iv_ogm.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c index d60e1ba0bc15..3402fa575b47 100644 --- a/net/batman-adv/bat_iv_ogm.c +++ b/net/batman-adv/bat_iv_ogm.c @@ -1140,13 +1140,16 @@ out: orig_node_free_ref(orig_node); } -void bat_ogm_receive(const struct ethhdr *ethhdr, unsigned char *packet_buff, - int packet_len, struct hard_iface *if_incoming) +void bat_ogm_receive(struct hard_iface *if_incoming, struct sk_buff *skb) { struct batman_ogm_packet *batman_ogm_packet; - int buff_pos = 0; - unsigned char *tt_buff; + struct ethhdr *ethhdr; + 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; /* unpack the aggregated packets and process them one by one */ |