Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 186803
b: refs/heads/master
c: eb50081
h: refs/heads/master
i:
  186801: 72e23f0
  186799: 7ccd547
v: v3
  • Loading branch information
Simon Wunderlich authored and Greg Kroah-Hartman committed Mar 4, 2010
1 parent 6f1a642 commit 5e9aadd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 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: 0fce64362d4f2144586e3ffcff6f259bf8abc2f8
refs/heads/master: eb50081d8fb76d5de9d65628d7f41977ece7044b
13 changes: 10 additions & 3 deletions trunk/drivers/staging/batman-adv/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "send.h"
#include "types.h"
#include "hash.h"
#include "hard-interface.h"

static struct class *batman_class;

Expand Down Expand Up @@ -206,6 +207,7 @@ ssize_t bat_device_write(struct file *file, const char __user *buff,
struct icmp_packet icmp_packet;
struct orig_node *orig_node;
struct batman_if *batman_if;
uint8_t dstaddr[ETH_ALEN];
unsigned long flags;

if (len < sizeof(struct icmp_packet)) {
Expand Down Expand Up @@ -251,19 +253,24 @@ ssize_t bat_device_write(struct file *file, const char __user *buff,
goto unlock;

batman_if = orig_node->batman_if;
memcpy(dstaddr, orig_node->router->addr, ETH_ALEN);

spin_unlock_irqrestore(&orig_hash_lock, flags);

if (!batman_if)
goto unlock;
goto dst_unreach;

if (batman_if->if_active != IF_ACTIVE)
goto dst_unreach;

memcpy(icmp_packet.orig,
batman_if->net_dev->dev_addr,
ETH_ALEN);

send_raw_packet((unsigned char *)&icmp_packet,
sizeof(struct icmp_packet),
batman_if, orig_node->router->addr);
batman_if, dstaddr);

spin_unlock_irqrestore(&orig_hash_lock, flags);
goto out;

unlock:
Expand Down

0 comments on commit 5e9aadd

Please sign in to comment.