diff options
author | Marek Lindner <lindner_marek@yahoo.de> | 2011-12-04 15:01:51 -0500 |
---|---|---|
committer | Marek Lindner <lindner_marek@yahoo.de> | 2012-02-16 13:50:19 -0500 |
commit | 8780dad9e97f564da0eb3443009c3203122e7e7d (patch) | |
tree | 9c291c379f5d94793162e24b22452f9ffe5277a3 /net/batman-adv | |
parent | 76543d14aec6ce5cb3fc7be9b39c50fcebd2043b (diff) |
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')
-rw-r--r-- | net/batman-adv/bat_iv_ogm.c | 11 | ||||
-rw-r--r-- | net/batman-adv/bat_ogm.h | 3 | ||||
-rw-r--r-- | net/batman-adv/routing.c | 4 |
3 files changed, 9 insertions, 9 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: | |||
1140 | orig_node_free_ref(orig_node); | 1140 | orig_node_free_ref(orig_node); |
1141 | } | 1141 | } |
1142 | 1142 | ||
1143 | void bat_ogm_receive(const struct ethhdr *ethhdr, unsigned char *packet_buff, | 1143 | void bat_ogm_receive(struct hard_iface *if_incoming, struct sk_buff *skb) |
1144 | int packet_len, struct hard_iface *if_incoming) | ||
1145 | { | 1144 | { |
1146 | struct batman_ogm_packet *batman_ogm_packet; | 1145 | struct batman_ogm_packet *batman_ogm_packet; |
1147 | int buff_pos = 0; | 1146 | struct ethhdr *ethhdr; |
1148 | unsigned char *tt_buff; | 1147 | int buff_pos = 0, packet_len; |
1148 | unsigned char *tt_buff, *packet_buff; | ||
1149 | 1149 | ||
1150 | packet_len = skb_headlen(skb); | ||
1151 | ethhdr = (struct ethhdr *)skb_mac_header(skb); | ||
1152 | packet_buff = skb->data; | ||
1150 | batman_ogm_packet = (struct batman_ogm_packet *)packet_buff; | 1153 | batman_ogm_packet = (struct batman_ogm_packet *)packet_buff; |
1151 | 1154 | ||
1152 | /* unpack the aggregated packets and process them one by one */ | 1155 | /* unpack the aggregated packets and process them one by one */ |
diff --git a/net/batman-adv/bat_ogm.h b/net/batman-adv/bat_ogm.h index 69329c107e28..47edfde6f924 100644 --- a/net/batman-adv/bat_ogm.h +++ b/net/batman-adv/bat_ogm.h | |||
@@ -29,7 +29,6 @@ void bat_ogm_init_primary(struct hard_iface *hard_iface); | |||
29 | void bat_ogm_update_mac(struct hard_iface *hard_iface); | 29 | void bat_ogm_update_mac(struct hard_iface *hard_iface); |
30 | void bat_ogm_schedule(struct hard_iface *hard_iface, int tt_num_changes); | 30 | void bat_ogm_schedule(struct hard_iface *hard_iface, int tt_num_changes); |
31 | void bat_ogm_emit(struct forw_packet *forw_packet); | 31 | void bat_ogm_emit(struct forw_packet *forw_packet); |
32 | void bat_ogm_receive(const struct ethhdr *ethhdr, unsigned char *packet_buff, | 32 | void bat_ogm_receive(struct hard_iface *if_incoming, struct sk_buff *skb); |
33 | int packet_len, struct hard_iface *if_incoming); | ||
34 | 33 | ||
35 | #endif /* _NET_BATMAN_ADV_OGM_H_ */ | 34 | #endif /* _NET_BATMAN_ADV_OGM_H_ */ |
diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c index 4363d197aebc..5bc41c896e35 100644 --- a/net/batman-adv/routing.c +++ b/net/batman-adv/routing.c | |||
@@ -272,9 +272,7 @@ int recv_bat_ogm_packet(struct sk_buff *skb, struct hard_iface *hard_iface) | |||
272 | if (skb_linearize(skb) < 0) | 272 | if (skb_linearize(skb) < 0) |
273 | return NET_RX_DROP; | 273 | return NET_RX_DROP; |
274 | 274 | ||
275 | ethhdr = (struct ethhdr *)skb_mac_header(skb); | 275 | bat_ogm_receive(hard_iface, skb); |
276 | |||
277 | bat_ogm_receive(ethhdr, skb->data, skb_headlen(skb), hard_iface); | ||
278 | 276 | ||
279 | kfree_skb(skb); | 277 | kfree_skb(skb); |
280 | return NET_RX_SUCCESS; | 278 | return NET_RX_SUCCESS; |