aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv
Commit message (Collapse)AuthorAgeFilesLines
* update network codemigrate_3.2Wolfgang Wiedmeyer2015-10-2436-1975/+2712
|
* initial merge with 3.2.72Wolfgang Wiedmeyer2015-10-232-0/+1205
|\
| * batman-adv: Only write requested number of byte to user bufferSven Eckelmann2013-03-201-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | commit b5a1eeef04cc7859f34dec9b72ea1b28e4aba07c upstream. Don't write more than the requested number of bytes of an batman-adv icmp packet to the userspace buffer. Otherwise unrelated userspace memory might get overridden by the kernel. Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
| * batman-adv: bat_socket_read missing checksPaul Kot2013-03-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | commit c00b6856fc642b234895cfabd15b289e76726430 upstream. Writing a icmp_packet_rr and then reading icmp_packet can lead to kernel memory corruption, if __user *buf is just below TASK_SIZE. Signed-off-by: Paul Kot <pawlkt@gmail.com> [sven@narfation.org: made it checkpatch clean] Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
| * batman-adv: only drop packets of known wifi clientsMarek Lindner2012-07-041-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 5870adc68fc39d81089f1e80efdf64b97e5c37a1 upstream. bug introduced with 59b699cdee039d75915c354da06937102d1f9a84 If the source or destination mac address of an ethernet packet could not be found in the translation table the packet was dropped if AP isolation was turned on. This behavior would make it impossible to send broadcast packets over the mesh as the broadcast address will never enter the translation table. Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Acked-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
| * batman-adv: fix skb->data assignmentAntonio Quartulli2012-07-041-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 2c995ff892313009e336ecc8ec3411022f5b1c39 upstream. skb_linearize(skb) possibly rearranges the skb internal data and then changes the skb->data pointer value. For this reason any other pointer in the code that was assigned skb->data before invoking skb_linearise(skb) must be re-assigned. In the current tt_query message handling code this is not done and therefore, in case of skb linearization, the pointer used to handle the packet header ends up in pointing to free'd memory. This bug was introduced by a73105b8d4c765d9ebfb664d0a66802127d8e4c7 (batman-adv: improved client announcement mechanism) Signed-off-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: David S. Miller <davem@davemloft.net> [This patch is a backport for kernel versions 3.1 and 3.2 - Antonio] Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
| * batman-adv: delete global entry in case of roamingAntonio Quartulli2011-12-071-3/+18
| | | | | | | | | | | | | | | | | | | | | | When receiving a DEL change for a client due to a roaming event (change is marked with TT_CLIENT_ROAM), each node has to check if the client roamed to itself or somewhere else. In the latter case the global entry is kept to avoid having no route at all otherwise we can safely delete the global entry Signed-off-by: Antonio Quartulli <ordex@autistici.org>
| * batman-adv: in case of roaming mark the client with TT_CLIENT_ROAMAntonio Quartulli2011-12-071-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In case of a client roaming from node A to node B, the latter have to mark the corresponding global entry with TT_CLIENT_ROAM (instead of TT_CLIENT_PENDING). Marking a global entry with TT_CLIENT_PENDING will end up in keeping such entry forever (because this flag is only meant to be used with local entries and it is never checked on global ones). In the worst case (all the clients roaming to the same node A) the local and the global table will contain exactly the same clients. Batman-adv will continue to work, but the memory usage is duplicated. Signed-off-by: Antonio Quartulli <ordex@autistici.org>
| * Merge branch 'batman-adv/maint' of git://git.open-mesh.org/linux-mergeDavid S. Miller2011-10-302-3/+18
| |\
| | * batman-adv: unify hash_entry field position in tt_local/global_entryAntonio Quartulli2011-10-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Function tt_response_fill_table() actually uses a tt_local_entry pointer to iterate either over the local or the global table entries (it depends on the what hash table is passed as argument). To iterate over such entries the hlist_for_each_entry_rcu() macro has to access their "hash_entry" field which MUST be at the same position in both the tt_global/local_entry structures. Reported-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
| | * batman-adv: add sanity check when removing global ttsSimon Wunderlich2011-10-251-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After removing the batman-adv module, the hash may be already gone when tt_global_del_orig() tries to clean the hash. This patch adds a sanity check to avoid this. Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Tested-by: Alexey Fisher <bug-track@fisher-privat.net> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
| | * batman-adv: remove references for global tt entriesSimon Wunderlich2011-10-251-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | struct tt_global_entry holds a reference to an orig_node which must be decremented before deallocating the structure. Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Tested-by: Alexey Fisher <bug-track@fisher-privat.net> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
| * | Merge branch 'master' of ra.kernel.org:/pub/scm/linux/kernel/git/davem/netDavid S. Miller2011-10-241-1/+6
| |\ \ | | |/
| | * batman-adv: correctly set the data field in the TT_REPONSE packetAntonio Quartulli2011-10-181-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the TT_RESPONSE packet, the number of carried entries is not correctly set. This leads to a wrong interpretation of the packet payload on the receiver side causing random entries to be added to the global translation table. Therefore the latter gets always corrupted, triggering a table recovery all the time. Signed-off-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
| | * batman-adv: fix tt_local_reset_flags() functionAntonio Quartulli2011-10-181-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the counter of tt_local_entry structures (tt_local_num) is incremented each time the tt_local_reset_flags() is invoked causing the node to send wrong TT_REPONSE packets containing a copy of non-initialised memory thus corrupting other nodes global translation table and making higher level communication impossible. Reported-by: Junkeun Song <jun361@gmail.com> Signed-off-by: Antonio Quartulli <ordex@autistici.org> Acked-by: Junkeun Song <jun361@gmail.com> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
| * | Merge branch 'master' of github.com:davem330/netDavid S. Miller2011-10-071-5/+5
| |\ \ | | |/ | | | | | | | | | Conflicts: net/batman-adv/soft-interface.c
| | * batman-adv: do_bcast has to be true for broadcast packets onlyAntonio Quartulli2011-09-221-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | corrects a critical bug of the GW feature. This bug made all the unicast packets destined to a GW to be sent as broadcast. This bug is present even if the sender GW feature is configured as OFF. It's an urgent bug fix and should be committed as soon as possible. This was a regression introduced by 43676ab590c3f8686fd047d34c3e33803eef71f0 Signed-off-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
| * | batman-adv: Remove unnecessary OOM logging messagesJoe Perches2011-09-085-24/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Removing unnecessary messages saves code and text. Site specific OOM messages are duplications of a generic MM out of memory message and aren't really useful, so just delete them. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
| * | batman-adv: update internal version numberSven Eckelmann2011-09-081-1/+1
| | | | | | | | | | | | | | | Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
| * | batman-adv: agglomerate all batman iv ogm sending functions in the batman iv ↵Marek Lindner2011-09-088-599/+522
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | file In the process the batman iv OGM aggregation code could be merged into the batman iv code base which makes the separate aggregation files superfluous. Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
| * | batman-adv: move routing packet initialization into corresponding fileMarek Lindner2011-09-083-32/+46
| | | | | | | | | | | | Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
| * | batman-adv: agglomerate all batman iv ogm processing functions in a single fileMarek Lindner2011-09-089-634/+698
| | | | | | | | | | | | | | | | | | | | | In preparation of the upcoming improved routing algorithm the code based has to be re-organized to allow choosing the routing algorithm at compile time. Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
| * | batman-adv: rename all instances of batman_packet to batman_ogm_packetMarek Lindner2011-09-089-182/+204
| | | | | | | | | | | | | | | | | | | | | The follow-up routing code changes are going to introduce additional routing packet types which make this distinction necessary. Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
| * | batman-adv: merge update_transtable() into tt related codeMarek Lindner2011-08-223-74/+70
| | | | | | | | | | | | Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
| * | batman-adv: reuse tt_len() to calculate tt buffer lengthMarek Lindner2011-08-221-2/+1
| | | | | | | | | | | | | | | Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Acked-by: Antonio Quartulli <ordex@autistici.org>
| * | batman-adv: print client flags in the local/global transtables outputAntonio Quartulli2011-08-221-10/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | Since clients can have several flags on or off, this patches make them appear in the local/global transtable output so that they can be checked for debugging purposes. Signed-off-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
| * | batman-adv: implement AP-isolation on the sender sideAntonio Quartulli2011-08-225-12/+29
| | | | | | | | | | | | | | | | | | | | | | | | If a node has to send a packet issued by a WIFI client to another WIFI client, the packet is dropped. Signed-off-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
| * | batman-adv: implement AP-isolation on the receiver sideAntonio Quartulli2011-08-225-0/+50
| | | | | | | | | | | | | | | | | | | | | | | | When a node receives a unicast packet it checks if the source and the destination client can communicate or not due to the AP isolation Signed-off-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
| * | batman-adv: detect clients connected through a 802.11 deviceAntonio Quartulli2011-08-229-11/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | Clients connected through a 802.11 device are now marked with the TT_CLIENT_WIFI flag. This flag is also advertised with the tt announcement. Signed-off-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
| * | batman-adv: correct several typ0s in the commentsAntonio Quartulli2011-08-2212-37/+36
| | | | | | | | | | | | | | | | | | | | | Several typos have been corrected and some sentences have been rephrased Signed-off-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
| * | batman-adv: hash_add() has to discriminate on the return valueAntonio Quartulli2011-08-223-9/+22
| |/ | | | | | | | | | | | | | | | | | | hash_add() returns 0 on success while returns -1 either on error and on entry already present. The caller could use such information to select its behaviour. For this reason it is useful that hash_add() returns -1 in case on error and returns 1 in case of entry already present. Signed-off-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
| * netdevice: Kill 'feature' test macros.David S. Miller2011-07-121-16/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Almost all of these have long outstayed their welcome. And for every one of these macros, there are 10 features for which we didn't add macros. Let's just delete them all, and get out of habit of doing things this way. Signed-off-by: David S. Miller <davem@davemloft.net> Acked-by: Stephen Hemminger <shemminger@vyatta.com> Acked-by: Arnd Bergmann <arnd@arndb.de>
| * Merge branch 'batman-adv/next' of git://git.open-mesh.org/linux-mergeDavid S. Miller2011-07-086-32/+147
| |\
| | * batman-adv: request the full table if tt_crc doesn't matchAntonio Quartulli2011-07-071-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | In case of tt_crc mismatching for a certain orig_node after applying the changes, the node must request the full table immediately. Signed-off-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
| | * batman-adv: keep global table consistency in case of roamingAntonio Quartulli2011-07-071-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To keep consistency of other originator tables, new clients detected as roamed, are kept in the global table but are marked as TT_CLIENT_PENDING They are purged only when the new ttvn is received by the corresponding originator. Moreover they need to be considered as removed in case of global transtable lookup. Signed-off-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
| | * batman-adv: keep local table consistency for further TT_RESPONSEAntonio Quartulli2011-07-074-30/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To keep transtable consistency among all the nodes, an originator must not send not yet announced clients within a full table TT_RESPONSE. Instead, deleted client have to be kept in the table in order to be sent within an immediate TT_RESPONSE. In this way all the nodes in the network will always provide the same response for the same request. All the modification are committed at the next ttvn increment event. Signed-off-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
| | * batman-adv: initialise last_ttvn and tt_crc for the orig_node structureAntonio Quartulli2011-07-071-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | The last_ttvn and tt_crc fields of the orig_node structure were not initialised causing an immediate TT_REQ/RES dialogue even if not needed. Signed-off-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
| * | Merge branch 'batman-adv/next' of git://git.open-mesh.org/linux-mergeDavid S. Miller2011-07-0513-59/+71
| |\ \ | | |/
| | * batman-adv: Replace version info instead of appending themSven Eckelmann2011-07-054-21/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The version number of modules build outside of the tree can get revision numbers added. This is useful to give hints about the revision of a distribution package and the used patchset. The prepended source number or branch name doesn't add any additional information which would help to identify problems and can therefore be omitted. Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
| | * batman-adv: aggregation checks should use the primary_if pointerMarek Lindner2011-07-051-5/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The packet aggregation needs to ensure that only compatible packets are aggregated. Some of the checks are based on the interface number while assuming that the first interface also is the primary interface which is not always the case. This patch addresses the issue by using the primary_if pointer. Reported-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
| | * batman-adv: broadcast primary OGM on all active hard-interfacesMarek Lindner2011-07-051-4/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The primary interface OGM has to be broadcasted on all hard-interfaces even if the primary interface is not the first interface (if_num = 0). Therefore the code has to compare the originating interface with the primary interface instead of checking the if_num. Reported-by: Linus Luessing <linus.luessing@web.de> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
| | * batman-adv: pass a unique flag arg instead of a sequence of bool onesAntonio Quartulli2011-07-051-11/+10
| | | | | | | | | | | | | | | | | | | | | | | | now tt_local_event() takes a flags argument instead of a sequence of boolean values which would grow up with the time. Signed-off-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
| | * batman-adv: add_bcast_packet_to_list() takes the sending delay as parameterAntonio Quartulli2011-07-054-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | In order to make possible to use the broadcast list for delayed sendings the "delay" parameter is now provided instead of using 1 as hardcoded value. Signed-off-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
| | * batman-adv: unify flags for tt_change/tt_local_entry/tt_global_entryAntonio Quartulli2011-07-054-15/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The tt_local_entry structure now has a 'flags' field. This helps to unify the flags format to all the client related structures (tt_global_entry and tt_change). The 'never_purge' field is now encoded in the 'flags' one. To optimise the usage of this field, its length has been increased to 16bit in order to use the eight leading bits (from 0 to 7) to store flags that have to be sent on the wire, while the eight ending ones are used for local computation only. Moreover 'enum tt_change_flags' is now called 'enum tt_client_flags' and the defined values apply to the tt_local_entry, tt_global_entry and the tt_change 'flags' field. Signed-off-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
| * | Merge branch 'batman-adv/next' of git://git.open-mesh.org/ecsv/linux-mergeDavid S. Miller2011-06-2027-462/+2080
| |\ \ | | |/
| | * batman-adv: improved gateway tq-based selectionAntonio Quartulli2011-06-204-6/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a client issues a DHCPREQUEST for renewal, the packet is dropped if the old destination (the old gateway for the client) TQ is smaller than the current best gateway TQ less GW_THRESHOLD Signed-off-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Sven Eckelmann <sven@narfation.org>
| | * batman-adv: throw uevent in userspace on gateway add/change/del eventAntonio Quartulli2011-06-201-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In case of new default gw, changing the default gw or deleting the default gw a uevent is triggered with type=gw, action=add/change/del and data={GW_ORIG_ADDRESS} (if any). Signed-off-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Sven Eckelmann <sven@narfation.org>
| | * batman-adv: gateway election code refactoringAntonio Quartulli2011-06-203-56/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The gateway election mechanism has been a little revised. Now the gw_election is trigered by an atomic_t flag (gw_reselect) which is set to 1 in case of election needed, avoding to set curr_gw to NULL. Signed-off-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Sven Eckelmann <sven@narfation.org>
| | * batman-adv: add wrapper function to throw uevent in userspaceAntonio Quartulli2011-06-203-0/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using throw_uevent() is now possible to trigger uevent signal that can be recognised in userspace. Uevents will be triggered through the /devices/virtual/net/{MESH_IFACE} kobject. A triggered uevent has three properties: - type: the event class. Who generates the event (only 'gw' is currently defined). Corresponds to the BATTYPE uevent variable. - action: the associated action with the event ('add'/'change'/'del' are currently defined). Corresponds to the BATACTION uevent variable. - data: any useful data for the userspace. Corresponds to the BATDATA uevent variable. Signed-off-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: Sven Eckelmann <sven@narfation.org>
| | * batman-adv: protect the local and the global trans-tables with rcuAntonio Quartulli2011-06-205-128/+150
| | | | | | | | | | | | | | | | | | | | | | | | | | | The local and the global translation-tables are now lock free and rcu protected. Signed-off-by: Antonio Quartulli <ordex@autistici.org> Acked-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Sven Eckelmann <sven@narfation.org>