Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 300805
b: refs/heads/master
c: 00a5007
h: refs/heads/master
i:
  300803: 4e78ff0
v: v3
  • Loading branch information
Marek Lindner authored and Antonio Quartulli committed Apr 18, 2012
1 parent e4b570a commit ece0521
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d7d32ec0f199cc00a43434cdd920338763fab2e0
refs/heads/master: 00a50076a3afa4014cdd57e87e31a00ce4c4b67e
7 changes: 7 additions & 0 deletions trunk/net/batman-adv/bat_iv_ogm.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ static void bat_iv_ogm_iface_enable(struct hard_iface *hard_iface)
batman_ogm_packet->ttvn = 0;
}

static void bat_iv_ogm_iface_disable(struct hard_iface *hard_iface)
{
kfree(hard_iface->packet_buff);
hard_iface->packet_buff = NULL;
}

static void bat_iv_ogm_init_primary(struct hard_iface *hard_iface)
{
struct batman_ogm_packet *batman_ogm_packet;
Expand Down Expand Up @@ -1175,6 +1181,7 @@ static void bat_iv_ogm_receive(struct hard_iface *if_incoming,
static struct bat_algo_ops batman_iv __read_mostly = {
.name = "BATMAN IV",
.bat_iface_enable = bat_iv_ogm_iface_enable,
.bat_iface_disable = bat_iv_ogm_iface_disable,
.bat_ogm_init_primary = bat_iv_ogm_init_primary,
.bat_ogm_update_mac = bat_iv_ogm_update_mac,
.bat_ogm_schedule = bat_iv_ogm_schedule,
Expand Down
3 changes: 1 addition & 2 deletions trunk/net/batman-adv/hard-interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -397,8 +397,7 @@ void hardif_disable_interface(struct hard_iface *hard_iface)
hardif_free_ref(new_if);
}

kfree(hard_iface->packet_buff);
hard_iface->packet_buff = NULL;
bat_priv->bat_algo_ops->bat_iface_disable(hard_iface);
hard_iface->if_status = IF_NOT_IN_USE;

/* delete all references to this hard_iface */
Expand Down
1 change: 1 addition & 0 deletions trunk/net/batman-adv/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ int bat_algo_register(struct bat_algo_ops *bat_algo_ops)

/* all algorithms must implement all ops (for now) */
if (!bat_algo_ops->bat_iface_enable ||
!bat_algo_ops->bat_iface_disable ||
!bat_algo_ops->bat_ogm_init_primary ||
!bat_algo_ops->bat_ogm_update_mac ||
!bat_algo_ops->bat_ogm_schedule ||
Expand Down
2 changes: 2 additions & 0 deletions trunk/net/batman-adv/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,8 @@ struct bat_algo_ops {
char *name;
/* init routing info when hard-interface is enabled */
void (*bat_iface_enable)(struct hard_iface *hard_iface);
/* de-init routing info when hard-interface is disabled */
void (*bat_iface_disable)(struct hard_iface *hard_iface);
/* init primary OGM when primary interface is selected */
void (*bat_ogm_init_primary)(struct hard_iface *hard_iface);
/* init mac addresses of the OGM belonging to this hard-interface */
Expand Down

0 comments on commit ece0521

Please sign in to comment.