[B.A.T.M.A.N.] [RFCv2 0/6] add network wide multi interface optimization
by Simon Wunderlich
This patchset adds the network wide multi interface optimization as
proposed in our wiki [1] for BATMAN IV. The main purpose is to do
interface alternating and bonding by considering multi interface
capabilities globally and not just for the (next) link, otherwise
non-optimal links may be chosen.
This patchset needs to change a lot of core data structures and
routing, please review it carefully. A local development branch
exists on the public git repo [2].
Changes from RFCv1 in May are:
* rebase on current master including routing abstraction
* use routing abstraction and change some of the API calls for the
new multi interface usage
* check bonding candidates using the new API
* changed wifi penalty to use the double hop penalty, default hop
penalty changed to 15 to make no effective change in single station
networks
* fixed seqno protection window troubles (changed to protection window
per interface for OGMs)
* various smaller changes, including locking and NULL checking
I've tested the patchset in my VMs to confirm that bonding and alternating
works as expected.
As always, any comments are appreciated!
Thanks,
Simon
[1] http://www.open-mesh.org/projects/batman-adv/wiki/network-wide-multi-link...
[2] http://git.open-mesh.org/batman-adv.git/shortlog/refs/heads/simon/network...
Simon Wunderlich (6):
batman-adv: remove bonding and interface alternating
batman-adv: split tq information in neigh_node struct
batman-adv: split out router from orig_node
batman-adv: add WiFi penalty
batman-adv: consider outgoing interface in OGM sending
batman-adv: add bonding again
bat_iv_ogm.c | 732 +++++++++++++++++++++++++++++++----------------
distributed-arp-table.c | 3 +-
gateway_client.c | 79 ++++-
hard-interface.c | 2 +-
hard-interface.h | 1 +
icmp_socket.c | 2 +-
main.c | 2 +-
network-coding.c | 9 +-
originator.c | 304 +++++++++++++++++---
originator.h | 14 +-
routing.c | 432 +++++++++-------------------
routing.h | 12 +-
send.c | 13 +-
soft-interface.c | 2 +-
translation-table.c | 5 +-
types.h | 110 ++++---
16 files changed, 1073 insertions(+), 649 deletions(-)
--
1.7.10.4
7 years, 5 months
[B.A.T.M.A.N.] [PATCH maint] batman-adv: set network coding packet handlers in batadv_recv_handler_init()
by Matthias Schiffer
Registering and unregistering the packet handlers on softif creation and
destruction is obviously broken when multiple softif are used (and causes the
second softif creation to fail). Instead, just set the network coding handlers
in the __init function (like all other handlers).
Signed-off-by: Matthias Schiffer <mschiffer(a)universe-factory.net>
---
main.c | 2 ++
network-coding.c | 12 ++----------
network-coding.h | 8 ++++++++
3 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/main.c b/main.c
index 08125f3..87ef89a 100644
--- a/main.c
+++ b/main.c
@@ -349,6 +349,8 @@ static void batadv_recv_handler_init(void)
batadv_rx_handler[BATADV_TT_QUERY] = batadv_recv_tt_query;
/* Roaming advertisement */
batadv_rx_handler[BATADV_ROAM_ADV] = batadv_recv_roam_adv;
+ /* network coding */
+ batadv_rx_handler[BATADV_CODED] = batadv_nc_recv_coded_packet;
}
int
diff --git a/network-coding.c b/network-coding.c
index a487d46..6f392fd 100644
--- a/network-coding.c
+++ b/network-coding.c
@@ -31,8 +31,6 @@ static struct lock_class_key batadv_nc_coding_hash_lock_class_key;
static struct lock_class_key batadv_nc_decoding_hash_lock_class_key;
static void batadv_nc_worker(struct work_struct *work);
-static int batadv_nc_recv_coded_packet(struct sk_buff *skb,
- struct batadv_hard_iface *recv_if);
/**
* batadv_nc_start_timer - initialise the nc periodic worker
@@ -70,11 +68,6 @@ int batadv_nc_init(struct batadv_priv *bat_priv)
batadv_hash_set_lock_class(bat_priv->nc.coding_hash,
&batadv_nc_decoding_hash_lock_class_key);
- /* Register our packet type */
- if (batadv_recv_handler_register(BATADV_CODED,
- batadv_nc_recv_coded_packet) < 0)
- goto err;
-
INIT_DELAYED_WORK(&bat_priv->nc.work, batadv_nc_worker);
batadv_nc_start_timer(bat_priv);
@@ -1657,8 +1650,8 @@ batadv_nc_find_decoding_packet(struct batadv_priv *bat_priv,
* @skb: incoming coded packet
* @recv_if: pointer to interface this packet was received on
*/
-static int batadv_nc_recv_coded_packet(struct sk_buff *skb,
- struct batadv_hard_iface *recv_if)
+int batadv_nc_recv_coded_packet(struct sk_buff *skb,
+ struct batadv_hard_iface *recv_if)
{
struct batadv_priv *bat_priv = netdev_priv(recv_if->soft_iface);
struct batadv_unicast_packet *unicast_packet;
@@ -1726,7 +1719,6 @@ free_nc_packet:
*/
void batadv_nc_free(struct batadv_priv *bat_priv)
{
- batadv_recv_handler_unregister(BATADV_CODED);
cancel_delayed_work_sync(&bat_priv->nc.work);
batadv_nc_purge_paths(bat_priv, bat_priv->nc.coding_hash, NULL);
diff --git a/network-coding.h b/network-coding.h
index 85a4ec8..f00cd4d 100644
--- a/network-coding.h
+++ b/network-coding.h
@@ -35,6 +35,8 @@ void batadv_nc_purge_orig(struct batadv_priv *bat_priv,
struct batadv_nc_node *));
void batadv_nc_init_bat_priv(struct batadv_priv *bat_priv);
void batadv_nc_init_orig(struct batadv_orig_node *orig_node);
+int batadv_nc_recv_coded_packet(struct sk_buff *skb,
+ struct batadv_hard_iface *recv_if);
bool batadv_nc_skb_forward(struct sk_buff *skb,
struct batadv_neigh_node *neigh_node);
void batadv_nc_skb_store_for_decoding(struct batadv_priv *bat_priv,
@@ -85,6 +87,12 @@ static inline void batadv_nc_init_orig(struct batadv_orig_node *orig_node)
return;
}
+static inline int batadv_nc_recv_coded_packet(struct sk_buff *skb,
+ struct batadv_hard_iface *recv_if)
+{
+ return NET_RX_DROP;
+}
+
static inline bool batadv_nc_skb_forward(struct sk_buff *skb,
struct batadv_neigh_node *neigh_node)
{
--
1.8.4
7 years, 5 months
[B.A.T.M.A.N.] [PATCH 1/4] alfred: Don't fail rebuild when header is removed
by Sven Eckelmann
The *.d depends files for make just list the files used when building an object
file. Removing a file listed in such a dependency file causes make to search
for a way to recreate it. This usually cannot work because these files aren't
autogenerated.
The gcc option -MP can be used to generate empty rule for these files. Removing
a file in a dependency list will then execute this empty rule and continue with
the execution of the creation of the object file. This compilation process will
then automatically correct the dependency file.
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
---
Makefile | 2 +-
vis/Makefile | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index aeee2e8..ec9dc11 100644
--- a/Makefile
+++ b/Makefile
@@ -23,7 +23,7 @@ BINARY_NAME = alfred
OBJ = main.o server.o client.o netsock.o send.o recv.o hash.o unix_sock.o util.o debugfs.o batadv_query.o
# alfred flags and options
-CFLAGS += -pedantic -Wall -W -std=gnu99 -fno-strict-aliasing -MD
+CFLAGS += -pedantic -Wall -W -std=gnu99 -fno-strict-aliasing -MD -MP
LDLIBS += -lrt
# disable verbose output
diff --git a/vis/Makefile b/vis/Makefile
index 8585f9a..9bf72c9 100644
--- a/vis/Makefile
+++ b/vis/Makefile
@@ -23,7 +23,7 @@ BINARY_NAME = vis
OBJ = vis.o debugfs.o
# alfred flags and options
-CFLAGS += -pedantic -Wall -W -std=gnu99 -fno-strict-aliasing -MD
+CFLAGS += -pedantic -Wall -W -std=gnu99 -fno-strict-aliasing -MD -MP
LDLIBS += -lrt
# disable verbose output
--
1.8.4.rc3
7 years, 5 months
[B.A.T.M.A.N.] [PATCH maint] batctl tcpdump: Fix reported length of TCP payload
by Marco Dalla Torre
Fixes the erratic report of TCP payload length in 'batctl tcpdump'.
Previously TCP header length size was considered fixed, while
this is actually not the case given the variable length (or no
presence at all) of the options field.
Signed-off-by: Marco Dalla Torre <marco.dallato(a)gmail.com>
---
tcpdump.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/tcpdump.c b/tcpdump.c
index 7e0987b..e6f8f7d 100644
--- a/tcpdump.c
+++ b/tcpdump.c
@@ -194,6 +194,7 @@ static void dump_ip(unsigned char *packet_buff, ssize_t buff_len, int time_print
struct tcphdr *tcphdr;
struct udphdr *udphdr, *tmp_udphdr;
struct icmphdr *icmphdr;
+ uint16_t tcp_header_len;
iphdr = (struct iphdr *)packet_buff;
LEN_CHECK((size_t)buff_len, (size_t)(iphdr->ihl * 4), "IP");
@@ -257,16 +258,18 @@ static void dump_ip(unsigned char *packet_buff, ssize_t buff_len, int time_print
break;
case IPPROTO_TCP:
- LEN_CHECK((size_t)buff_len - (iphdr->ihl * 4), sizeof(struct tcphdr), "TCP");
-
tcphdr = (struct tcphdr *)(packet_buff + (iphdr->ihl * 4));
+ tcp_header_len = tcphdr->doff * 4;
+ LEN_CHECK((size_t)buff_len - (iphdr->ihl * 4),
+ (size_t)tcp_header_len, "TCP");
+
printf("IP %s.%i > ", inet_ntoa(*(struct in_addr *)&iphdr->saddr), ntohs(tcphdr->source));
printf("%s.%i: TCP, flags [%c%c%c%c%c%c], length %zu\n",
inet_ntoa(*(struct in_addr *)&iphdr->daddr), ntohs(tcphdr->dest),
(tcphdr->fin ? 'F' : '.'), (tcphdr->syn ? 'S' : '.'),
(tcphdr->rst ? 'R' : '.'), (tcphdr->psh ? 'P' : '.'),
(tcphdr->ack ? 'A' : '.'), (tcphdr->urg ? 'U' : '.'),
- (size_t)buff_len - (iphdr->ihl * 4) - sizeof(struct tcphdr));
+ (size_t)buff_len - (iphdr->ihl * 4) - tcp_header_len);
break;
case IPPROTO_UDP:
LEN_CHECK((size_t)buff_len - (iphdr->ihl * 4), sizeof(struct udphdr), "UDP");
--
1.8.3.2
7 years, 5 months
[B.A.T.M.A.N.] [PATCH next] batman-adv: remove accidentally re-introduced unicast.c file
by Antonio Quartulli
During the Fragmentation redesign the unicast.c file has
been removed, but it seems that it has been accidentally
re-introduced during a merge operation.
Remove it again.
Signed-off-by: Antonio Quartulli <antonio(a)meshcoding.com>
---
unicast.c | 491 --------------------------------------------------------------
1 file changed, 491 deletions(-)
delete mode 100644 unicast.c
diff --git a/unicast.c b/unicast.c
deleted file mode 100644
index 48b31d3..0000000
--- a/unicast.c
+++ /dev/null
@@ -1,491 +0,0 @@
-/* Copyright (C) 2010-2013 B.A.T.M.A.N. contributors:
- *
- * Andreas Langer
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA
- */
-
-#include "main.h"
-#include "unicast.h"
-#include "send.h"
-#include "soft-interface.h"
-#include "gateway_client.h"
-#include "originator.h"
-#include "hash.h"
-#include "translation-table.h"
-#include "routing.h"
-#include "hard-interface.h"
-
-
-static struct sk_buff *
-batadv_frag_merge_packet(struct list_head *head,
- struct batadv_frag_packet_list_entry *tfp,
- struct sk_buff *skb)
-{
- struct batadv_unicast_frag_packet *up;
- struct sk_buff *tmp_skb;
- struct batadv_unicast_packet *unicast_packet;
- int hdr_len = sizeof(*unicast_packet);
- int uni_diff = sizeof(*up) - hdr_len;
- uint8_t *packet_pos;
-
- up = (struct batadv_unicast_frag_packet *)skb->data;
- /* set skb to the first part and tmp_skb to the second part */
- if (up->flags & BATADV_UNI_FRAG_HEAD) {
- tmp_skb = tfp->skb;
- } else {
- tmp_skb = skb;
- skb = tfp->skb;
- }
-
- if (skb_linearize(skb) < 0 || skb_linearize(tmp_skb) < 0)
- goto err;
-
- skb_pull(tmp_skb, sizeof(*up));
- if (pskb_expand_head(skb, 0, tmp_skb->len, GFP_ATOMIC) < 0)
- goto err;
-
- /* move free entry to end */
- tfp->skb = NULL;
- tfp->seqno = 0;
- list_move_tail(&tfp->list, head);
-
- memcpy(skb_put(skb, tmp_skb->len), tmp_skb->data, tmp_skb->len);
- kfree_skb(tmp_skb);
-
- memmove(skb->data + uni_diff, skb->data, hdr_len);
- packet_pos = skb_pull(skb, uni_diff);
- unicast_packet = (struct batadv_unicast_packet *)packet_pos;
- unicast_packet->header.packet_type = BATADV_UNICAST;
-
- return skb;
-
-err:
- /* free buffered skb, skb will be freed later */
- kfree_skb(tfp->skb);
- return NULL;
-}
-
-static void batadv_frag_create_entry(struct list_head *head,
- struct sk_buff *skb)
-{
- struct batadv_frag_packet_list_entry *tfp;
- struct batadv_unicast_frag_packet *up;
-
- up = (struct batadv_unicast_frag_packet *)skb->data;
-
- /* free and oldest packets stand at the end */
- tfp = list_entry((head)->prev, typeof(*tfp), list);
- kfree_skb(tfp->skb);
-
- tfp->seqno = ntohs(up->seqno);
- tfp->skb = skb;
- list_move(&tfp->list, head);
- return;
-}
-
-static int batadv_frag_create_buffer(struct list_head *head)
-{
- int i;
- struct batadv_frag_packet_list_entry *tfp;
-
- for (i = 0; i < BATADV_FRAG_BUFFER_SIZE; i++) {
- tfp = kmalloc(sizeof(*tfp), GFP_ATOMIC);
- if (!tfp) {
- batadv_frag_list_free(head);
- return -ENOMEM;
- }
- tfp->skb = NULL;
- tfp->seqno = 0;
- INIT_LIST_HEAD(&tfp->list);
- list_add(&tfp->list, head);
- }
-
- return 0;
-}
-
-static struct batadv_frag_packet_list_entry *
-batadv_frag_search_packet(struct list_head *head,
- const struct batadv_unicast_frag_packet *up)
-{
- struct batadv_frag_packet_list_entry *tfp;
- struct batadv_unicast_frag_packet *tmp_up = NULL;
- bool is_head_tmp, is_head;
- uint16_t search_seqno;
-
- if (up->flags & BATADV_UNI_FRAG_HEAD)
- search_seqno = ntohs(up->seqno)+1;
- else
- search_seqno = ntohs(up->seqno)-1;
-
- is_head = up->flags & BATADV_UNI_FRAG_HEAD;
-
- list_for_each_entry(tfp, head, list) {
- if (!tfp->skb)
- continue;
-
- if (tfp->seqno == ntohs(up->seqno))
- goto mov_tail;
-
- tmp_up = (struct batadv_unicast_frag_packet *)tfp->skb->data;
-
- if (tfp->seqno == search_seqno) {
- is_head_tmp = tmp_up->flags & BATADV_UNI_FRAG_HEAD;
- if (is_head_tmp != is_head)
- return tfp;
- else
- goto mov_tail;
- }
- }
- return NULL;
-
-mov_tail:
- list_move_tail(&tfp->list, head);
- return NULL;
-}
-
-void batadv_frag_list_free(struct list_head *head)
-{
- struct batadv_frag_packet_list_entry *pf, *tmp_pf;
-
- if (!list_empty(head)) {
- list_for_each_entry_safe(pf, tmp_pf, head, list) {
- kfree_skb(pf->skb);
- list_del(&pf->list);
- kfree(pf);
- }
- }
- return;
-}
-
-/* frag_reassemble_skb():
- * returns NET_RX_DROP if the operation failed - skb is left intact
- * returns NET_RX_SUCCESS if the fragment was buffered (skb_new will be NULL)
- * or the skb could be reassembled (skb_new will point to the new packet and
- * skb was freed)
- */
-int batadv_frag_reassemble_skb(struct sk_buff *skb,
- struct batadv_priv *bat_priv,
- struct sk_buff **new_skb)
-{
- struct batadv_orig_node *orig_node;
- struct batadv_frag_packet_list_entry *tmp_frag_entry;
- int ret = NET_RX_DROP;
- struct batadv_unicast_frag_packet *unicast_packet;
-
- unicast_packet = (struct batadv_unicast_frag_packet *)skb->data;
- *new_skb = NULL;
-
- orig_node = batadv_orig_hash_find(bat_priv, unicast_packet->orig);
- if (!orig_node)
- goto out;
-
- orig_node->last_frag_packet = jiffies;
-
- if (list_empty(&orig_node->frag_list) &&
- batadv_frag_create_buffer(&orig_node->frag_list)) {
- pr_debug("couldn't create frag buffer\n");
- goto out;
- }
-
- tmp_frag_entry = batadv_frag_search_packet(&orig_node->frag_list,
- unicast_packet);
-
- if (!tmp_frag_entry) {
- batadv_frag_create_entry(&orig_node->frag_list, skb);
- ret = NET_RX_SUCCESS;
- goto out;
- }
-
- *new_skb = batadv_frag_merge_packet(&orig_node->frag_list,
- tmp_frag_entry, skb);
- /* if not, merge failed */
- if (*new_skb)
- ret = NET_RX_SUCCESS;
-
-out:
- if (orig_node)
- batadv_orig_node_free_ref(orig_node);
- return ret;
-}
-
-int batadv_frag_send_skb(struct sk_buff *skb, struct batadv_priv *bat_priv,
- struct batadv_hard_iface *hard_iface,
- const uint8_t dstaddr[])
-{
- struct batadv_unicast_packet tmp_uc, *unicast_packet;
- struct batadv_hard_iface *primary_if;
- struct sk_buff *frag_skb;
- struct batadv_unicast_frag_packet *frag1, *frag2;
- int uc_hdr_len = sizeof(*unicast_packet);
- int ucf_hdr_len = sizeof(*frag1);
- int data_len = skb->len - uc_hdr_len;
- int large_tail = 0, ret = NET_RX_DROP;
- uint16_t seqno;
-
- primary_if = batadv_primary_if_get_selected(bat_priv);
- if (!primary_if)
- goto dropped;
-
- frag_skb = dev_alloc_skb(data_len - (data_len / 2) + ucf_hdr_len);
- if (!frag_skb)
- goto dropped;
-
- skb->priority = TC_PRIO_CONTROL;
- skb_reserve(frag_skb, ucf_hdr_len);
-
- unicast_packet = (struct batadv_unicast_packet *)skb->data;
- memcpy(&tmp_uc, unicast_packet, uc_hdr_len);
- skb_split(skb, frag_skb, data_len / 2 + uc_hdr_len);
-
- if (batadv_skb_head_push(skb, ucf_hdr_len - uc_hdr_len) < 0 ||
- batadv_skb_head_push(frag_skb, ucf_hdr_len) < 0)
- goto drop_frag;
-
- frag1 = (struct batadv_unicast_frag_packet *)skb->data;
- frag2 = (struct batadv_unicast_frag_packet *)frag_skb->data;
-
- memcpy(frag1, &tmp_uc, sizeof(tmp_uc));
-
- frag1->header.ttl--;
- frag1->header.version = BATADV_COMPAT_VERSION;
- frag1->header.packet_type = BATADV_UNICAST_FRAG;
-
- memcpy(frag1->orig, primary_if->net_dev->dev_addr, ETH_ALEN);
- memcpy(frag2, frag1, sizeof(*frag2));
-
- if (data_len & 1)
- large_tail = BATADV_UNI_FRAG_LARGETAIL;
-
- frag1->flags = BATADV_UNI_FRAG_HEAD | large_tail;
- frag2->flags = large_tail;
-
- seqno = atomic_add_return(2, &hard_iface->frag_seqno);
- frag1->seqno = htons(seqno - 1);
- frag2->seqno = htons(seqno);
-
- batadv_send_skb_packet(skb, hard_iface, dstaddr);
- batadv_send_skb_packet(frag_skb, hard_iface, dstaddr);
- ret = NET_RX_SUCCESS;
- goto out;
-
-drop_frag:
- kfree_skb(frag_skb);
-dropped:
- kfree_skb(skb);
-out:
- if (primary_if)
- batadv_hardif_free_ref(primary_if);
- return ret;
-}
-
-/**
- * batadv_unicast_push_and_fill_skb - extends the buffer and initializes the
- * common fields for unicast packets
- * @skb: packet
- * @hdr_size: amount of bytes to push at the beginning of the skb
- * @orig_node: the destination node
- *
- * Returns false if the buffer extension was not possible or true otherwise
- */
-static bool batadv_unicast_push_and_fill_skb(struct sk_buff *skb, int hdr_size,
- struct batadv_orig_node *orig_node)
-{
- struct batadv_unicast_packet *unicast_packet;
- uint8_t ttvn = (uint8_t)atomic_read(&orig_node->last_ttvn);
-
- if (batadv_skb_head_push(skb, hdr_size) < 0)
- return false;
-
- unicast_packet = (struct batadv_unicast_packet *)skb->data;
- unicast_packet->header.version = BATADV_COMPAT_VERSION;
- /* batman packet type: unicast */
- unicast_packet->header.packet_type = BATADV_UNICAST;
- /* set unicast ttl */
- unicast_packet->header.ttl = BATADV_TTL;
- /* copy the destination for faster routing */
- memcpy(unicast_packet->dest, orig_node->orig, ETH_ALEN);
- /* set the destination tt version number */
- unicast_packet->ttvn = ttvn;
-
- return true;
-}
-
-/**
- * batadv_unicast_prepare_skb - encapsulate an skb with a unicast header
- * @skb: the skb containing the payload to encapsulate
- * @orig_node: the destination node
- *
- * Returns false if the payload could not be encapsulated or true otherwise.
- *
- * This call might reallocate skb data.
- */
-static bool batadv_unicast_prepare_skb(struct sk_buff *skb,
- struct batadv_orig_node *orig_node)
-{
- size_t uni_size = sizeof(struct batadv_unicast_packet);
- return batadv_unicast_push_and_fill_skb(skb, uni_size, orig_node);
-}
-
-/**
- * batadv_unicast_4addr_prepare_skb - encapsulate an skb with a unicast4addr
- * header
- * @bat_priv: the bat priv with all the soft interface information
- * @skb: the skb containing the payload to encapsulate
- * @orig_node: the destination node
- * @packet_subtype: the batman 4addr packet subtype to use
- *
- * Returns false if the payload could not be encapsulated or true otherwise.
- *
- * This call might reallocate skb data.
- */
-bool batadv_unicast_4addr_prepare_skb(struct batadv_priv *bat_priv,
- struct sk_buff *skb,
- struct batadv_orig_node *orig,
- int packet_subtype)
-{
- struct batadv_hard_iface *primary_if;
- struct batadv_unicast_4addr_packet *unicast_4addr_packet;
- bool ret = false;
-
- primary_if = batadv_primary_if_get_selected(bat_priv);
- if (!primary_if)
- goto out;
-
- /* pull the header space and fill the unicast_packet substructure.
- * We can do that because the first member of the unicast_4addr_packet
- * is of type struct unicast_packet
- */
- if (!batadv_unicast_push_and_fill_skb(skb,
- sizeof(*unicast_4addr_packet),
- orig))
- goto out;
-
- unicast_4addr_packet = (struct batadv_unicast_4addr_packet *)skb->data;
- unicast_4addr_packet->u.header.packet_type = BATADV_UNICAST_4ADDR;
- memcpy(unicast_4addr_packet->src, primary_if->net_dev->dev_addr,
- ETH_ALEN);
- unicast_4addr_packet->subtype = packet_subtype;
- unicast_4addr_packet->reserved = 0;
-
- ret = true;
-out:
- if (primary_if)
- batadv_hardif_free_ref(primary_if);
- return ret;
-}
-
-/**
- * batadv_unicast_generic_send_skb - send an skb as unicast
- * @bat_priv: the bat priv with all the soft interface information
- * @skb: payload to send
- * @packet_type: the batman unicast packet type to use
- * @packet_subtype: the batman packet subtype. It is ignored if packet_type is
- * not BATADV_UNICAT_4ADDR
- *
- * Returns 1 in case of error or 0 otherwise
- */
-int batadv_unicast_generic_send_skb(struct batadv_priv *bat_priv,
- struct sk_buff *skb, int packet_type,
- int packet_subtype)
-{
- struct ethhdr *ethhdr = (struct ethhdr *)skb->data;
- struct batadv_unicast_packet *unicast_packet;
- struct batadv_orig_node *orig_node;
- struct batadv_neigh_node *neigh_node;
- int data_len = skb->len;
- int ret = NET_RX_DROP;
- unsigned int dev_mtu, header_len;
-
- /* get routing information */
- if (is_multicast_ether_addr(ethhdr->h_dest)) {
- orig_node = batadv_gw_get_selected_orig(bat_priv);
- if (orig_node)
- goto find_router;
- }
-
- /* check for tt host - increases orig_node refcount.
- * returns NULL in case of AP isolation
- */
- orig_node = batadv_transtable_search(bat_priv, ethhdr->h_source,
- ethhdr->h_dest);
-
-find_router:
- /* find_router():
- * - if orig_node is NULL it returns NULL
- * - increases neigh_nodes refcount if found.
- */
- neigh_node = batadv_find_router(bat_priv, orig_node, NULL);
-
- if (!neigh_node)
- goto out;
-
- switch (packet_type) {
- case BATADV_UNICAST:
- if (!batadv_unicast_prepare_skb(skb, orig_node))
- goto out;
-
- header_len = sizeof(struct batadv_unicast_packet);
- break;
- case BATADV_UNICAST_4ADDR:
- if (!batadv_unicast_4addr_prepare_skb(bat_priv, skb, orig_node,
- packet_subtype))
- goto out;
-
- header_len = sizeof(struct batadv_unicast_4addr_packet);
- break;
- default:
- /* this function supports UNICAST and UNICAST_4ADDR only. It
- * should never be invoked with any other packet type
- */
- goto out;
- }
-
- ethhdr = (struct ethhdr *)(skb->data + header_len);
- unicast_packet = (struct batadv_unicast_packet *)skb->data;
-
- /* inform the destination node that we are still missing a correct route
- * for this client. The destination will receive this packet and will
- * try to reroute it because the ttvn contained in the header is less
- * than the current one
- */
- if (batadv_tt_global_client_is_roaming(bat_priv, ethhdr->h_dest))
- unicast_packet->ttvn = unicast_packet->ttvn - 1;
-
- dev_mtu = neigh_node->if_incoming->net_dev->mtu;
- /* fragmentation mechanism only works for UNICAST (now) */
- if (packet_type == BATADV_UNICAST &&
- atomic_read(&bat_priv->fragmentation) &&
- data_len + sizeof(*unicast_packet) > dev_mtu) {
- /* send frag skb decreases ttl */
- unicast_packet->header.ttl++;
- ret = batadv_frag_send_skb(skb, bat_priv,
- neigh_node->if_incoming,
- neigh_node->addr);
- goto out;
- }
-
- if (batadv_send_skb_to_orig(skb, orig_node, NULL) != NET_XMIT_DROP)
- ret = 0;
-
-out:
- if (neigh_node)
- batadv_neigh_node_free_ref(neigh_node);
- if (orig_node)
- batadv_orig_node_free_ref(orig_node);
- if (ret == NET_RX_DROP)
- kfree_skb(skb);
- return ret;
-}
--
1.8.1.5
7 years, 5 months
[B.A.T.M.A.N.] [PATCH] batctl: Add documentation for IPv6 translate feature
by Sven Eckelmann
c760fb3c8029edf40657d283dc47af2fef9b3a6f ("batctl: Add support for IPv6 to
address resolver") added support for translating IPv6 addresses to mac adresses
but didn't update the documentation.
Reported-by: Antonio Quartulli <antonio(a)meshcoding.com>
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
---
README | 12 +++++++-----
man/batctl.8 | 20 ++++++++++----------
2 files changed, 17 insertions(+), 15 deletions(-)
diff --git a/README b/README
index f3eb4b3..5af95c8 100644
--- a/README
+++ b/README
@@ -78,10 +78,10 @@ $ batctl statistics
batctl translate
================
-Translates a destination (hostname, IPv4, MAC, bat_host-name) to the originator
-mac address responsible for it.
+Translates a destination (hostname, IPv4, IPv6, MAC, bat_host-name) to the
+originator mac address responsible for it.
-Usage: batctl translate mac|bat-host|host-name|IPv4-address
+Usage: batctl translate mac|bat-host|host-name|IP-address
Example:
@@ -93,13 +93,15 @@ $ batctl translate 192.168.1.2
02:ca:fe:af:fe:05
$ batctl translate fe:fe:00:00:09:01
02:ca:fe:af:fe:05
+$ batctl translate 2001::1
+02:ca:fe:af:fe:05
batctl ping
============
Sends a Layer 2 batman-adv ping to check round trip time and connectivity
-Usage: batctl ping [parameters] mac|bat-host|host-name|IPv4-address
+Usage: batctl ping [parameters] mac|bat-host|host-name|IP-address
parameters:
-c ping packet count
-h print this help
@@ -125,7 +127,7 @@ batctl traceroute
Traceroute sends 3 packets to each hop, awaits the answers and prints out the
response times.
-Usage: batctl traceroute [parameters] mac|bat-host|host-name|IPv4-address
+Usage: batctl traceroute [parameters] mac|bat-host|host-name|IP-address
Example:
diff --git a/man/batctl.8 b/man/batctl.8
index 157f96d..af2729b 100644
--- a/man/batctl.8
+++ b/man/batctl.8
@@ -201,9 +201,9 @@ List of debug tables:
.RE
.RE
.br
-.IP "\fBtranslate\fP|\fBt\fP \fBMAC_address\fP|\fBbat\-host_name\fP|\fBhost_name\fP|\fBIPv4_address\fP"
+.IP "\fBtranslate\fP|\fBt\fP \fBMAC_address\fP|\fBbat\-host_name\fP|\fBhost_name\fP|\fBIP_address\fP"
-Translates a destination (hostname, IPv4, MAC, bat_host-name) to the originator
+Translates a destination (hostname, IP, MAC, bat_host-name) to the originator
mac address responsible for it.
.br
.IP "\fBstatistics\fP|\fBs\fP"
@@ -221,22 +221,22 @@ tt - translation table counters
All counters without a prefix concern payload (pure user data) traffic.
.RE
.br
-.IP "\fBping\fP|\fBp\fP [\fB\-c count\fP][\fB\-i interval\fP][\fB\-t time\fP][\fB\-R\fP][\fB\-T\fP] \fBMAC_address\fP|\fBbat\-host_name\fP|\fBhost_name\fP|\fBIPv4_address\fP"
+.IP "\fBping\fP|\fBp\fP [\fB\-c count\fP][\fB\-i interval\fP][\fB\-t time\fP][\fB\-R\fP][\fB\-T\fP] \fBMAC_address\fP|\fBbat\-host_name\fP|\fBhost_name\fP|\fBIP_address\fP"
Layer 2 ping of a MAC address or bat\-host name. batctl will try to find the bat\-host name if the given parameter was
-not a MAC address. It can also try to guess the MAC address using an IPv4 address or a hostname when
-the IPv4 address was configured on top of the batman-adv interface of the destination device and both source and
-destination devices are in the same IPv4 subnet.
+not a MAC address. It can also try to guess the MAC address using an IPv4/IPv6 address or a hostname when
+the IPv4/IPv6 address was configured on top of the batman-adv interface of the destination device and both source and
+destination devices are in the same IP subnet.
The "\-c" option tells batctl how man pings should be sent before the program exits. Without the "\-c"
option batctl will continue pinging without end. Use CTRL + C to stop it. With "\-i" and "\-t" you can set the default
interval between pings and the timeout time for replies, both in seconds. When run with "\-R", the route taken by the ping
messages will be recorded. With "\-T" you can disable the automatic translation of a client MAC address to the originator
address which is responsible for this client.
.br
-.IP "\fBtraceroute\fP|\fBtr\fP [\fB\-n\fP][\fB\-T\fP] \fBMAC_address\fP|\fBbat\-host_name\fP|\fBhost_name\fP|\fBIPv4_address\fP"
+.IP "\fBtraceroute\fP|\fBtr\fP [\fB\-n\fP][\fB\-T\fP] \fBMAC_address\fP|\fBbat\-host_name\fP|\fBhost_name\fP|\fBIP_address\fP"
Layer 2 traceroute to a MAC address or bat\-host name. batctl will try to find the bat\-host name if the given parameter
-was not a MAC address. It can also try to guess the MAC address using an IPv4 address or a hostname when
-the IPv4 address was configured on top of the batman-adv interface of the destination device and both source and
-destination devices are in the same IPv4 subnet.
+was not a MAC address. It can also try to guess the MAC address using an IPv4/IPv6 address or a hostname when
+the IPv4/IPv6 address was configured on top of the batman-adv interface of the destination device and both source and
+destination devices are in the same IP subnet.
batctl will send 3 packets to each host and display the response time. If "\-n" is given batctl will
not replace the MAC addresses with bat\-host names in the output. With "\-T" you can disable the automatic translation
of a client MAC address to the originator address which is responsible for this client.
--
1.8.4.rc3
7 years, 5 months
[B.A.T.M.A.N.] [PATCH 1/4] batctl: Add missing includes and remove unused includes
by Sven Eckelmann
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
---
bat-hosts.c | 5 +++--
bat-hosts.h | 2 +-
bisect_iv.c | 7 ++++---
debug.c | 5 -----
debug.h | 3 +++
debugfs.c | 10 ++++------
debugfs.h | 3 ---
functions.c | 2 ++
functions.h | 3 ++-
ioctl.c | 3 +--
list-batman.h | 3 ---
main.c | 3 ---
ping.c | 5 +++++
sys.c | 1 -
sys.h | 2 ++
tcpdump.c | 6 +++++-
tcpdump.h | 5 ++++-
traceroute.c | 4 ++++
translate.c | 1 -
19 files changed, 40 insertions(+), 33 deletions(-)
diff --git a/bat-hosts.c b/bat-hosts.c
index ee862da..9d36531 100644
--- a/bat-hosts.c
+++ b/bat-hosts.c
@@ -21,14 +21,15 @@
-#include <stdio.h>
#include <stdint.h>
+#include <stdio.h>
#include <limits.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
+#include <stddef.h>
+#include <netinet/ether.h>
-#include "main.h"
#include "bat-hosts.h"
#include "hash.h"
#include "functions.h"
diff --git a/bat-hosts.h b/bat-hosts.h
index 74a4ce5..96abfa9 100644
--- a/bat-hosts.h
+++ b/bat-hosts.h
@@ -24,7 +24,7 @@
#ifndef _BATCTL_BAT_HOSTS_H
#define _BATCTL_BAT_HOSTS_H
-#include <netinet/ether.h>
+#include <net/ethernet.h>
#define HOST_NAME_MAX_LEN 50
#define CONF_DIR_LEN 256
diff --git a/bisect_iv.c b/bisect_iv.c
index c0f9420..917ffec 100644
--- a/bisect_iv.c
+++ b/bisect_iv.c
@@ -19,14 +19,15 @@
*
*/
+#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
-#include <stdint.h>
-#include <unistd.h>
#include <string.h>
#include <errno.h>
+#include <unistd.h>
+#include <stddef.h>
+#include <netinet/ether.h>
-#include "main.h"
#include "bisect_iv.h"
#include "bat-hosts.h"
#include "hash.h"
diff --git a/debug.c b/debug.c
index 2589dbc..6b7b648 100644
--- a/debug.c
+++ b/debug.c
@@ -23,12 +23,7 @@
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <sys/types.h>
-#include <dirent.h>
-#include "main.h"
#include "debug.h"
#include "debugfs.h"
#include "functions.h"
diff --git a/debug.h b/debug.h
index 8d9de08..563a7bb 100644
--- a/debug.h
+++ b/debug.h
@@ -22,6 +22,9 @@
#ifndef _BATCTL_DEBUG_H
#define _BATCTL_DEBUG_H
+#include <stddef.h>
+#include "main.h"
+
#define DEBUG_BATIF_PATH_FMT "%s/batman_adv/%s"
#define DEBUG_TRANSTABLE_GLOBAL "transtable_global"
#define DEBUG_LOG "log"
diff --git a/debugfs.c b/debugfs.c
index bfedcfe..8033f8b 100644
--- a/debugfs.c
+++ b/debugfs.c
@@ -19,14 +19,12 @@
*/
#include "debugfs.h"
-#include <stdio.h>
-#include <stdlib.h>
#include <errno.h>
-#include <sys/vfs.h>
-#include <sys/types.h>
+#include <stdio.h>
+#include <string.h>
+#include <sys/mount.h>
#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
+#include <sys/statfs.h>
#ifndef DEBUGFS_MAGIC
#define DEBUGFS_MAGIC 0x64626720
diff --git a/debugfs.h b/debugfs.h
index 3981b8b..e608902 100644
--- a/debugfs.h
+++ b/debugfs.h
@@ -21,9 +21,6 @@
#ifndef __DEBUGFS_H__
#define __DEBUGFS_H__
-#include <sys/mount.h>
-#include <string.h>
-
#ifndef MAX_PATH
# define MAX_PATH 256
#endif
diff --git a/functions.c b/functions.c
index bd4da59..1a33d6d 100644
--- a/functions.c
+++ b/functions.c
@@ -33,6 +33,8 @@
#include <errno.h>
#include <fcntl.h>
#include <sys/time.h>
+#include <netinet/in.h>
+#include <stdint.h>
#include "main.h"
#include "functions.h"
diff --git a/functions.h b/functions.h
index 6720a1b..a96b7ee 100644
--- a/functions.h
+++ b/functions.h
@@ -22,7 +22,8 @@
#ifndef _BATCTL_FUNCTIONS_H
#define _BATCTL_FUNCTIONS_H
-#include <netinet/if_ether.h>
+#include <net/ethernet.h>
+#include <stddef.h>
#define ETH_STR_LEN 17
diff --git a/ioctl.c b/ioctl.c
index 3d5b50d..cbb1aa5 100644
--- a/ioctl.c
+++ b/ioctl.c
@@ -26,15 +26,14 @@
#include <string.h>
#include <unistd.h>
#include <sys/ioctl.h>
+#include <sys/types.h>
#include <sys/socket.h>
#include <linux/if.h>
#include <linux/sockios.h>
#include <linux/ethtool.h>
#include <stdint.h>
-#include "main.h"
#include "ioctl.h"
-#include "debugfs.h"
/* code borrowed from ethtool */
static int statistics_custom_get(int fd, struct ifreq *ifr)
diff --git a/list-batman.h b/list-batman.h
index 7de5943..aea0f95 100644
--- a/list-batman.h
+++ b/list-batman.h
@@ -19,9 +19,6 @@
*
*/
-
-#include <stddef.h> /* offsetof() */
-
#ifndef _LINUX_LIST_H
#define _LINUX_LIST_H
diff --git a/main.c b/main.c
index 6b44359..84bb42a 100644
--- a/main.c
+++ b/main.c
@@ -21,9 +21,7 @@
-#include <sys/types.h>
#include <stdio.h>
-#include <stdint.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
@@ -38,7 +36,6 @@
#include "bisect_iv.h"
#include "ioctl.h"
#include "functions.h"
-#include <err.h>
char mesh_dfl_iface[] = "bat0";
char module_ver_path[] = "/sys/module/batman_adv/version";
diff --git a/ping.c b/ping.c
index 4d76484..d505d02 100644
--- a/ping.c
+++ b/ping.c
@@ -30,6 +30,11 @@
#include <fcntl.h>
#include <string.h>
#include <math.h>
+#include <stddef.h>
+#include <stdint.h>
+#include <sys/select.h>
+#include <sys/time.h>
+#include <linux/if_ether.h>
#include "main.h"
#include "ping.h"
diff --git a/sys.c b/sys.c
index 3e60c79..7539f76 100644
--- a/sys.c
+++ b/sys.c
@@ -25,7 +25,6 @@
#include <stdlib.h>
#include <string.h>
#include <errno.h>
-#include <sys/types.h>
#include <dirent.h>
#include "main.h"
diff --git a/sys.h b/sys.h
index dfc167a..5d207a1 100644
--- a/sys.h
+++ b/sys.h
@@ -22,6 +22,8 @@
#ifndef _BATCTL_SYS_H
#define _BATCTL_SYS_H
+#include "main.h"
+
#define SYS_BATIF_PATH_FMT "/sys/class/net/%s/mesh/"
#define SYS_LOG_LEVEL "log_level"
#define SYS_LOG "log"
diff --git a/tcpdump.c b/tcpdump.c
index 7e0987b..a220c3c 100644
--- a/tcpdump.c
+++ b/tcpdump.c
@@ -36,8 +36,12 @@
#include <netinet/udp.h>
#include <netinet/ip_icmp.h>
#include <netinet/if_ether.h>
+#include <net/ethernet.h>
+#include <stddef.h>
+#include <stdint.h>
+#include <sys/select.h>
+#include <sys/socket.h>
-#include "main.h"
#include "tcpdump.h"
#include "packet.h"
#include "bat-hosts.h"
diff --git a/tcpdump.h b/tcpdump.h
index 2845576..3c1a0e1 100644
--- a/tcpdump.h
+++ b/tcpdump.h
@@ -23,7 +23,10 @@
#define _BATCTL_TCPDUMP_H
#include <netpacket/packet.h>
-#include <net/ethernet.h>
+#include <linux/if_ether.h>
+#include <net/if_arp.h>
+#include <sys/types.h>
+#include "main.h"
#include "list-batman.h"
#ifndef ARPHRD_IEEE80211_PRISM
diff --git a/traceroute.c b/traceroute.c
index d62df5e..0cb0441 100644
--- a/traceroute.c
+++ b/traceroute.c
@@ -28,6 +28,10 @@
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
+#include <linux/if_ether.h>
+#include <stddef.h>
+#include <sys/select.h>
+#include <sys/time.h>
#include "main.h"
#include "traceroute.h"
diff --git a/translate.c b/translate.c
index 0b4fbc6..da6d593 100644
--- a/translate.c
+++ b/translate.c
@@ -19,7 +19,6 @@
*
*/
-#include <netinet/in.h>
#include <stdio.h>
#include <stdlib.h>
--
1.8.4.rc3
7 years, 5 months
[B.A.T.M.A.N.] [PATCH] batman-adv: send GW_DEL event in case of soft-iface destruction
by Antonio Quartulli
From: Antonio Quartulli <antonio(a)open-mesh.com>
In case of soft_iface destruction send a GW DEL event to
userspace so that applications which are listening for GW
events are informed about the lost of connectivity and can
react accordingly.
Signed-off-by: Antonio Quartulli <antonio(a)open-mesh.com>
---
hard-interface.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/hard-interface.c b/hard-interface.c
index c5f871f..8a42745 100644
--- a/hard-interface.c
+++ b/hard-interface.c
@@ -28,6 +28,7 @@
#include "originator.h"
#include "hash.h"
#include "bridge_loop_avoidance.h"
+#include "gateway_client.h"
#include <linux/if_arp.h>
#include <linux/if_ether.h>
@@ -524,8 +525,12 @@ void batadv_hardif_disable_interface(struct batadv_hard_iface *hard_iface,
dev_put(hard_iface->soft_iface);
/* nobody uses this interface anymore */
- if (!bat_priv->num_ifaces && autodel == BATADV_IF_CLEANUP_AUTO)
- batadv_softif_destroy_sysfs(hard_iface->soft_iface);
+ if (!bat_priv->num_ifaces) {
+ batadv_gw_check_client_stop(bat_priv);
+
+ if (autodel == BATADV_IF_CLEANUP_AUTO)
+ batadv_softif_destroy_sysfs(hard_iface->soft_iface);
+ }
netdev_upper_dev_unlink(hard_iface->net_dev, hard_iface->soft_iface);
hard_iface->soft_iface = NULL;
--
1.8.1.5
7 years, 5 months
[B.A.T.M.A.N.] [PATCHv2 next] batman-adv: properly format kernel doc
by Antonio Quartulli
Introduced by: 0b6aa0d43767889eeda43a132cf5e73df4e63bf2
("batman-adv: tvlv - basic infrastructure")
Signed-off-by: Antonio Quartulli <antonio(a)meshcoding.com>
---
v2:
- properly align also the rest of the text
main.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/main.c b/main.c
index 5c5e64b..5ee2abb 100644
--- a/main.c
+++ b/main.c
@@ -1014,10 +1014,10 @@ void batadv_tvlv_ogm_receive(struct batadv_priv *bat_priv,
* payload
* @bat_priv: the bat priv with all the soft interface information
* @optr: ogm tvlv handler callback function. This function receives the orig
- * node, flags and the tvlv content as argument to process.
- * uptr: unicast tvlv handler callback function. This function receives the
- * source & destination of the unicast packet as well as the tvlv content
- * to process.
+ * node, flags and the tvlv content as argument to process.
+ * @uptr: unicast tvlv handler callback function. This function receives the
+ * source & destination of the unicast packet as well as the tvlv content
+ * to process.
* @type: tvlv handler type to be registered
* @version: tvlv handler version to be registered
* @flags: flags to enable or disable TVLV API behavior
--
1.8.1.5
7 years, 5 months
[B.A.T.M.A.N.] [PATCH next] batman-adv: make gw_init() return void
by Antonio Quartulli
gw_init does not return anything other than 0
(despite the kernel doc says something different..).
Change it to void and fix the kernel doc.
Introduced-by 0853ec7fafe0a195754454832993c6b35e22b842
("batman-adv: tvlv - gateway download/upload bandwidth container")
Signed-off-by: Antonio Quartulli <antonio(a)meshcoding.com>
---
gateway_common.c | 5 +----
gateway_common.h | 2 +-
main.c | 4 +---
3 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/gateway_common.c b/gateway_common.c
index 07fd877..ab9a5ac 100644
--- a/gateway_common.c
+++ b/gateway_common.c
@@ -223,15 +223,12 @@ static void batadv_gw_tvlv_ogm_handler_v1(struct batadv_priv *bat_priv,
/**
* batadv_gw_init - initialise the gateway handling internals
* @bat_priv: the bat priv with all the soft interface information
- *
- * Return 0 on success or negative error number in case of failure.
*/
-int batadv_gw_init(struct batadv_priv *bat_priv)
+void batadv_gw_init(struct batadv_priv *bat_priv)
{
batadv_tvlv_handler_register(bat_priv, batadv_gw_tvlv_ogm_handler_v1,
NULL, BATADV_TVLV_GW, 1,
BATADV_TVLV_HANDLER_OGM_CIFNOTFND);
- return 0;
}
/**
diff --git a/gateway_common.h b/gateway_common.h
index f18e8b7..368d50e 100644
--- a/gateway_common.h
+++ b/gateway_common.h
@@ -43,7 +43,7 @@ enum batadv_bandwidth_types {
ssize_t batadv_gw_bandwidth_set(struct net_device *net_dev, char *buff,
size_t count);
void batadv_gw_tvlv_container_update(struct batadv_priv *bat_priv);
-int batadv_gw_init(struct batadv_priv *bat_priv);
+void batadv_gw_init(struct batadv_priv *bat_priv);
void batadv_gw_free(struct batadv_priv *bat_priv);
#endif /* _NET_BATMAN_ADV_GATEWAY_COMMON_H_ */
diff --git a/main.c b/main.c
index 5ee2abb..21c6a01 100644
--- a/main.c
+++ b/main.c
@@ -145,9 +145,7 @@ int batadv_mesh_init(struct net_device *soft_iface)
if (ret < 0)
goto err;
- ret = batadv_gw_init(bat_priv);
- if (ret < 0)
- goto err;
+ batadv_gw_init(bat_priv);
atomic_set(&bat_priv->gw.reselect, 0);
atomic_set(&bat_priv->mesh_state, BATADV_MESH_ACTIVE);
--
1.8.1.5
7 years, 5 months