diff options
author | Marek Lindner <lindner_marek@yahoo.de> | 2010-11-22 00:56:03 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-11-29 11:09:13 -0800 |
commit | 6c3a42db6ca46204b35f0cdb8abfa9e4771641ef (patch) | |
tree | 52cc96334f08fd5ee8874bfedffe9e6c7e1f4ac2 /drivers/staging/batman-adv/unicast.c | |
parent | dfaf9dd3459cac02411cebf418e8469aa0d8ca5d (diff) | |
download | op-kernel-dev-6c3a42db6ca46204b35f0cdb8abfa9e4771641ef.zip op-kernel-dev-6c3a42db6ca46204b35f0cdb8abfa9e4771641ef.tar.gz |
Staging: batman-adv: send DHCP requests directly to the chosen gw
If the gateway client mode is active batman-adv will send the
broadcasted DHCP requests via unicast to the currently selected best
gateway. Therefore attached clients can profit from batman's knowledge
about the network topology.
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
[sven.eckelmann@gmx.de: Rework on top of current version]
Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/batman-adv/unicast.c')
-rw-r--r-- | drivers/staging/batman-adv/unicast.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/staging/batman-adv/unicast.c b/drivers/staging/batman-adv/unicast.c index 3b62d99..7b9385b 100644 --- a/drivers/staging/batman-adv/unicast.c +++ b/drivers/staging/batman-adv/unicast.c @@ -23,6 +23,7 @@ #include "unicast.h" #include "send.h" #include "soft-interface.h" +#include "gateway_client.h" #include "originator.h" #include "hash.h" #include "translation-table.h" @@ -282,10 +283,13 @@ int unicast_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv) spin_lock_bh(&bat_priv->orig_hash_lock); /* get routing information */ - orig_node = ((struct orig_node *)hash_find(bat_priv->orig_hash, - compare_orig, - choose_orig, - ethhdr->h_dest)); + if (is_bcast(ethhdr->h_dest) || is_mcast(ethhdr->h_dest)) + orig_node = (struct orig_node *)gw_get_selected(bat_priv); + else + orig_node = ((struct orig_node *)hash_find(bat_priv->orig_hash, + compare_orig, + choose_orig, + ethhdr->h_dest)); /* check for hna host */ if (!orig_node) |