Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 219904
b: refs/heads/master
c: 037dafa
h: refs/heads/master
v: v3
  • Loading branch information
Marek Lindner authored and Greg Kroah-Hartman committed Sep 20, 2010
1 parent 6154a6d commit f18be88
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 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: 7e8158b341b2b043047b6f570c343fd9b0efd9c9
refs/heads/master: 037dafa8673dbe71c64be7d1021b85c6692a6f7d
22 changes: 14 additions & 8 deletions trunk/drivers/staging/batman-adv/hard-interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,22 @@ static struct batman_if *get_active_batman_if(struct net_device *soft_iface)
return batman_if;
}

static void update_primary_addr(struct bat_priv *bat_priv)
{
struct vis_packet *vis_packet;

vis_packet = (struct vis_packet *)
bat_priv->my_vis_info->skb_packet->data;
memcpy(vis_packet->vis_orig,
bat_priv->primary_if->net_dev->dev_addr, ETH_ALEN);
memcpy(vis_packet->sender_orig,
bat_priv->primary_if->net_dev->dev_addr, ETH_ALEN);
}

static void set_primary_if(struct bat_priv *bat_priv,
struct batman_if *batman_if)
{
struct batman_packet *batman_packet;
struct vis_packet *vis_packet;
struct batman_if *old_if;

if (batman_if)
Expand All @@ -129,12 +140,7 @@ static void set_primary_if(struct bat_priv *bat_priv,
batman_packet->flags = PRIMARIES_FIRST_HOP;
batman_packet->ttl = TTL;

vis_packet = (struct vis_packet *)
bat_priv->my_vis_info->skb_packet->data;
memcpy(vis_packet->vis_orig,
bat_priv->primary_if->net_dev->dev_addr, ETH_ALEN);
memcpy(vis_packet->sender_orig,
bat_priv->primary_if->net_dev->dev_addr, ETH_ALEN);
update_primary_addr(bat_priv);

/***
* hacky trick to make sure that we send the HNA information via
Expand Down Expand Up @@ -516,7 +522,7 @@ static int hard_if_event(struct notifier_block *this,

bat_priv = netdev_priv(batman_if->soft_iface);
if (batman_if == bat_priv->primary_if)
set_primary_if(bat_priv, batman_if);
update_primary_addr(bat_priv);
break;
default:
break;
Expand Down

0 comments on commit f18be88

Please sign in to comment.