lists.open-mesh.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2023
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
List overview
Download
commits
March 2018
----- 2023 -----
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
commits@lists.open-mesh.org
1 participants
46 discussions
Start a n
N
ew thread
[batman-adv] master's head updated: Merge branch 'maint' (aa58799)
by postmaster@open-mesh.org
Repository : ssh://git@open-mesh.org/batman-adv Branch 'master' now includes: a155327 batman-adv: Only provide (READ|WRITE)_ONCE when undefined 64d22c7 batman-adv: update data pointers after skb_cow() 7dfe729 batman-adv: fix header size check in batadv_dbg_arp() ce9e5e7 batman-adv: do bulk POLL* -> EPOLL* replacement dd32b0e batman-adv: Add missing include for EPOLL* constants fb91b0e batman-adv: Fix skbuff rcsum on packet reroute aa58799 Merge branch 'maint'
5 years
1
0
0
0
[batman-adv] master: Merge branch 'maint' (aa58799)
by postmaster@open-mesh.org
Repository : ssh://git@open-mesh.org/batman-adv On branch : master >--------------------------------------------------------------- commit aa58799a43140012e284ef907d3123c40d26281c Merge: 53c58c1 fb91b0e Author: Sven Eckelmann <sven(a)narfation.org> Date: Mon Mar 19 14:25:03 2018 +0100 Merge branch 'maint' >--------------------------------------------------------------- aa58799a43140012e284ef907d3123c40d26281c compat-include/linux/compiler.h | 4 +++ compat-include/linux/{export.h => eventpoll.h} | 12 ++++----- compat-include/linux/skbuff.h | 12 +++++++++ .../uapi/linux/{nl80211.h => eventpoll.h} | 31 ++++++++++++++-------- compat-sources/net/core/skbuff.c | 17 ------------ net/batman-adv/distributed-arp-table.c | 2 +- net/batman-adv/icmp_socket.c | 3 ++- net/batman-adv/log.c | 3 ++- net/batman-adv/routing.c | 25 ++++++++++------- 9 files changed, 62 insertions(+), 47 deletions(-)
5 years
1
0
0
0
[batman-adv] maint, master: batman-adv: Fix skbuff rcsum on packet reroute (fb91b0e)
by postmaster@open-mesh.org
Repository : ssh://git@open-mesh.org/batman-adv On branches: maint,master >--------------------------------------------------------------- commit fb91b0ef84738102807e5dd7ec0b3565415aff56 Author: Sven Eckelmann <sven(a)narfation.org> Date: Sun Mar 18 13:12:01 2018 +0100 batman-adv: Fix skbuff rcsum on packet reroute batadv_check_unicast_ttvn may redirect a packet to itself or another originator. This involves rewriting the ttvn and the destination address in the batadv unicast header. These field were not yet pulled (with skb rcsum update) and thus any change to them also requires a change in the receive checksum. Reported-by: Matthias Schiffer <mschiffer(a)universe-factory.net> Fixes: cea194d90b11 ("batman-adv: improved client announcement mechanism") Signed-off-by: Sven Eckelmann <sven(a)narfation.org> >--------------------------------------------------------------- fb91b0ef84738102807e5dd7ec0b3565415aff56 compat-include/linux/skbuff.h | 12 ++++++++++++ compat-sources/net/core/skbuff.c | 17 ----------------- net/batman-adv/routing.c | 15 ++++++++++----- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/compat-include/linux/skbuff.h b/compat-include/linux/skbuff.h index 1983dbe..6f73946 100644 --- a/compat-include/linux/skbuff.h +++ b/compat-include/linux/skbuff.h @@ -77,6 +77,18 @@ struct sk_buff *skb_checksum_trimmed(struct sk_buff *skb, #endif /* < KERNEL_VERSION(4, 2, 0) */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0) + +static inline void skb_postpush_rcsum(struct sk_buff *skb, + const void *start, unsigned int len) +{ + if (skb->ip_summed == CHECKSUM_COMPLETE) + skb->csum = csum_block_add(skb->csum, + csum_partial(start, len, 0), 0); +} + +#endif /* < KERNEL_VERSION(4, 5, 0) */ + #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 13, 0) static inline void *batadv_skb_put(struct sk_buff *skb, unsigned int len) diff --git a/compat-sources/net/core/skbuff.c b/compat-sources/net/core/skbuff.c index 3827f5c..30fbfbf 100644 --- a/compat-sources/net/core/skbuff.c +++ b/compat-sources/net/core/skbuff.c @@ -93,23 +93,6 @@ skb_checksum_validate(struct sk_buff *skb, int proto, #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 2, 0) -static inline void skb_postpush_rcsum(struct sk_buff *skb, - const void *start, unsigned int len) -{ - /* For performing the reverse operation to skb_postpull_rcsum(), - * we can instead of ... - * - * skb->csum = csum_add(skb->csum, csum_partial(start, len, 0)); - * - * ... just use this equivalent version here to save a few - * instructions. Feeding csum of 0 in csum_partial() and later - * on adding skb->csum is equivalent to feed skb->csum in the - * first place. - */ - if (skb->ip_summed == CHECKSUM_COMPLETE) - skb->csum = csum_partial(start, len, skb->csum); -} - /** * skb_push_rcsum - push skb and update receive checksum * @skb: buffer to update diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c index 0f10c56..cc3ed93 100644 --- a/net/batman-adv/routing.c +++ b/net/batman-adv/routing.c @@ -759,6 +759,7 @@ free_skb: /** * batadv_reroute_unicast_packet() - update the unicast header for re-routing * @bat_priv: the bat priv with all the soft interface information + * @skb: unicast packet to process * @unicast_packet: the unicast header to be updated * @dst_addr: the payload destination * @vid: VLAN identifier @@ -770,7 +771,7 @@ free_skb: * Return: true if the packet header has been updated, false otherwise */ static bool -batadv_reroute_unicast_packet(struct batadv_priv *bat_priv, +batadv_reroute_unicast_packet(struct batadv_priv *bat_priv, struct sk_buff *skb, struct batadv_unicast_packet *unicast_packet, u8 *dst_addr, unsigned short vid) { @@ -799,8 +800,10 @@ batadv_reroute_unicast_packet(struct batadv_priv *bat_priv, } /* update the packet header */ + skb_postpull_rcsum(skb, unicast_packet, sizeof(*unicast_packet)); ether_addr_copy(unicast_packet->dest, orig_addr); unicast_packet->ttvn = orig_ttvn; + skb_postpush_rcsum(skb, unicast_packet, sizeof(*unicast_packet)); ret = true; out: @@ -841,7 +844,7 @@ static bool batadv_check_unicast_ttvn(struct batadv_priv *bat_priv, * the packet to */ if (batadv_tt_local_client_is_roaming(bat_priv, ethhdr->h_dest, vid)) { - if (batadv_reroute_unicast_packet(bat_priv, unicast_packet, + if (batadv_reroute_unicast_packet(bat_priv, skb, unicast_packet, ethhdr->h_dest, vid)) batadv_dbg_ratelimited(BATADV_DBG_TT, bat_priv, @@ -887,7 +890,7 @@ static bool batadv_check_unicast_ttvn(struct batadv_priv *bat_priv, * destination can possibly be updated and forwarded towards the new * target host */ - if (batadv_reroute_unicast_packet(bat_priv, unicast_packet, + if (batadv_reroute_unicast_packet(bat_priv, skb, unicast_packet, ethhdr->h_dest, vid)) { batadv_dbg_ratelimited(BATADV_DBG_TT, bat_priv, "Rerouting unicast packet to %pM (dst=%pM): TTVN mismatch old_ttvn=%u new_ttvn=%u\n", @@ -910,12 +913,14 @@ static bool batadv_check_unicast_ttvn(struct batadv_priv *bat_priv, if (!primary_if) return false; + /* update the packet header */ + skb_postpull_rcsum(skb, unicast_packet, sizeof(*unicast_packet)); ether_addr_copy(unicast_packet->dest, primary_if->net_dev->dev_addr); + unicast_packet->ttvn = curr_ttvn; + skb_postpush_rcsum(skb, unicast_packet, sizeof(*unicast_packet)); batadv_hardif_put(primary_if); - unicast_packet->ttvn = curr_ttvn; - return true; }
5 years
1
0
0
0
[batman-adv] maint: batman-adv: Add missing include for EPOLL* constants (dd32b0e)
by postmaster@open-mesh.org
Repository : ssh://git@open-mesh.org/batman-adv On branch : maint >--------------------------------------------------------------- commit dd32b0e4b5bd3c2bd7f080cb866e10684323b51b Author: Sven Eckelmann <sven(a)narfation.org> Date: Sun Mar 18 09:48:03 2018 +0100 batman-adv: Add missing include for EPOLL* constants Fixes: c2b2dd1a0fa4 ("batman-adv: do bulk POLL* -> EPOLL* replacement") Signed-off-by: Sven Eckelmann <sven(a)narfation.org> >--------------------------------------------------------------- dd32b0e4b5bd3c2bd7f080cb866e10684323b51b net/batman-adv/icmp_socket.c | 1 + net/batman-adv/log.c | 1 + 2 files changed, 2 insertions(+) diff --git a/net/batman-adv/icmp_socket.c b/net/batman-adv/icmp_socket.c index 7d5e9ab..55c358a 100644 --- a/net/batman-adv/icmp_socket.c +++ b/net/batman-adv/icmp_socket.c @@ -24,6 +24,7 @@ #include <linux/debugfs.h> #include <linux/errno.h> #include <linux/etherdevice.h> +#include <linux/eventpoll.h> #include <linux/export.h> #include <linux/fcntl.h> #include <linux/fs.h> diff --git a/net/batman-adv/log.c b/net/batman-adv/log.c index 52d8a4b..853773e 100644 --- a/net/batman-adv/log.c +++ b/net/batman-adv/log.c @@ -22,6 +22,7 @@ #include <linux/compiler.h> #include <linux/debugfs.h> #include <linux/errno.h> +#include <linux/eventpoll.h> #include <linux/export.h> #include <linux/fcntl.h> #include <linux/fs.h>
5 years
1
0
0
0
[batman-adv] maint: batman-adv: do bulk POLL* -> EPOLL* replacement (ce9e5e7)
by postmaster@open-mesh.org
Repository : ssh://git@open-mesh.org/batman-adv On branch : maint >--------------------------------------------------------------- commit ce9e5e7c06c71f98b01704a66e4987a41ae14919 Author: Linus Torvalds <torvalds(a)linux-foundation.org> Date: Sun Feb 11 14:34:03 2018 -0800 batman-adv: do bulk POLL* -> EPOLL* replacement This is the mindless scripted replacement of kernel use of POLL* variables as described by Al, done by this script: for V in IN OUT PRI ERR RDNORM RDBAND WRNORM WRBAND HUP RDHUP NVAL MSG; do L=`git grep -l -w POLL$V | grep -v '^t' | grep -v /um/ | grep -v '^sa' | grep -v '/poll.h$'|grep -v '^D'` for f in $L; do sed -i "-es/^\([^\"]*\)\(\<POLL$V\>\)/\\1E\\2/" $f; done done with de-mangling cleanups yet to come. NOTE! On almost all architectures, the EPOLL* constants have the same values as the POLL* constants do. But they keyword here is "almost". For various bad reasons they aren't the same, and epoll() doesn't actually work quite correctly in some cases due to this on Sparc et al. The next patch from Al will sort out the final differences, and we should be all done. Scripted-by: Al Viro <viro(a)zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds(a)linux-foundation.org> [sven(a)narfation.org: Add compat code] Signed-off-by: Sven Eckelmann <sven(a)narfation.org> >--------------------------------------------------------------- ce9e5e7c06c71f98b01704a66e4987a41ae14919 compat-include/linux/{export.h => eventpoll.h} | 12 ++++----- .../uapi/linux/{nl80211.h => eventpoll.h} | 31 ++++++++++++++-------- net/batman-adv/icmp_socket.c | 2 +- net/batman-adv/log.c | 2 +- 4 files changed, 28 insertions(+), 19 deletions(-) diff --git a/compat-include/linux/export.h b/compat-include/linux/eventpoll.h similarity index 78% copy from compat-include/linux/export.h copy to compat-include/linux/eventpoll.h index 5fb590f..40a7203 100644 --- a/compat-include/linux/export.h +++ b/compat-include/linux/eventpoll.h @@ -19,12 +19,12 @@ * of the Linux kernel. */ -#ifndef _NET_BATMAN_ADV_COMPAT_LINUX_EXPORT_H_ -#define _NET_BATMAN_ADV_COMPAT_LINUX_EXPORT_H_ +#ifndef _NET_BATMAN_ADV_COMPAT_LINUX_EVENTPOLL_H_ +#define _NET_BATMAN_ADV_COMPAT_LINUX_EVENTPOLL_H_ #include <linux/version.h> -#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0) -#include_next <linux/export.h> -#endif +#include_next <linux/eventpoll.h> -#endif /* _NET_BATMAN_ADV_COMPAT_LINUX_EXPORT_H_ */ +#include <uapi/linux/eventpoll.h> + +#endif /* _NET_BATMAN_ADV_COMPAT_LINUX_EVENTPOLL_H_ */ diff --git a/compat-include/uapi/linux/nl80211.h b/compat-include/uapi/linux/eventpoll.h similarity index 50% copy from compat-include/uapi/linux/nl80211.h copy to compat-include/uapi/linux/eventpoll.h index 724ab2a..331687a 100644 --- a/compat-include/uapi/linux/nl80211.h +++ b/compat-include/uapi/linux/eventpoll.h @@ -19,23 +19,32 @@ * of the Linux kernel. */ -#ifndef _NET_BATMAN_ADV_COMPAT_UAPI_LINUX_NL80211_H_ -#define _NET_BATMAN_ADV_COMPAT_UAPI_LINUX_NL80211_H_ +#ifndef _NET_BATMAN_ADV_COMPAT_UAPI_LINUX_EVENTPOLL_H_ +#define _NET_BATMAN_ADV_COMPAT_UAPI_LINUX_EVENTPOLL_H_ #include <linux/version.h> +#include <linux/types.h> #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 7, 0) -#include_next <uapi/linux/nl80211.h> +#include_next <uapi/linux/eventpoll.h> #else -#include <linux/nl80211.h> +#include <linux/eventpoll.h> #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 0, 0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 12, 0) -/* for batadv_v_elp_get_throughput which would have used - * STATION_INFO_EXPECTED_THROUGHPUT in Linux 4.0.0 - */ -#define NL80211_STA_INFO_EXPECTED_THROUGHPUT 28 +#define EPOLLIN (__force __poll_t)0x00000001 +#define EPOLLPRI (__force __poll_t)0x00000002 +#define EPOLLOUT (__force __poll_t)0x00000004 +#define EPOLLERR (__force __poll_t)0x00000008 +#define EPOLLHUP (__force __poll_t)0x00000010 +#define EPOLLNVAL (__force __poll_t)0x00000020 +#define EPOLLRDNORM (__force __poll_t)0x00000040 +#define EPOLLRDBAND (__force __poll_t)0x00000080 +#define EPOLLWRNORM (__force __poll_t)0x00000100 +#define EPOLLWRBAND (__force __poll_t)0x00000200 +#define EPOLLMSG (__force __poll_t)0x00000400 +#define EPOLLRDHUP (__force __poll_t)0x00002000 -#endif /* < KERNEL_VERSION(4, 0, 0) */ +#endif /* < KERNEL_VERSION(4, 12, 0) */ -#endif /* _NET_BATMAN_ADV_COMPAT_UAPI_LINUX_NL80211_H_ */ +#endif /* _NET_BATMAN_ADV_COMPAT_UAPI_LINUX_EVENTPOLL_H_ */ diff --git a/net/batman-adv/icmp_socket.c b/net/batman-adv/icmp_socket.c index 3396414..7d5e9ab 100644 --- a/net/batman-adv/icmp_socket.c +++ b/net/batman-adv/icmp_socket.c @@ -304,7 +304,7 @@ static __poll_t batadv_socket_poll(struct file *file, poll_table *wait) poll_wait(file, &socket_client->queue_wait, wait); if (socket_client->queue_len > 0) - return POLLIN | POLLRDNORM; + return EPOLLIN | EPOLLRDNORM; return 0; } diff --git a/net/batman-adv/log.c b/net/batman-adv/log.c index 0132696..52d8a4b 100644 --- a/net/batman-adv/log.c +++ b/net/batman-adv/log.c @@ -193,7 +193,7 @@ static __poll_t batadv_log_poll(struct file *file, poll_table *wait) poll_wait(file, &debug_log->queue_wait, wait); if (!batadv_log_empty(debug_log)) - return POLLIN | POLLRDNORM; + return EPOLLIN | EPOLLRDNORM; return 0; }
5 years
1
0
0
0
[batman-adv] maint: batman-adv: update data pointers after skb_cow() (64d22c7)
by postmaster@open-mesh.org
Repository : ssh://git@open-mesh.org/batman-adv On branch : maint >--------------------------------------------------------------- commit 64d22c76a207ed313b2496f0709b2567719452c4 Author: Matthias Schiffer <mschiffer(a)universe-factory.net> Date: Fri Mar 16 11:29:09 2018 +0100 batman-adv: update data pointers after skb_cow() batadv_check_unicast_ttvn() calls skb_cow(), so pointers into the SKB data must be (re)set after calling it. The ethhdr variable is dropped altogether. Fixes: 78fc6bbe0aca ("batman-adv: add UNICAST_4ADDR packet type") Signed-off-by: Matthias Schiffer <mschiffer(a)universe-factory.net> Signed-off-by: Sven Eckelmann <sven(a)narfation.org> >--------------------------------------------------------------- 64d22c76a207ed313b2496f0709b2567719452c4 net/batman-adv/routing.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c index 289df02..0f10c56 100644 --- a/net/batman-adv/routing.c +++ b/net/batman-adv/routing.c @@ -968,14 +968,10 @@ int batadv_recv_unicast_packet(struct sk_buff *skb, struct batadv_orig_node *orig_node = NULL, *orig_node_gw = NULL; int check, hdr_size = sizeof(*unicast_packet); enum batadv_subtype subtype; - struct ethhdr *ethhdr; int ret = NET_RX_DROP; bool is4addr, is_gw; unicast_packet = (struct batadv_unicast_packet *)skb->data; - unicast_4addr_packet = (struct batadv_unicast_4addr_packet *)skb->data; - ethhdr = eth_hdr(skb); - is4addr = unicast_packet->packet_type == BATADV_UNICAST_4ADDR; /* the caller function should have already pulled 2 bytes */ if (is4addr) @@ -995,12 +991,14 @@ int batadv_recv_unicast_packet(struct sk_buff *skb, if (!batadv_check_unicast_ttvn(bat_priv, skb, hdr_size)) goto free_skb; + unicast_packet = (struct batadv_unicast_packet *)skb->data; + /* packet for me */ if (batadv_is_my_mac(bat_priv, unicast_packet->dest)) { /* If this is a unicast packet from another backgone gw, * drop it. */ - orig_addr_gw = ethhdr->h_source; + orig_addr_gw = eth_hdr(skb)->h_source; orig_node_gw = batadv_orig_hash_find(bat_priv, orig_addr_gw); if (orig_node_gw) { is_gw = batadv_bla_is_backbone_gw(skb, orig_node_gw, @@ -1015,6 +1013,8 @@ int batadv_recv_unicast_packet(struct sk_buff *skb, } if (is4addr) { + unicast_4addr_packet = + (struct batadv_unicast_4addr_packet *)skb->data; subtype = unicast_4addr_packet->subtype; batadv_dat_inc_counter(bat_priv, subtype);
5 years
1
0
0
0
[batman-adv] maint: batman-adv: fix header size check in batadv_dbg_arp() (7dfe729)
by postmaster@open-mesh.org
Repository : ssh://git@open-mesh.org/batman-adv On branch : maint >--------------------------------------------------------------- commit 7dfe729b169b1217f47744edbd1616f473340fda Author: Matthias Schiffer <mschiffer(a)universe-factory.net> Date: Fri Mar 16 11:29:10 2018 +0100 batman-adv: fix header size check in batadv_dbg_arp() Checking for 0 is insufficient: when an SKB without a batadv header, but with a VLAN header is received, hdr_size will be 4, making the following code interpret the Ethernet header as a batadv header. Fixes: 3e26722bc9f2 ("batman-adv: make the Distributed ARP Table vlan aware") Signed-off-by: Matthias Schiffer <mschiffer(a)universe-factory.net> Signed-off-by: Sven Eckelmann <sven(a)narfation.org> >--------------------------------------------------------------- 7dfe729b169b1217f47744edbd1616f473340fda net/batman-adv/distributed-arp-table.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/batman-adv/distributed-arp-table.c b/net/batman-adv/distributed-arp-table.c index 19b15de..b7ca4a3 100644 --- a/net/batman-adv/distributed-arp-table.c +++ b/net/batman-adv/distributed-arp-table.c @@ -393,7 +393,7 @@ static void batadv_dbg_arp(struct batadv_priv *bat_priv, struct sk_buff *skb, batadv_arp_hw_src(skb, hdr_size), &ip_src, batadv_arp_hw_dst(skb, hdr_size), &ip_dst); - if (hdr_size == 0) + if (hdr_size < sizeof(struct batadv_unicast_packet)) return; unicast_4addr_packet = (struct batadv_unicast_4addr_packet *)skb->data;
5 years
1
0
0
0
[alfred] master: alfred: add multicast flags netlink support (47c3456)
by postmaster@open-mesh.org
Repository : ssh://git@open-mesh.org/alfred On branch : master >--------------------------------------------------------------- commit 47c3456282ba5ad9f9b4f1e4eb43d6172a7a6ae2 Author: Linus Lüssing <linus.luessing(a)c0d3.blue> Date: Tue Mar 13 11:43:57 2018 +0100 alfred: add multicast flags netlink support Dump the list of multicast flags entries via the netlink socket. Signed-off-by: Linus Lüssing <linus.luessing(a)c0d3.blue> Signed-off-by: Sven Eckelmann <sven(a)narfation.org> >--------------------------------------------------------------- 47c3456282ba5ad9f9b4f1e4eb43d6172a7a6ae2 batman_adv.h | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ netlink.c | 2 ++ 2 files changed, 64 insertions(+) diff --git a/batman_adv.h b/batman_adv.h index 95ab5db..324a0e1 100644 --- a/batman_adv.h +++ b/batman_adv.h @@ -92,6 +92,53 @@ enum batadv_tt_client_flags { }; /** + * enum batadv_mcast_flags_priv - Private, own multicast flags + * + * These are internal, multicast related flags. Currently they describe certain + * multicast related attributes of the segment this originator bridges into the + * mesh. + * + * Those attributes are used to determine the public multicast flags this + * originator is going to announce via TT. + * + * For netlink, if BATADV_MCAST_FLAGS_BRIDGED is unset then all querier + * related flags are undefined. + */ +enum batadv_mcast_flags_priv { + /** + * @BATADV_MCAST_FLAGS_BRIDGED: There is a bridge on top of the mesh + * interface. + */ + BATADV_MCAST_FLAGS_BRIDGED = (1 << 0), + + /** + * @BATADV_MCAST_FLAGS_QUERIER_IPV4_EXISTS: Whether an IGMP querier + * exists in the mesh + */ + BATADV_MCAST_FLAGS_QUERIER_IPV4_EXISTS = (1 << 1), + + /** + * @BATADV_MCAST_FLAGS_QUERIER_IPV6_EXISTS: Whether an MLD querier + * exists in the mesh + */ + BATADV_MCAST_FLAGS_QUERIER_IPV6_EXISTS = (1 << 2), + + /** + * @BATADV_MCAST_FLAGS_QUERIER_IPV4_SHADOWING: If an IGMP querier + * exists, whether it is potentially shadowing multicast listeners + * (i.e. querier is behind our own bridge segment) + */ + BATADV_MCAST_FLAGS_QUERIER_IPV4_SHADOWING = (1 << 3), + + /** + * @BATADV_MCAST_FLAGS_QUERIER_IPV6_SHADOWING: If an MLD querier + * exists, whether it is potentially shadowing multicast listeners + * (i.e. querier is behind our own bridge segment) + */ + BATADV_MCAST_FLAGS_QUERIER_IPV6_SHADOWING = (1 << 4), +}; + +/** * enum batadv_nl_attrs - batman-adv netlink attributes */ enum batadv_nl_attrs { @@ -287,6 +334,16 @@ enum batadv_nl_attrs { */ BATADV_ATTR_DAT_CACHE_VID, + /** + * @BATADV_ATTR_MCAST_FLAGS: Per originator multicast flags + */ + BATADV_ATTR_MCAST_FLAGS, + + /** + * @BATADV_ATTR_MCAST_FLAGS_PRIV: Private, own multicast flags + */ + BATADV_ATTR_MCAST_FLAGS_PRIV, + /* add attributes above here, update the policy in netlink.c */ /** @@ -381,6 +438,11 @@ enum batadv_nl_commands { */ BATADV_CMD_GET_DAT_CACHE, + /** + * @BATADV_CMD_GET_MCAST_FLAGS: Query list of multicast flags + */ + BATADV_CMD_GET_MCAST_FLAGS, + /* add new commands above here */ /** diff --git a/netlink.c b/netlink.c index 2cd361f..864123f 100644 --- a/netlink.c +++ b/netlink.c @@ -98,6 +98,8 @@ struct nla_policy batadv_netlink_policy[NUM_BATADV_ATTR] = { .minlen = ETH_ALEN, .maxlen = ETH_ALEN }, [BATADV_ATTR_DAT_CACHE_VID] = { .type = NLA_U16 }, + [BATADV_ATTR_MCAST_FLAGS] = { .type = NLA_U32 }, + [BATADV_ATTR_MCAST_FLAGS_PRIV] = { .type = NLA_U32 }, }; int missing_mandatory_attrs(struct nlattr *attrs[], const int mandatory[],
5 years
1
0
0
0
[alfred] master: alfred: add DAT cache netlink support (30a3656)
by postmaster@open-mesh.org
Repository : ssh://git@open-mesh.org/alfred On branch : master >--------------------------------------------------------------- commit 30a3656f9d4786988293bc0592ee30173226acf3 Author: Linus Lüssing <linus.luessing(a)c0d3.blue> Date: Tue Mar 13 11:43:55 2018 +0100 alfred: add DAT cache netlink support Dump the list of DAT cache entries via the netlink socket. Signed-off-by: Linus Lüssing <linus.luessing(a)c0d3.blue> Signed-off-by: Sven Eckelmann <sven(a)narfation.org> >--------------------------------------------------------------- 30a3656f9d4786988293bc0592ee30173226acf3 batman_adv.h | 20 +++++++++++ netlink.c | 109 +++++++++++++++++++++++++++++++---------------------------- 2 files changed, 77 insertions(+), 52 deletions(-) diff --git a/batman_adv.h b/batman_adv.h index 56ae289..95ab5db 100644 --- a/batman_adv.h +++ b/batman_adv.h @@ -272,6 +272,21 @@ enum batadv_nl_attrs { */ BATADV_ATTR_BLA_CRC, + /** + * @BATADV_ATTR_DAT_CACHE_IP4ADDRESS: Client IPv4 address + */ + BATADV_ATTR_DAT_CACHE_IP4ADDRESS, + + /** + * @BATADV_ATTR_DAT_CACHE_HWADDRESS: Client MAC address + */ + BATADV_ATTR_DAT_CACHE_HWADDRESS, + + /** + * @BATADV_ATTR_DAT_CACHE_VID: VLAN ID + */ + BATADV_ATTR_DAT_CACHE_VID, + /* add attributes above here, update the policy in netlink.c */ /** @@ -361,6 +376,11 @@ enum batadv_nl_commands { */ BATADV_CMD_GET_BLA_BACKBONE, + /** + * @BATADV_CMD_GET_DAT_CACHE: Query list of DAT cache entries + */ + BATADV_CMD_GET_DAT_CACHE, + /* add new commands above here */ /** diff --git a/netlink.c b/netlink.c index fa34306..2cd361f 100644 --- a/netlink.c +++ b/netlink.c @@ -41,58 +41,63 @@ #endif struct nla_policy batadv_netlink_policy[NUM_BATADV_ATTR] = { - [BATADV_ATTR_VERSION] = { .type = NLA_STRING }, - [BATADV_ATTR_ALGO_NAME] = { .type = NLA_STRING }, - [BATADV_ATTR_MESH_IFINDEX] = { .type = NLA_U32 }, - [BATADV_ATTR_MESH_IFNAME] = { .type = NLA_STRING, - .maxlen = IFNAMSIZ }, - [BATADV_ATTR_MESH_ADDRESS] = { .type = NLA_UNSPEC, - .minlen = ETH_ALEN, - .maxlen = ETH_ALEN }, - [BATADV_ATTR_HARD_IFINDEX] = { .type = NLA_U32 }, - [BATADV_ATTR_HARD_IFNAME] = { .type = NLA_STRING, - .maxlen = IFNAMSIZ }, - [BATADV_ATTR_HARD_ADDRESS] = { .type = NLA_UNSPEC, - .minlen = ETH_ALEN, - .maxlen = ETH_ALEN }, - [BATADV_ATTR_ORIG_ADDRESS] = { .type = NLA_UNSPEC, - .minlen = ETH_ALEN, - .maxlen = ETH_ALEN }, - [BATADV_ATTR_TPMETER_RESULT] = { .type = NLA_U8 }, - [BATADV_ATTR_TPMETER_TEST_TIME] = { .type = NLA_U32 }, - [BATADV_ATTR_TPMETER_BYTES] = { .type = NLA_U64 }, - [BATADV_ATTR_TPMETER_COOKIE] = { .type = NLA_U32 }, - [BATADV_ATTR_PAD] = { .type = NLA_UNSPEC }, - [BATADV_ATTR_ACTIVE] = { .type = NLA_FLAG }, - [BATADV_ATTR_TT_ADDRESS] = { .type = NLA_UNSPEC, - .minlen = ETH_ALEN, - .maxlen = ETH_ALEN }, - [BATADV_ATTR_TT_TTVN] = { .type = NLA_U8 }, - [BATADV_ATTR_TT_LAST_TTVN] = { .type = NLA_U8 }, - [BATADV_ATTR_TT_CRC32] = { .type = NLA_U32 }, - [BATADV_ATTR_TT_VID] = { .type = NLA_U16 }, - [BATADV_ATTR_TT_FLAGS] = { .type = NLA_U32 }, - [BATADV_ATTR_FLAG_BEST] = { .type = NLA_FLAG }, - [BATADV_ATTR_LAST_SEEN_MSECS] = { .type = NLA_U32 }, - [BATADV_ATTR_NEIGH_ADDRESS] = { .type = NLA_UNSPEC, - .minlen = ETH_ALEN, - .maxlen = ETH_ALEN }, - [BATADV_ATTR_TQ] = { .type = NLA_U8 }, - [BATADV_ATTR_THROUGHPUT] = { .type = NLA_U32 }, - [BATADV_ATTR_BANDWIDTH_UP] = { .type = NLA_U32 }, - [BATADV_ATTR_BANDWIDTH_DOWN] = { .type = NLA_U32 }, - [BATADV_ATTR_ROUTER] = { .type = NLA_UNSPEC, - .minlen = ETH_ALEN, - .maxlen = ETH_ALEN }, - [BATADV_ATTR_BLA_OWN] = { .type = NLA_FLAG }, - [BATADV_ATTR_BLA_ADDRESS] = { .type = NLA_UNSPEC, - .minlen = ETH_ALEN, - .maxlen = ETH_ALEN }, - [BATADV_ATTR_BLA_VID] = { .type = NLA_U16 }, - [BATADV_ATTR_BLA_BACKBONE] = { .type = NLA_UNSPEC, - .minlen = ETH_ALEN, - .maxlen = ETH_ALEN }, - [BATADV_ATTR_BLA_CRC] = { .type = NLA_U16 }, + [BATADV_ATTR_VERSION] = { .type = NLA_STRING }, + [BATADV_ATTR_ALGO_NAME] = { .type = NLA_STRING }, + [BATADV_ATTR_MESH_IFINDEX] = { .type = NLA_U32 }, + [BATADV_ATTR_MESH_IFNAME] = { .type = NLA_STRING, + .maxlen = IFNAMSIZ }, + [BATADV_ATTR_MESH_ADDRESS] = { .type = NLA_UNSPEC, + .minlen = ETH_ALEN, + .maxlen = ETH_ALEN }, + [BATADV_ATTR_HARD_IFINDEX] = { .type = NLA_U32 }, + [BATADV_ATTR_HARD_IFNAME] = { .type = NLA_STRING, + .maxlen = IFNAMSIZ }, + [BATADV_ATTR_HARD_ADDRESS] = { .type = NLA_UNSPEC, + .minlen = ETH_ALEN, + .maxlen = ETH_ALEN }, + [BATADV_ATTR_ORIG_ADDRESS] = { .type = NLA_UNSPEC, + .minlen = ETH_ALEN, + .maxlen = ETH_ALEN }, + [BATADV_ATTR_TPMETER_RESULT] = { .type = NLA_U8 }, + [BATADV_ATTR_TPMETER_TEST_TIME] = { .type = NLA_U32 }, + [BATADV_ATTR_TPMETER_BYTES] = { .type = NLA_U64 }, + [BATADV_ATTR_TPMETER_COOKIE] = { .type = NLA_U32 }, + [BATADV_ATTR_PAD] = { .type = NLA_UNSPEC }, + [BATADV_ATTR_ACTIVE] = { .type = NLA_FLAG }, + [BATADV_ATTR_TT_ADDRESS] = { .type = NLA_UNSPEC, + .minlen = ETH_ALEN, + .maxlen = ETH_ALEN }, + [BATADV_ATTR_TT_TTVN] = { .type = NLA_U8 }, + [BATADV_ATTR_TT_LAST_TTVN] = { .type = NLA_U8 }, + [BATADV_ATTR_TT_CRC32] = { .type = NLA_U32 }, + [BATADV_ATTR_TT_VID] = { .type = NLA_U16 }, + [BATADV_ATTR_TT_FLAGS] = { .type = NLA_U32 }, + [BATADV_ATTR_FLAG_BEST] = { .type = NLA_FLAG }, + [BATADV_ATTR_LAST_SEEN_MSECS] = { .type = NLA_U32 }, + [BATADV_ATTR_NEIGH_ADDRESS] = { .type = NLA_UNSPEC, + .minlen = ETH_ALEN, + .maxlen = ETH_ALEN }, + [BATADV_ATTR_TQ] = { .type = NLA_U8 }, + [BATADV_ATTR_THROUGHPUT] = { .type = NLA_U32 }, + [BATADV_ATTR_BANDWIDTH_UP] = { .type = NLA_U32 }, + [BATADV_ATTR_BANDWIDTH_DOWN] = { .type = NLA_U32 }, + [BATADV_ATTR_ROUTER] = { .type = NLA_UNSPEC, + .minlen = ETH_ALEN, + .maxlen = ETH_ALEN }, + [BATADV_ATTR_BLA_OWN] = { .type = NLA_FLAG }, + [BATADV_ATTR_BLA_ADDRESS] = { .type = NLA_UNSPEC, + .minlen = ETH_ALEN, + .maxlen = ETH_ALEN }, + [BATADV_ATTR_BLA_VID] = { .type = NLA_U16 }, + [BATADV_ATTR_BLA_BACKBONE] = { .type = NLA_UNSPEC, + .minlen = ETH_ALEN, + .maxlen = ETH_ALEN }, + [BATADV_ATTR_BLA_CRC] = { .type = NLA_U16 }, + [BATADV_ATTR_DAT_CACHE_IP4ADDRESS] = { .type = NLA_U32 }, + [BATADV_ATTR_DAT_CACHE_HWADDRESS] = { .type = NLA_UNSPEC, + .minlen = ETH_ALEN, + .maxlen = ETH_ALEN }, + [BATADV_ATTR_DAT_CACHE_VID] = { .type = NLA_U16 }, }; int missing_mandatory_attrs(struct nlattr *attrs[], const int mandatory[],
5 years
1
0
0
0
[batctl] master: batctl: add multicast flags netlink support (c1bb431)
by postmaster@open-mesh.org
Repository : ssh://git@open-mesh.org/batctl On branch : master >--------------------------------------------------------------- commit c1bb431577f1b2a4250a780f9c29355eb3694ff9 Author: Linus Lüssing <linus.luessing(a)c0d3.blue> Date: Tue Mar 13 11:43:57 2018 +0100 batctl: add multicast flags netlink support Dump the list of multicast flags entries via the netlink socket. Signed-off-by: Linus Lüssing <linus.luessing(a)c0d3.blue> Signed-off-by: Sven Eckelmann <sven(a)narfation.org> >--------------------------------------------------------------- c1bb431577f1b2a4250a780f9c29355eb3694ff9 batman_adv.h | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/batman_adv.h b/batman_adv.h index 95ab5db..324a0e1 100644 --- a/batman_adv.h +++ b/batman_adv.h @@ -92,6 +92,53 @@ enum batadv_tt_client_flags { }; /** + * enum batadv_mcast_flags_priv - Private, own multicast flags + * + * These are internal, multicast related flags. Currently they describe certain + * multicast related attributes of the segment this originator bridges into the + * mesh. + * + * Those attributes are used to determine the public multicast flags this + * originator is going to announce via TT. + * + * For netlink, if BATADV_MCAST_FLAGS_BRIDGED is unset then all querier + * related flags are undefined. + */ +enum batadv_mcast_flags_priv { + /** + * @BATADV_MCAST_FLAGS_BRIDGED: There is a bridge on top of the mesh + * interface. + */ + BATADV_MCAST_FLAGS_BRIDGED = (1 << 0), + + /** + * @BATADV_MCAST_FLAGS_QUERIER_IPV4_EXISTS: Whether an IGMP querier + * exists in the mesh + */ + BATADV_MCAST_FLAGS_QUERIER_IPV4_EXISTS = (1 << 1), + + /** + * @BATADV_MCAST_FLAGS_QUERIER_IPV6_EXISTS: Whether an MLD querier + * exists in the mesh + */ + BATADV_MCAST_FLAGS_QUERIER_IPV6_EXISTS = (1 << 2), + + /** + * @BATADV_MCAST_FLAGS_QUERIER_IPV4_SHADOWING: If an IGMP querier + * exists, whether it is potentially shadowing multicast listeners + * (i.e. querier is behind our own bridge segment) + */ + BATADV_MCAST_FLAGS_QUERIER_IPV4_SHADOWING = (1 << 3), + + /** + * @BATADV_MCAST_FLAGS_QUERIER_IPV6_SHADOWING: If an MLD querier + * exists, whether it is potentially shadowing multicast listeners + * (i.e. querier is behind our own bridge segment) + */ + BATADV_MCAST_FLAGS_QUERIER_IPV6_SHADOWING = (1 << 4), +}; + +/** * enum batadv_nl_attrs - batman-adv netlink attributes */ enum batadv_nl_attrs { @@ -287,6 +334,16 @@ enum batadv_nl_attrs { */ BATADV_ATTR_DAT_CACHE_VID, + /** + * @BATADV_ATTR_MCAST_FLAGS: Per originator multicast flags + */ + BATADV_ATTR_MCAST_FLAGS, + + /** + * @BATADV_ATTR_MCAST_FLAGS_PRIV: Private, own multicast flags + */ + BATADV_ATTR_MCAST_FLAGS_PRIV, + /* add attributes above here, update the policy in netlink.c */ /** @@ -381,6 +438,11 @@ enum batadv_nl_commands { */ BATADV_CMD_GET_DAT_CACHE, + /** + * @BATADV_CMD_GET_MCAST_FLAGS: Query list of multicast flags + */ + BATADV_CMD_GET_MCAST_FLAGS, + /* add new commands above here */ /**
5 years
1
0
0
0
← Newer
1
2
3
4
5
Older →
Jump to page:
1
2
3
4
5
Results per page:
10
25
50
100
200