Open Mesh: Issueshttps://www.open-mesh.org/https://www.open-mesh.org/favicon.ico?16699090422021-04-20T09:49:13ZOpen Mesh
Redmine batman-adv - Bug #422 (New): General protection fault in batadv_orig_router_gethttps://www.open-mesh.org/issues/4222021-04-20T09:49:13ZLinus Lüssinglinus.luessing@c0d3.blue
<p>In a VM with kvm and a 5.11.9 kernel and a recent batman-adv from the master branch I get a general protection fault when putting the VM host to sleep and waking it up again later. The VM guest runs a few mesh instances (here bat1 to bat8).</p>
<p>Looks like some race condition where the orig node is deleted due to timeout but there is still an OGM in the queue from this node for further processing. Without putting a node in stand-by this seems unlikely to happen as when a node timeouts then there typically will be no OGM in the queue.</p>
<pre><code>
[308421.793525] batman_adv: bat3: IGMP Querier disappeared - multicast optimizations disabled
[308421.795414] batman_adv: bat3: MLD Querier disappeared - multicast optimizations disabled
[308421.801542] batman_adv: bat6: IGMP Querier disappeared - multicast optimizations disabled
[308421.802905] batman_adv: bat6: MLD Querier disappeared - multicast optimizations disabled
[308421.804257] batman_adv: bat5: IGMP Querier disappeared - multicast optimizations disabled
[308421.805761] batman_adv: bat5: MLD Querier disappeared - multicast optimizations disabled
[308421.813031] batman_adv: bat4: IGMP Querier disappeared - multicast optimizations disabled
[308421.814303] batman_adv: bat4: MLD Querier disappeared - multicast optimizations disabled
[308421.815716] batman_adv: bat2: IGMP Querier disappeared - multicast optimizations disabled
[308421.816779] batman_adv: bat2: MLD Querier disappeared - multicast optimizations disabled
[308421.819384] batman_adv: bat8: IGMP Querier disappeared - multicast optimizations disabled
[308421.820670] batman_adv: bat8: MLD Querier disappeared - multicast optimizations disabled
[308421.821942] batman_adv: bat7: IGMP Querier disappeared - multicast optimizations disabled
[308421.823706] batman_adv: bat7: MLD Querier disappeared - multicast optimizations disabled
[308422.813967] general protection fault, probably for non-canonical address 0x6b6b6b6b6b6b6b6b: 0000 [#1] SMP PTI
[308422.816150] CPU: 0 PID: 12563 Comm: kworker/u2:1 Tainted: G OE 5.11.9 #41
[308422.818045] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.14.0-1 04/01/2014
[308422.819949] Workqueue: bat_events batadv_iv_send_outstanding_bat_ogm_packet [batman_adv]
[308422.821797] RIP: 0010:batadv_orig_router_get+0x10/0x70 [batman_adv]
[308422.823032] Code: 03 00 00 00 4c 89 c7 e9 de d9 0d ea 66 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 00 0f 1f 44 00 00 41 54 48 8b 47 08 48 85 c0 74 0e <48> 39 70 10 74 16 48 8b 00 48 85 c0 75 f2 45 31 e4 e8 0a f2 d9
[308422.826658] RSP: 0018:ffffa0d140003d50 EFLAGS: 00010202
[308422.827700] RAX: 6b6b6b6b6b6b6b6b RBX: ffff90a4c7b2104e RCX: 000000000000000b
[308422.829049] RDX: 000000000000000a RSI: 0000000000000000 RDI: ffff90a4c4e68400
[308422.830400] RBP: ffff90a4c0763bd8 R08: ffff90a4c008e8c0 R09: 00000000000002c0
[308422.831759] R10: ffff90a4c7b21000 R11: 0000000000000001 R12: ffff90a4c008e878
[308422.833103] R13: ffff90a4c7b21040 R14: 0000000000000000 R15: 0000000000000001
[308422.834425] FS: 0000000000000000(0000) GS:ffff90a4cde00000(0000) knlGS:0000000000000000
[308422.835926] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[308422.836984] CR2: 00007ffced2d6000 CR3: 0000000009cde000 CR4: 00000000000006f0
[308422.838301] Call Trace:
[308422.838789] <IRQ>
[308422.839318] batadv_iv_ogm_process_per_outif+0x261/0xff0 [batman_adv]
[308422.840332] ? enqueue_entity+0x163/0x760
[308422.841867] batadv_iv_ogm_receive+0x26a/0x4a0 [batman_adv]
[308422.842560] batadv_batman_skb_recv+0x117/0x1d0 [batman_adv]
[308422.843357] __netif_receive_skb_one_core+0x8e/0xa0
[308422.844492] process_backlog+0x96/0x160
[308422.845036] net_rx_action+0x146/0x430
[308422.845594] __do_softirq+0xc5/0x275
[308422.846510] asm_call_irq_on_stack+0x12/0x20
[308422.847059] </IRQ>
[308422.847348] do_softirq_own_stack+0x37/0x40
[308422.848588] do_softirq+0x5e/0x70
[308422.849420] __local_bh_enable_ip+0x4b/0x50
[308422.850164] __dev_queue_xmit+0x376/0x8b0
[308422.850989] batadv_send_skb_packet+0xcc/0xf0 [batman_adv]
[308422.851950] batadv_iv_send_outstanding_bat_ogm_packet+0x18d/0x1b0 [batman_adv]
[308422.853154] process_one_work+0x1ec/0x380
[308422.853946] worker_thread+0x53/0x3e0
[308422.854566] ? process_one_work+0x380/0x380
[308422.855276] kthread+0x11b/0x140
[308422.855827] ? __kthread_bind_mask+0x60/0x60
[308422.856577] ret_from_fork+0x22/0x30
[308422.857199] Modules linked in: batman_adv(OE) bridge(OE) veth(E) dummy(E) libcrc32c(E) crc32c_generic(E) crc32_generic(E) crc16(E) mac80211(E) cfg80211(E) rfkill(E) libarc4(E) stp(E) llc(E) rpcsec_gss_krb5(E]
[308422.867669] ---[ end trace 3d57397987128d5a ]---
[308422.868423] RIP: 0010:batadv_orig_router_get+0x10/0x70 [batman_adv]
[308422.869429] Code: 03 00 00 00 4c 89 c7 e9 de d9 0d ea 66 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 00 0f 1f 44 00 00 41 54 48 8b 47 08 48 85 c0 74 0e <48> 39 70 10 74 16 48 8b 00 48 85 c0 75 f2 45 31 e4 e8 0a f2 d9
[308422.872321] RSP: 0018:ffffa0d140003d50 EFLAGS: 00010202
[308422.873143] RAX: 6b6b6b6b6b6b6b6b RBX: ffff90a4c7b2104e RCX: 000000000000000b
[308422.874270] RDX: 000000000000000a RSI: 0000000000000000 RDI: ffff90a4c4e68400
[308422.875433] RBP: ffff90a4c0763bd8 R08: ffff90a4c008e8c0 R09: 00000000000002c0
[308422.876548] R10: ffff90a4c7b21000 R11: 0000000000000001 R12: ffff90a4c008e878
[308422.877735] R13: ffff90a4c7b21040 R14: 0000000000000000 R15: 0000000000000001
[308422.878778] FS: 0000000000000000(0000) GS:ffff90a4cde00000(0000) knlGS:0000000000000000
[308422.880257] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[308422.881197] CR2: 00007ffced2d6000 CR3: 0000000009cde000 CR4: 00000000000006f0
[308422.882512] Kernel panic - not syncing: Fatal exception in interrupt
[308422.884049] Kernel Offset: 0x29600000 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffffbfffffff)
[308422.886580] ---[ end Kernel panic - not syncing: Fatal exception in interrupt ]---
</code></pre> batman-adv - Feature #419 (New): BLA: redundant and superficial GW checkhttps://www.open-mesh.org/issues/4192020-09-14T09:24:08ZLinus Lüssinglinus.luessing@c0d3.blue
<p>The source address check in batadv_recv_unicast_packet() here is both superficial and redundant:</p>
<pre><code> 989 /* packet for me */
990 if (batadv_is_my_mac(bat_priv, unicast_packet->dest)) {
991 /* If this is a unicast packet from another backgone gw,
992 * drop it.
993 */
994 orig_addr_gw = eth_hdr(skb)->h_source;
995 orig_node_gw = batadv_orig_hash_find(bat_priv, orig_addr_gw);
996 if (orig_node_gw) {
997 is_gw = batadv_bla_is_backbone_gw(skb, orig_node_gw,
998 hdr_size);
999 batadv_orig_node_put(orig_node_gw);
1000 if (is_gw) {
1001 batadv_dbg(BATADV_DBG_BLA, bat_priv,
1002 "%s(): Dropped unicast pkt received from another backbone gw %pM.\n",
1003 __func__, orig_addr_gw);
1004 goto free_skb;
1005 }
1006 }
1007
</code></pre>
<p><a class="external" href="https://git.open-mesh.org/batman-adv.git/blob/f2a2e0310dc1c570bdd1439553e897649b000292:/net/batman-adv/routing.c#l1000">https://git.open-mesh.org/batman-adv.git/blob/f2a2e0310dc1c570bdd1439553e897649b000292:/net/batman-adv/routing.c#l1000</a></p>
<p>Redundant, because the sender is already supposed to perform this check, so no need to do it again on reception.</p>
Superficial, because it only works if:
<ul>
<li>The BLA backbone gateway we share a LAN with is a direct neighbor of us.</li>
<li>The BLA backbone gateway we share a LAN with transmits the packet via its primary interface to us.</li>
</ul>
<p>In all other cases, like received via multiple hops or via a secondary interface from the other BLA gateway does not work.</p>
Suggestion:
<ul>
<li>Either remove this check.</li>
<li>Or turn the according batadv_dbg() into a pr_warn_ratelimited() to help in spotting potential bugs</li>
</ul>
<p>(This check initially made it hard to reproduce the issue this patch is supposed to fix: <a class="external" href="https://patchwork.open-mesh.org/project/b.a.t.m.a.n./patch/20200914012136.5278-2-linus.luessing@c0d3.blue/">https://patchwork.open-mesh.org/project/b.a.t.m.a.n./patch/20200914012136.5278-2-linus.luessing@c0d3.blue/</a>. Initially it was easy to reproduce in a physical setup but then difficult to reproduce in a virtual one, because they had different configurations regarding primary vs. secondary interfaces.)</p> batman-adv - Bug #418 (New): BLA: claiming race condition with multicast from meshhttps://www.open-mesh.org/issues/4182020-09-14T08:54:59ZLinus Lüssinglinus.luessing@c0d3.blue
Scenario:
<ul>
<li>Two BLA backbone gateways sharing the same LAN, receiving a multicast packet from the mesh.</li>
</ul>
Issue:
<ul>
<li>Both BLA backbone gateways will race for a claim. And can end up with both gateways thinking the other one claimed the client. Resulting in packetloss for traffic from the mesh into the BLA backbone.</li>
</ul>
<p>This actually seems to be acknowledged in the code:</p>
<pre><code>1857 if (!claim) {
1858 /* possible optimization: race for a claim */
1859 /* No claim exists yet, claim it for us!
1860 */
</code></pre>
<p><a class="external" href="https://git.open-mesh.org/batman-adv.git/blob/f2a2e0310dc1c570bdd1439553e897649b000292:/net/batman-adv/bridge_loop_avoidance.c#l1858">https://git.open-mesh.org/batman-adv.git/blob/f2a2e0310dc1c570bdd1439553e897649b000292:/net/batman-adv/bridge_loop_avoidance.c#l1858</a></p>
<p>Typically this seems to resolve when the claim times out a bit earlier on one of the BLA backbone gateways. However it unfortunately seems quite persistent when the two nodes were set up on the same host at the same time via a script, for instance. And is probably also persistent when physically similar devices / nodes are booted at the same time, for instance after a power outage.</p>
<p>This should be reproducable with the attached script. It creates a fully meshed topology, with nodes 1 and 2 bridged via LAN, like the following:</p>
<pre><code> --[LAN/br0]--
| |
(1) (2)
| |
---[mesh]----
/ \
(3) ... (8)
</code></pre>
<p>To reproduce, run:</p>
<pre><code>$ ./test-mcast-bla.sh setup
$ ping6 ff12::123%br8
</code></pre>
<p>Then compare <i>"batctl meshif bat1 cl"</i> and <i>"batctl meshif bat2 cl"</i>. You should see that both nodes assume that the other one claimed the MAC from node 8. Furthermore, a <i>"tcpdump -i br0 'icmp6 and dst ff12::123'"</i> should stay silent, showing that the multicasted ICMPv6 Echo Requests are wrongly dropped into the BLA backbone by both node 1 and 2.</p>
<p>You can teardown the test mesh via "$ ./test-mcast-bla.sh teardown" (or restart it via "reload").</p>
<p>Tested in a x86 Debian VM running Linux 5.8.7.</p>
<p>Further notes:</p>
<ul>
<li>Probably more likely to trigger via multicast-to-unicasts than via classic flooding. As the latter adds some jitter on forwarding, making a race less likely.</li>
<li>More likely to trigger if the two BLA backbone gateways are direct neighbors so that they receive the multicast packets at the same time.</li>
</ul> batman-adv - Bug #417 (New): BLA, crash: null pointer dereference in batadv_bla_loopdetect_report...https://www.open-mesh.org/issues/4172020-08-27T08:07:08ZLinus Lüssinglinus.luessing@c0d3.blue
<p>Version:</p>
<pre><code>
$ batctl -v
batctl 2020.2-openwrt-1 [batman-adv: 2020.2-openwrt-1]
</code></pre>
<p>Setup:</p>
<p>8 nodes, 3 of those interconnected on the LAN with BLA. Two of the three LAN devices crashed after about 15 hours with the following trace:</p>
<pre><code>
Time: 1598432655.394152
Modules: pppoe@bf627000+5000 ppp_async@bf61e000+5000 batman_adv@bf5e6000+2c000 ath10k_pci@bf5d5000+b000 ath10k_core@bf55b000+67000 ath@bf552000+6000 pppox@bf54a000+4000 ppp_generic@bf53d000+8000 nft_set_rbtree@bf535000+4000 nft_set_hash@bf52b000+6000 nft_reject_ipv6@bf523000+4000 nft_reject_ipv4@bf51b000+4000 nft_reject_inet@bf513000+4000 nft_reject_bridge@bf50b000+4000 nft_reject@bf504000+4000 nft_redir@bf4fd000+4000 nft_quota@bf4f5000+4000 nft_numgen@bf4ed000+4000 nft_meta_bridge@bf4e5000+4000 nft_meta@bf4dd000+4000 nft_log@bf4d5000+4000 nft_limit@bf4cd000+4000 nft_fwd_netdev@bf4c5000+4000 nft_exthdr@bf4bd000+4000 nft_dup_netdev@bf4b5000+4000 nft_ct@bf4ad000+4000 nft_counter@bf4a5000+4000 nft_chain_route_ipv6@bf49d000+4000 nft_chain_route_ipv4@bf495000+4000 nf_tables_netdev@bf48d000+4000 nf_tables_ipv6@bf485000+4000 nf_tables_ipv4@bf47d000+4000 nf_tables_inet@bf475000+4000 nf_tables_bridge@bf46d000+4000 nf_tables@bf453000+14000 mac80211@bf3ae000+7e000 iptable_nat@bf3a6000+4000 ipt_REJECT@bf39e000+4000 ipt_MASQUERADE@bf396000+4000 cfg80211@bf345000+44000 xt_time@bf33d000+4000 xt_tcpudp@bf335000+4000 xt_tcpmss@bf32d000+4000 xt_statistic@bf325000+4000 xt_state@bf31d000+4000 xt_nat@bf315000+4000 xt_multiport@bf30d000+4000 xt_mark@bf305000+4000 xt_mac@bf2fd000+4000 xt_limit@bf2f5000+4000 xt_length@bf2ed000+4000 xt_hl@bf2e5000+4000 xt_ecn@bf2dd000+4000 xt_dscp@bf2d5000+4000 xt_conntrack@bf2cd000+4000 xt_comment@bf2c5000+4000 xt_TCPMSS@bf2bd000+4000 xt_REDIRECT@bf2b5000+4000 xt_LOG@bf2ad000+4000 xt_HL@bf2a5000+4000 xt_FLOWOFFLOAD@bf29d000+4000 xt_DSCP@bf295000+4000 xt_CLASSIFY@bf28d000+4000 slhc@bf286000+4000 openvswitch@bf265000+1a000 nfnetlink@bf25c000+4000 nf_reject_ipv4@bf255000+4000 nf_nat_redirect@bf24e000+4000 nf_nat_masquerade_ipv6@bf247000+4000 nf_nat_masquerade_ipv4@bf240000+4000 nf_conntrack_ipv6@bf238000+4000 nf_nat_ipv6@bf230000+4000 nf_conntrack_ipv4@bf228000+4000 nf_nat_ipv4@bf220000+4000 nf_nat@bf215000+6000 nf_log_ipv4@bf20d000+4000 nf_flow_table_hw@bf205000+4000 nf_flow_table@bf1fa000+6000 nf_dup_netdev@bf1f3000+4000 nf_defrag_ipv6@bf1eb000+4000 nf_defrag_ipv4@bf1e3000+4000 nf_conntrack_rtcache@bf1db000+4000 nf_conntrack@bf1c2000+11000 libcrc32c@bf1ba000+4000 iptable_mangle@bf1b2000+4000 iptable_filter@bf1aa000+4000 ipt_ECN@bf1a2000+4000 ip_tables@bf198000+6000 crc_ccitt@bf191000+4000 compat@bf188000+5000 ledtrig_usbport@bf180000+4000 nf_log_ipv6@bf178000+4000 nf_log_common@bf170000+4000 ip6table_mangle@bf168000+4000 ip6table_filter@bf160000+4000 ip6_tables@bf156000+6000 ip6t_REJECT@bf14e000+4000 x_tables@bf143000+6000 nf_reject_ipv6@bf13c000+4000 mpls_iptunnel@bf134000+4000 mpls_router@bf128000+7000 mpls_gso@bf120000+4000 leds_gpio@bf118000+4000 xhci_plat_hcd@bf10f000+4000 xhci_pci@bf106000+4000 xhci_hcd@bf0e7000+18000 dwc3@bf0db000+7000 dwc3_of_simple@bf0d3000+4000 ohci_platform@bf0ca000+4000 ohci_hcd@bf0bd000+8000 phy_qcom_dwc3@bf0b5000+4000 ahci@bf0ab000+6000 ehci_platform@bf0a2000+4000 sd_mod@bf094000+9000 ahci_platform@bf08c000+4000 libahci_platform@bf085000+4000 libahci@bf07a000+7000 libata@bf046000+27000 scsi_mod@bf020000+1a000 ehci_hcd@bf010000+b000 gpio_button_hotplug@bf008000+4000 crc32c_generic@bf000000+4000
<3>[ 21.105247] ath10k_pci 0002:01:00.0: DANGER! You're overriding EEPROM-defined regulatory domain
<3>[ 21.105294] ath10k_pci 0002:01:00.0: from: 0x0 to 0x348 (svc-ready-work)
<3>[ 21.112758] ath10k_pci 0002:01:00.0: Your card was not certified to operate in the domain you chose.
<3>[ 21.119792] ath10k_pci 0002:01:00.0: This might result in a violation of your local regulatory rules.
<3>[ 21.128906] ath10k_pci 0002:01:00.0: Do not ever do this unless you really know what you are doing!
<4>[ 21.139581] ath10k_pci 0002:01:00.0: 10.4 wmi init: vdevs: 8 peers: 180 tid: 450
<6>[ 21.146922] ath10k_pci 0002:01:00.0: using 7 firmware rate-ctrl objects
<4>[ 21.154531] ath10k_pci 0002:01:00.0: msdu-desc: 2200 skid: 360
<6>[ 21.237597] ath10k_pci 0002:01:00.0: wmi print 'P 180/180 V 8 K 540 PH 556 T 656 msdu-desc: 2200 sw-crypt: 0 ct-sta: 0'
<6>[ 21.238894] ath10k_pci 0002:01:00.0: wmi print 'free: 11368 iram: 8424 sram: 512'
<6>[ 21.405609] ath10k_pci 0002:01:00.0: htt-ver 2.2 wmi-op 6 htt-op 4 cal pre-cal-file max-sta 180 raw 0 hwcrypto 1
<7>[ 21.626332] ath: EEPROM regdomain: 0x8348
<7>[ 21.626345] ath: EEPROM indicates we should expect a country code
<7>[ 21.626364] ath: doing EEPROM country->regdmn map search
<7>[ 21.626377] ath: country maps to regdmn code: 0x3a
<7>[ 21.626391] ath: Country alpha2 being used: US
<7>[ 21.626401] ath: Regpair used: 0x3a
<6>[ 21.638889] batman_adv: B.A.T.M.A.N. advanced 2020.2-openwrt-1 (compatibility version 15) loaded
<14>[ 21.641464] kmodloader: done loading kernel modules from /etc/modules.d/*
<6>[ 24.336245] Atheros 8031 ethernet gpio-0:00: attached PHY driver [Atheros 8031 ethernet] (mii_bus:phy_addr=gpio-0:00, irq=POLL)
<6>[ 24.337418] dwmac1000: Master AXI performs any burst length
<6>[ 24.346656] ipq806x-gmac-dwmac 37600000.ethernet eth1: IEEE 1588-2008 Advanced Timestamp supported
<6>[ 24.352226] ipq806x-gmac-dwmac 37600000.ethernet eth1: registered PTP clock
<6>[ 24.365549] br-lan: port 1(eth1) entered blocking state
<6>[ 24.367972] br-lan: port 1(eth1) entered disabled state
<6>[ 24.374348] IPv6: ADDRCONF(NETDEV_UP): br-lan: link is not ready
<6>[ 24.506123] Atheros 8031 ethernet gpio-0:01: attached PHY driver [Atheros 8031 ethernet] (mii_bus:phy_addr=gpio-0:01, irq=POLL)
<6>[ 24.513244] dwmac1000: Master AXI performs any burst length
<6>[ 24.516426] ipq806x-gmac-dwmac 37400000.ethernet eth0: IEEE 1588-2008 Advanced Timestamp supported
<6>[ 24.522078] ipq806x-gmac-dwmac 37400000.ethernet eth0: registered PTP clock
<6>[ 24.534347] br-wan: port 1(eth0) entered blocking state
<6>[ 24.537849] br-wan: port 1(eth0) entered disabled state
<6>[ 24.544469] br-wan: port 1(eth0) entered blocking state
<6>[ 24.548271] br-wan: port 1(eth0) entered forwarding state
<6>[ 24.751737] 8021q: adding VLAN 0 to HW filter on device bat0
<6>[ 24.752006] br-lan: port 2(bat0) entered blocking state
<6>[ 24.756560] br-lan: port 2(bat0) entered disabled state
<6>[ 24.761574] device bat0 entered promiscuous mode
<6>[ 24.766771] device eth1 entered promiscuous mode
<6>[ 24.771559] br-lan: port 2(bat0) entered blocking state
<6>[ 24.776138] br-lan: port 2(bat0) entered forwarding state
<6>[ 24.798361] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
<6>[ 25.263219] batman_adv: bat0: No IGMP Querier present - multicast optimizations disabled
<6>[ 25.263251] batman_adv: bat0: No MLD Querier present - multicast optimizations disabled
<6>[ 25.382134] br-wan: port 1(eth0) entered disabled state
<6>[ 27.516892] ipq806x-gmac-dwmac 37600000.ethernet eth1: Link is Up - 1Gbps/Full - flow control rx/tx
<4>[ 31.710745] ath10k_pci 0002:01:00.0: 10.4 wmi init: vdevs: 8 peers: 180 tid: 450
<6>[ 31.710774] ath10k_pci 0002:01:00.0: using 7 firmware rate-ctrl objects
<4>[ 31.717361] ath10k_pci 0002:01:00.0: msdu-desc: 2200 skid: 360
<6>[ 31.800345] ath10k_pci 0002:01:00.0: wmi print 'P 180/180 V 8 K 540 PH 556 T 656 msdu-desc: 2200 sw-crypt: 0 ct-sta: 0'
<6>[ 31.801611] ath10k_pci 0002:01:00.0: wmi print 'free: 11368 iram: 8424 sram: 512'
<4>[ 32.193725] ath10k_pci 0002:01:00.0: Firmware lacks feature flag indicating a retry limit of > 2 is OK, requested limit: 4
<6>[ 32.193942] IPv6: ADDRCONF(NETDEV_UP): client1: link is not ready
<6>[ 32.208336] br-lan: port 1(eth1) entered blocking state
<6>[ 32.209836] br-lan: port 1(eth1) entered forwarding state
<6>[ 32.237464] br-lan: port 3(client1) entered blocking state
<6>[ 32.237491] br-lan: port 3(client1) entered disabled state
<6>[ 32.242616] device client1 entered promiscuous mode
<6>[ 32.394857] br-wan: port 1(eth0) entered disabled state
<6>[ 32.457821] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
<6>[ 32.762860] ath10k_pci 0002:01:00.0: NOTE: Firmware DBGLOG output disabled in debug_mask: 0x10000000
<6>[ 32.770474] IPv6: ADDRCONF(NETDEV_CHANGE): client1: link becomes ready
<6>[ 32.771583] br-lan: port 3(client1) entered blocking state
<6>[ 32.777580] br-lan: port 3(client1) entered forwarding state
<6>[ 32.886573] Atheros 8031 ethernet gpio-0:01: attached PHY driver [Atheros 8031 ethernet] (mii_bus:phy_addr=gpio-0:01, irq=POLL)
<6>[ 32.893172] dwmac1000: Master AXI performs any burst length
<6>[ 32.897375] ipq806x-gmac-dwmac 37400000.ethernet eth0: IEEE 1588-2008 Advanced Timestamp supported
<6>[ 32.902530] ipq806x-gmac-dwmac 37400000.ethernet eth0: registered PTP clock
<6>[ 32.916682] br-wan: port 1(eth0) entered blocking state
<6>[ 32.918477] br-wan: port 1(eth0) entered disabled state
<6>[ 32.928463] IPv6: ADDRCONF(NETDEV_UP): br-wan: link is not ready
<4>[ 38.723594] ath10k_pci 0001:01:00.0: 10.4 wmi init: vdevs: 8 peers: 180 tid: 450
<6>[ 38.723623] ath10k_pci 0001:01:00.0: using 7 firmware rate-ctrl objects
<4>[ 38.731093] ath10k_pci 0001:01:00.0: msdu-desc: 2200 skid: 360
<6>[ 38.811599] ath10k_pci 0001:01:00.0: wmi print 'P 180/180 V 8 K 540 PH 556 T 656 msdu-desc: 2200 sw-crypt: 0 ct-sta: 0'
<6>[ 38.812877] ath10k_pci 0001:01:00.0: wmi print 'free: 11368 iram: 8424 sram: 512'
<4>[ 39.201170] ath10k_pci 0001:01:00.0: Firmware lacks feature flag indicating a retry limit of > 2 is OK, requested limit: 4
<6>[ 39.201339] IPv6: ADDRCONF(NETDEV_UP): client0: link is not ready
<6>[ 39.216274] br-lan: port 4(client0) entered blocking state
<6>[ 39.217340] br-lan: port 4(client0) entered disabled state
<6>[ 39.222873] device client0 entered promiscuous mode
<6>[ 39.528761] IPv6: ADDRCONF(NETDEV_CHANGE): client0: link becomes ready
<6>[ 39.529012] br-lan: port 4(client0) entered blocking state
<6>[ 39.534302] br-lan: port 4(client0) entered forwarding state
<6>[ 40.691860] IPv6: ADDRCONF(NETDEV_UP): mesh0: link is not ready
<6>[ 40.731037] IPv6: ADDRCONF(NETDEV_UP): mesh1: link is not ready
<6>[ 40.823371] ath10k_pci 0001:01:00.0: mac flush null vif, drop 0 queues 0xffff
<6>[ 40.898665] ath10k_pci 0002:01:00.0: mac flush null vif, drop 0 queues 0xffff
<6>[ 41.760998] br-lan: port 4(client0) entered disabled state
<6>[ 41.762528] br-lan: port 3(client1) entered disabled state
<6>[ 44.641968] br-lan: port 3(client1) entered blocking state
<6>[ 44.642010] br-lan: port 3(client1) entered forwarding state
<6>[ 44.649723] batman_adv: bat0: Adding interface: mesh1
<6>[ 44.652216] batman_adv: bat0: Interface activated: mesh1
<6>[ 44.658352] IPv6: ADDRCONF(NETDEV_CHANGE): mesh1: link becomes ready
<4>[ 44.891497] ath10k_pci 0002:01:00.0: Invalid peer id 0 or peer stats buffer, peer: cb915000 sta: (null)
<6>[ 47.250647] br-lan: port 4(client0) entered blocking state
<6>[ 47.250682] br-lan: port 4(client0) entered forwarding state
<6>[ 47.257308] batman_adv: bat0: Adding interface: mesh0
<6>[ 47.260838] batman_adv: bat0: Interface activated: mesh0
<6>[ 47.308240] IPv6: ADDRCONF(NETDEV_CHANGE): mesh0: link becomes ready
<4>[ 75.993607] NOHZ: local_softirq_pending 08
<4>[ 219.354201] NOHZ: local_softirq_pending 08
<4>[ 444.633812] NOHZ: local_softirq_pending 08
<4>[ 506.073732] NOHZ: local_softirq_pending 08
<4>[ 526.553749] NOHZ: local_softirq_pending 08
<4>[ 669.913737] NOHZ: local_softirq_pending 08
<4>[ 751.833940] NOHZ: local_softirq_pending 08
<4>[ 772.313676] NOHZ: local_softirq_pending 08
<4>[ 792.793586] NOHZ: local_softirq_pending 08
<4>[ 813.273624] NOHZ: local_softirq_pending 08
<4>[ 848.273737] ath10k_pci 0002:01:00.0: peer-unmap-event: unknown peer id 8
<4>[ 850.884255] ath10k_pci 0001:01:00.0: peer-unmap-event: unknown peer id 5
<1>[ 1263.833736] Unable to handle kernel NULL pointer dereference at virtual address 00000038
<1>[ 1263.833770] pgd = c0204000
<1>[ 1263.840947] [00000038] *pgd=00000000
<0>[ 1263.843483] Internal error: Oops: 17 [#1] SMP ARM
<4>[ 1263.847138] Modules linked in: pppoe ppp_async batman_adv ath10k_pci ath10k_core ath pppox ppp_generic nft_set_rbtree nft_set_hash nft_reject_ipv6 nft_reject_ipv4 nft_reject_inet nft_reject_bridge nft_reject nft_redir nft_quota nft_numgen nft_meta_bridge nft_meta nft_log nft_limit nft_fwd_netdev nft_exthdr nft_dup_netdev nft_ct nft_counter nft_chain_route_ipv6 nft_chain_route_ipv4 nf_tables_netdev nf_tables_ipv6 nf_tables_ipv4 nf_tables_inet nf_tables_bridge nf_tables mac80211 iptable_nat ipt_REJECT ipt_MASQUERADE cfg80211 xt_time xt_tcpudp xt_tcpmss xt_statistic xt_state xt_nat xt_multiport xt_mark xt_mac xt_limit xt_length xt_hl xt_ecn xt_dscp xt_conntrack xt_comment xt_TCPMSS xt_REDIRECT xt_LOG xt_HL xt_FLOWOFFLOAD xt_DSCP xt_CLASSIFY slhc openvswitch nfnetlink nf_reject_ipv4 nf_nat_redirect nf_nat_masquerade_ipv6
<4>[ 1263.901905] nf_nat_masquerade_ipv4 nf_conntrack_ipv6 nf_nat_ipv6 nf_conntrack_ipv4 nf_nat_ipv4 nf_nat nf_log_ipv4 nf_flow_table_hw nf_flow_table nf_dup_netdev nf_defrag_ipv6 nf_defrag_ipv4 nf_conntrack_rtcache nf_conntrack libcrc32c iptable_mangle iptable_filter ipt_ECN ip_tables crc_ccitt compat ledtrig_usbport nf_log_ipv6 nf_log_common ip6table_mangle ip6table_filter ip6_tables ip6t_REJECT x_tables nf_reject_ipv6 mpls_iptunnel mpls_router mpls_gso leds_gpio xhci_plat_hcd xhci_pci xhci_hcd dwc3 dwc3_of_simple ohci_platform ohci_hcd phy_qcom_dwc3 ahci ehci_platform sd_mod ahci_platform libahci_platform libahci libata scsi_mod ehci_hcd gpio_button_hotplug crc32c_generic
<4>[ 1263.961027] CPU: 0 PID: 2470 Comm: kworker/u4:2 Not tainted 4.14.187 #0
<4>[ 1263.983254] Hardware name: Generic DT based system
<4>[ 1263.989826] Workqueue: bat_events batadv_bla_periodic_work [batman_adv]
<4>[ 1263.994629] task: cbcbed00 task.stack: ca46e000
<4>[ 1264.001153] PC is at batadv_bit_get_packet+0xc4/0xf4 [batman_adv]
<4>[ 1264.005669] LR is at batadv_bit_get_packet+0xb8/0xf4 [batman_adv]
<4>[ 1264.011901] pc : [<bf5ebe30>] lr : [<bf5ebe24>] psr: 60000013
<4>[ 1264.017976] sp : ca46fec0 ip : 000000c8 fp : cd804200
<4>[ 1264.024050] r10: ccd38000 r9 : 00000007 r8 : 00000000
<4>[ 1264.029260] r7 : cb8a64c0 r6 : cb90e300 r5 : cc6f7e8c r4 : 00000000
<4>[ 1264.034471] r3 : 00000038 r2 : 00000002 r1 : 00000000 r0 : cc6f7e8c
<4>[ 1264.041069] Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none
<4>[ 1264.047578] Control: 10c5787d Table: 4dd7406a DAC: 00000051
<0>[ 1264.054784] Process kworker/u4:2 (pid: 2470, stack limit = 0xca46e210)
<0>[ 1264.060513] Stack: (0xca46fec0 to 0xca470000)
<0>[ 1264.066960] fec0: cc6f7e80 cb90e300 cb90e300 bf5ecbf4 cb95c0c0 00000200 c0b02d00 00000007
<0>[ 1264.071393] fee0: cb8a678c cb8a669c cb90e300 cb8a64c0 cb8a669c 00000000 00000000 00000080
<0>[ 1264.079554] ff00: cd804200 bf5ecd70 cb8a677c cb8a677c 60000013 cb8a669c cb93b080 cd804200
<0>[ 1264.087713] ff20: cbd6c600 00000000 00000000 00000080 cd804200 c0337120 cd804218 ffffe000
<0>[ 1264.095873] ff40: cb93b080 cd804200 cb93b098 cd804218 ffffe000 c0b02d00 00000088 c033761c
<0>[ 1264.104032] ff60: cc72febc ccdd6400 ca46e000 c8fe6880 cc72febc ccdd641c cb93b080 c03372d8
<0>[ 1264.112192] ff80: 00000000 c033d2bc 00000000 c8fe6880 c033d174 00000000 00000000 00000000
<0>[ 1264.120351] ffa0: 00000000 00000000 00000000 c0307d28 00000000 00000000 00000000 00000000
<0>[ 1264.128511] ffc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
<0>[ 1264.136670] ffe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000
<4>[ 1264.144917] [<bf5ebe30>] (batadv_bit_get_packet [batman_adv]) from [<bf5ecbf4>] (batadv_bla_loopdetect_report+0xa48/0xb44 [batman_adv])
<4>[ 1264.153012] [<bf5ecbf4>] (batadv_bla_loopdetect_report [batman_adv]) from [<bf5ecd70>] (batadv_bla_periodic_work+0x80/0xb04 [batman_adv])
<4>[ 1264.164984] [<bf5ecd70>] (batadv_bla_periodic_work [batman_adv]) from [<c0337120>] (process_one_work+0x28c/0x444)
<4>[ 1264.177456] [<c0337120>] (process_one_work) from [<c033761c>] (worker_thread+0x344/0x58c)
<4>[ 1264.187695] [<c033761c>] (worker_thread) from [<c033d2bc>] (kthread+0x148/0x150)
<4>[ 1264.195860] [<c033d2bc>] (kthread) from [<c0307d28>] (ret_from_fork+0x14/0x2c)
<0>[ 1264.203329] Code: eb4724e3 e5944008 e2843038 f593f000 (e1932f9f)
<4>[ 1264.210463] ---[ end trace 54361f4755dee328 ]---
===========================%
</code></pre> batman-adv - Bug #397 (New): BATMAN_V throughput on bridge, vxlan and vethhttps://www.open-mesh.org/issues/3972019-07-29T14:51:36ZLinus Lüssinglinus.luessing@c0d3.blue
<p>For these interfaces, bridge, vxlan and veth, batman-adv currently uses the 1Mbit/s default throughput. Also see:</p>
<p><a class="external" href="https://github.com/freifunk-gluon/gluon/issues/1728">https://github.com/freifunk-gluon/gluon/issues/1728</a></p>
<p>For vxlan Matthias is currently working on a patch to inherit the properties from its parent device (similar to what vlan does).</p>
<p>For veth ethtool reports 10Gbit/s, which is way more reasonable value for an in-kernel connection than our 1MBit/s default value:</p>
<pre><code>$ ethtool veth0
Settings for veth0:
Supported ports: [ ]
Supported link modes: Not reported
Supported pause frame use: No
Supports auto-negotiation: No
Supported FEC modes: Not reported
Advertised link modes: Not reported
Advertised pause frame use: No
Advertised auto-negotiation: No
Advertised FEC modes: Not reported
Speed: 10000Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 0
Transceiver: internal
Auto-negotiation: off
MDI-X: Unknown
Link detected: yes
</code></pre>
<p>However batman-adv uses the default 1MBit/s throughput value due to auto-negotiation being disabled. We could add an exception in batman-adv for veth to disregard the auto-negotiation property, however that would not be sufficient for applications with for instance v(x)lans stacked on top of veth.</p>
<p>For bridge interfaces it is even more tricky.</p> batctl - Bug #394 (Closed): batctl: dmesg deprecation warnings triggered via "batctl if"https://www.open-mesh.org/issues/3942019-06-19T01:37:46ZLinus Lüssinglinus.luessing@c0d3.blue
<p>When using "batctl if" to get the interface status then this triggers the following deprecation warnings in dmesg:</p>
<pre><code>[ 5856.277366] batman_adv: [Deprecated]: batctl (pid 5054) Use of sysfs file "iface_status".
[ 5856.277366] Use batadv genl family instead
</code></pre>
<p>Even though batctl v2019.2 supports netlink for the interface status it prefers the syfs version if available.</p>
<p>This is a regression introduced with batman-adv v2019.2 which happens as long as batman-adv is compiled with CONFIG_BATMAN_ADV_SYSFS=y.</p>
<p>@Sven: Was it an accident to prefer sysfs over netlink for "batctl if" or were there some downsides of the netlink variant?</p> alfred - Bug #393 (Closed): batadv-vis: dmesg deprecation warningshttps://www.open-mesh.org/issues/3932019-06-19T00:15:58ZLinus Lüssinglinus.luessing@c0d3.blue
<p>Every UPDATE_INTERVAL (10 seconds) batadv-vis creates a warning like the following for each interface:</p>
<pre><code>[ 775.385966] batman_adv: [Deprecated]: batadv-vis (pid 3251) Use of sysfs file "iface_status".
[ 775.385966] Use batadv genl family instead
[ 785.389259] batman_adv: [Deprecated]: batadv-vis (pid 3251) Use of sysfs file "mesh_iface".
[ 785.389259] Use batadv genl family instead
</code></pre>
<p>It seems that register_interfaces() in vis.c was not updated to use netlink to query "iface_status" and "mesh_iface" yet.</p>
<p>The issue is present when using batman-adv v2019.2.</p> batman-adv - Bug #356 (New): TT: XOR'ing CRC results unsafehttps://www.open-mesh.org/issues/3562018-05-10T12:31:17ZLinus Lüssinglinus.luessing@c0d3.blue
<p>Currently, the custom CRC caluclation for TT in batman-adv works as follows:</p>
<ul>
<li>Compute the CRC for each entry, including vid and TT sync flags.</li>
<li>Then XOR all resulting CRCs</li>
</ul>
<p>However, while playing with injecting flags to multicast entries we now noticed that XOR'ing CRCs seems to possibly have easy collision issues:</p>
<pre><code>root@Linus-Debian:/mnt/batman-adv-t_x# batctl tg
[B.A.T.M.A.N. adv 2018.1-10-gc0c5f610, MainIF/MAC: ens3/02:32:64:a4:39:c1 (bat0/0a:f0:8e:ca:5e:82 BATMAN_IV)]
Client VID Flags Last ttvn Via ttvn (CRC )
* 0e:b3:20:0c:05:01 -1 [....] ( 2) 02:05:64:a4:39:c2 ( 2) (0xdbb13619)
* 33:33:ff:0c:05:01 -1 [....] ( 2) 02:05:64:a4:39:c2 ( 2) (0xdbb13619)
01:00:5e:00:00:01 -1 [....] ( 2) 02:01:64:a4:39:c4 ( 2) (0xe0acdb32)
01:00:5e:00:00:01 -1 [....] ( 2) 02:84:64:a4:39:c3 ( 2) (0xfefb94e8)
* 01:00:5e:00:00:01 -1 [....] ( 2) 02:05:64:a4:39:c2 ( 2) (0xdbb13619)
* 33:33:ff:c8:3a:24 -1 [....] ( 2) 02:84:64:a4:39:c3 ( 2) (0xfefb94e8)
* 4a:1d:5e:5c:79:c9 -1 [....] ( 2) 02:01:64:a4:39:c4 ( 2) (0xe0acdb32)
* 33:33:ff:5c:79:c9 -1 [....] ( 2) 02:01:64:a4:39:c4 ( 2) (0xe0acdb32)
* fe:04:73:c8:3a:24 -1 [....] ( 2) 02:84:64:a4:39:c3 ( 2) (0xfefb94e8)
33:33:00:00:00:01 -1 [....] ( 2) 02:01:64:a4:39:c4 ( 2) (0xe0acdb32)
33:33:00:00:00:01 -1 [....] ( 2) 02:84:64:a4:39:c3 ( 2) (0xfefb94e8)
* 33:33:00:00:00:01 -1 [....] ( 2) 02:05:64:a4:39:c2 ( 2) (0xdbb13619)
root@Linus-Debian:/mnt/batman-adv-t_x# batctl tg
[B.A.T.M.A.N. adv 2018.1-10-gc0c5f610, MainIF/MAC: ens3/02:32:64:a4:39:c1 (bat0/0a:f0:8e:ca:5e:82 BATMAN_IV)]
Client VID Flags Last ttvn Via ttvn (CRC )
* 0e:b3:20:0c:05:01 -1 [....] ( 2) 02:05:64:a4:39:c2 ( 2) (0xdbb13619)
* 33:33:ff:0c:05:01 -1 [....] ( 2) 02:05:64:a4:39:c2 ( 2) (0xdbb13619)
01:00:5e:00:00:01 -1 [.W..] ( 4) 02:01:64:a4:39:c4 ( 4) (0x7cf72194)
01:00:5e:00:00:01 -1 [....] ( 2) 02:84:64:a4:39:c3 ( 2) (0xfefb94e8)
* 01:00:5e:00:00:01 -1 [....] ( 2) 02:05:64:a4:39:c2 ( 2) (0xdbb13619)
* 33:33:ff:c8:3a:24 -1 [....] ( 2) 02:84:64:a4:39:c3 ( 2) (0xfefb94e8)
* 4a:1d:5e:5c:79:c9 -1 [....] ( 4) 02:01:64:a4:39:c4 ( 4) (0x7cf72194)
* 33:33:ff:5c:79:c9 -1 [.W..] ( 4) 02:01:64:a4:39:c4 ( 4) (0x7cf72194)
* fe:04:73:c8:3a:24 -1 [....] ( 2) 02:84:64:a4:39:c3 ( 2) (0xfefb94e8)
33:33:00:00:00:01 -1 [.W..] ( 4) 02:01:64:a4:39:c4 ( 4) (0x7cf72194)
33:33:00:00:00:01 -1 [....] ( 2) 02:84:64:a4:39:c3 ( 2) (0xfefb94e8)
* 33:33:00:00:00:01 -1 [....] ( 2) 02:05:64:a4:39:c2 ( 2) (0xdbb13619)
root@Linus-Debian:/mnt/batman-adv-t_x# batctl tg
[B.A.T.M.A.N. adv 2018.1-10-gc0c5f610, MainIF/MAC: ens3/02:32:64:a4:39:c1 (bat0/0a:f0:8e:ca:5e:82 BATMAN_IV)]
Client VID Flags Last ttvn Via ttvn (CRC )
* 0e:b3:20:0c:05:01 -1 [....] ( 2) 02:05:64:a4:39:c2 ( 2) (0xdbb13619)
* 33:33:ff:0c:05:01 -1 [....] ( 2) 02:05:64:a4:39:c2 ( 2) (0xdbb13619)
01:00:5e:00:00:01 -1 [.W..] ( 4) 02:84:64:a4:39:c3 ( 4) (0xfefb94e8)
01:00:5e:00:00:01 -1 [.W..] ( 4) 02:01:64:a4:39:c4 ( 4) (0x7cf72194)
* 01:00:5e:00:00:01 -1 [....] ( 2) 02:05:64:a4:39:c2 ( 2) (0xdbb13619)
* 33:33:ff:c8:3a:24 -1 [....] ( 4) 02:84:64:a4:39:c3 ( 4) (0xfefb94e8)
* 4a:1d:5e:5c:79:c9 -1 [....] ( 4) 02:01:64:a4:39:c4 ( 4) (0x7cf72194)
* 33:33:ff:5c:79:c9 -1 [.W..] ( 4) 02:01:64:a4:39:c4 ( 4) (0x7cf72194)
* fe:04:73:c8:3a:24 -1 [....] ( 4) 02:84:64:a4:39:c3 ( 4) (0xfefb94e8)
33:33:00:00:00:01 -1 [.W..] ( 4) 02:84:64:a4:39:c3 ( 4) (0xfefb94e8)
33:33:00:00:00:01 -1 [.W..] ( 4) 02:01:64:a4:39:c4 ( 4) (0x7cf72194)
* 33:33:00:00:00:01 -1 [....] ( 2) 02:05:64:a4:39:c2 ( 2) (0xdbb13619)
root@Linus-Debian:/mnt/batman-adv-t_x#
</code></pre>
<p>When the 'W' flag was injected on node ..:c4 on three of its entries, as expected the result was a new CRC (before: 0xe0acdb32, after: 0x7cf72194).</p>
<p>However, when the 'W' flag was injected on node ..:c3 and only on two of its entries, the CRC stayed the same (0xfefb94e8).</p>
<p>It seems that xor'ing two CRC results which both had exactly the same one bit flipped nullifies the change introduced by this bit.</p>
<p>Sample code to verify:</p>
<pre><code>#!/usr/bin/python3
import binascii
a=b"1234"
b=b"4305"
crca0=binascii.crc32(a, 0x0)
crcb0=binascii.crc32(b, 0x0)
xor0=crca0 ^ crcb0
print('CRC({:s}, 0x0) ^ CRC({:s}, 0x0) = {:#010x} ^ {:#010x} = {:#010x}'.format(str(a), str(b), crca0, crcb0, xor0))
crca1=binascii.crc32(a, 0x1)
crcb1=binascii.crc32(b, 0x1)
xor1=crca1 ^ crcb1
print('CRC({:s}, 0x1) ^ CRC({:s}, 0x1) = {:#010x} ^ {:#010x} = {:#010x}'.format(str(a), str(b), crca1, crcb1, xor1))
</code></pre>
<p>Output:</p>
<pre><code>CRC(b'1234', 0x0) ^ CRC(b'4305', 0x0) = 0x9be3e0a3 ^ 0xf1d519f3 = 0x6a36f950
CRC(b'1234', 0x1) ^ CRC(b'4305', 0x1) = 0x235f87c6 ^ 0x49697e96 = 0x6a36f950
</code></pre>
<p>The reason for XOR'ing instead of only CRC'ing back then seems to have been to be able to be independent of the order of TT entries. Note that any fix by changing the checksumming method batman-adv uses for TT will likely not be backwards compatible.</p> batman-adv - Bug #351 (New): Issues with batadv_gw_out_of_rangehttps://www.open-mesh.org/issues/3512018-03-13T09:25:42ZLinus Lüssinglinus.luessing@c0d3.blue
<p>I'm getting the impression that batadv_gw_out_of_range() is broken or even never worked as intended. gw_out_of_range() is only called if DHCP_TO_SERVER is set in interface_tx(). which is only set to DHCP_TO_SERVER in the is_multicast_ether_addr(ethhdr->h_dest) branch in interface_tx(). However, the kerneldoc for gw_out_of_range() says that for multicast destinations it should always return false which means, DHCP packets to a server would never get dropped in interface_tx() due to being "out-of-range". So clients might have been more sticky to dhcp servers than they should have.</p>
<p>And now with multicast TT entries things might get worse... I think there might be DHCPv4 packetloss if some node were to claim FF:FF:FF:FF:FF:FF via TT (the current multicast code does not announce this. however, a broken or malicious node might). And for DHCPv6, the multicast code will currently announce 33:33:00:01:00:02/33:33:00:01:00:03 so that, DHCPv6, might have become broken with the added multicast code, I suspect.</p> batman-adv - Feature #339 (New): Make "batctl log" usable with network namespaceshttps://www.open-mesh.org/issues/3392017-07-13T03:09:55ZLinus Lüssinglinus.luessing@c0d3.blue
<p>Currently, this fails as the socket is only available via debugfs right now. And for debugfs we have no namespace support.</p> batman-adv - Bug #333 (Feedback): Compiling 4.11-rc5 fails: "sys/socket.h: No such file or direct...https://www.open-mesh.org/issues/3332017-04-24T18:31:17ZLinus Lüssinglinus.luessing@c0d3.blue
<p>Trying to compile a recent batman-adv master branch with an 4.11-rc5 kernel on a Debian stable currently fails with the following error:</p>
<pre>
/tux/mesh-node/usr/src/linux-headers-4.11.0-rc5+ CONFIG_BATMAN_ADV_BATMAN_V=y CONFIG_BATMAN_ADV_DAT=y CONFIG_BATMAN_ADV_BLA=y CONFIG_BATMAN_ADV_MCAST=y CONFIG_BATMAN_ADV_AGGR=y CONFIG_BATMAN_ADV_NC=n EXTRA_CFLAGS="-Werror -DDEBUG -g -O1"
/home/tux/dev/batman-adv-t_x/gen-compat-autoconf.sh /home/tux/dev/batman-adv-t_x/compat-autoconf.h
mkdir -p /home/tux/dev/batman-adv-t_x/build/net/batman-adv/
compat-patches/replacements.sh
touch /home/tux/dev/batman-adv-t_x/build/net/batman-adv/.compat-prepared
/usr/bin/make -C /home/tux/mesh-node/usr/src/linux-headers-4.11.0-rc5+ M=/home/tux/dev/batman-adv-t_x/build PWD=/home/tux/dev/batman-adv-t_x/build REVISION=2017.0.1-25-ga62cc2a CONFIG_BATMAN_ADV=m CONFIG_BATMAN_ADV_DEBUG=y CONFIG_BATMAN_ADV_DEBUGFS=y CONFIG_BATMAN_ADV_BLA=y CONFIG_BATMAN_ADV_DAT=y CONFIG_BATMAN_ADV_NC=n CONFIG_BATMAN_ADV_MCAST=y CONFIG_BATMAN_ADV_BATMAN_V=y INSTALL_MOD_DIR=updates/ modules
make[1]: Entering directory '/home/tux/mesh-node/usr/src/linux-headers-4.11.0-rc5+'
No such file: c
No such file: c
CC [M] /home/tux/dev/batman-adv-t_x/build/net/batman-adv/../../../compat-sources/net/core/skbuff.o
./include/linux/if.h:27:11: error: unable to open 'sys/socket.h'
In file included from ./include/linux/compat.h:16:0,
from ./include/linux/ethtool.h:16,
from /home/tux/dev/batman-adv-t_x/build/../compat-include/linux/ethtool.h:25,
from ./include/linux/netdevice.h:42,
from /home/tux/dev/batman-adv-t_x/build/../compat-include/linux/netdevice.h:25,
from ./include/linux/icmpv6.h:12,
from ./include/linux/ipv6.h:82,
from /home/tux/dev/batman-adv-t_x/build/net/batman-adv/../../../compat-sources/net/core/skbuff.c:36:
./include/linux/if.h:27:54: fatal error: sys/socket.h: No such file or directory
#include <sys/socket.h> /* for struct sockaddr. */
^
compilation terminated.
scripts/Makefile.build:294: recipe for target '/home/tux/dev/batman-adv-t_x/build/net/batman-adv/../../../compat-sources/net/core/skbuff.o' failed
make[3]: *** [/home/tux/dev/batman-adv-t_x/build/net/batman-adv/../../../compat-sources/net/core/skbuff.o] Error 1
scripts/Makefile.build:553: recipe for target '/home/tux/dev/batman-adv-t_x/build/net/batman-adv' failed
make[2]: *** [/home/tux/dev/batman-adv-t_x/build/net/batman-adv] Error 2
Makefile:1492: recipe for target '_module_/home/tux/dev/batman-adv-t_x/build' failed
make[1]: *** [_module_/home/tux/dev/batman-adv-t_x/build] Error 2
make[1]: Leaving directory '/home/tux/mesh-node/usr/src/linux-headers-4.11.0-rc5+'
Makefile:90: recipe for target 'all' failed
make: *** [all] Error 2
</pre>
<p>The problem was probably introduced with this commit:</p>
<blockquote>
<p>"uapi: fix linux/if.h userspace compilation errors" (<a href="https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=2618be7dccf8739b89e1906b64bd8d551af351e6" class="external">2618be7dcc</a>)</p>
</blockquote>
<p>Which is part of Linux since 4.11-rc1.</p>
<p>However, it feels like this issue might actually have the root cause in Debian's UAPI header stuff again (<a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: compiling for 4.5 fails: "implicit declaration of function ‘G_TC_AT’" (Closed)" href="https://www.open-mesh.org/issues/322">#322</a>). The batman-adv Make process seems to use "linux-headers-4.11.0-rc5+/include/linux/if.h" which just has the <i>KERNEL</i> guard stripped:</p>
<pre><code>
#ifndef _LINUX_IF_H
#define _LINUX_IF_H
#include <linux/libc-compat.h> /* for compatibility with glibc */
#include <linux/types.h> /* for "__kernel_caddr_t" et al */
#include <linux/socket.h> /* for "struct sockaddr" et al */
/* for "__user" et al */
#include <sys/socket.h> /* for struct sockaddr. */
[...]
</code></pre>
<p>Manually removing this include from the Debian make-kpkg compiled header directory or inserting the "#ifndef <code>__KERNEL__</code>" again helps to compile things again.</p> batman-adv - Bug #322 (Closed): compiling for 4.5 fails: "implicit declaration of function ‘G_TC_...https://www.open-mesh.org/issues/3222016-12-24T07:32:26ZLinus Lüssinglinus.luessing@c0d3.blue
<p>I suspect it might even be the compat code I provided with the last multicast patchset, but couldn't quite verify yet. The issue is the following, occuring when trying to build against a 4.5.0 kernel with a kernel config build via "make defconfig":</p>
<pre>
/home/tux/dev/batman-adv-t_x/gen-compat-autoconf.sh /home/tux/dev/batman-adv-t_x/compat-autoconf.h
mkdir -p /home/tux/dev/batman-adv-t_x/build/net/batman-adv/
compat-patches/replacements.sh
touch /home/tux/dev/batman-adv-t_x/build/net/batman-adv/.compat-prepared
/usr/bin/make -C /home/tux/dev/linux/headers/usr/src/linux-headers-4.5.0+ M=/home/tux/dev/batman-adv-t_x/build PWD=/home/tux/dev/batman-adv-t_x/build REVISION=2016.5 CONFIG_BATMAN_ADV=m CONFIG_BATMAN_ADV_DEBUG=y CONFIG_BATMAN_ADV_DEBUGFS=y CONFIG_BATMAN_ADV_BLA=y CONFIG_BATMAN_ADV_DAT=y CONFIG_BATMAN_ADV_NC=n CONFIG_BATMAN_ADV_MCAST=y CONFIG_BATMAN_ADV_BATMAN_V=y INSTALL_MOD_DIR=updates/ modules
make[1]: Entering directory '/home/tux/dev/linux/headers/usr/src/linux-headers-4.5.0+'
CC [M] /home/tux/dev/batman-adv-t_x/build/net/batman-adv/../../../compat-sources/net/core/skbuff.o
In file included from include/linux/filter.h:16:0,
from include/net/sock.h:64,
from include/linux/tcp.h:22,
from include/linux/ipv6.h:72,
from /home/tux/dev/batman-adv-t_x/build/net/batman-adv/../../../compat-sources/net/core/skbuff.c:35:
include/net/sch_generic.h: In function ‘skb_at_tc_ingress’:
include/net/sch_generic.h:413:2: error: implicit declaration of function ‘G_TC_AT’ [-Werror=implicit-function-declaration]
return G_TC_AT(skb->tc_verd) & AT_INGRESS;
^
include/net/sch_generic.h:413:33: error: ‘AT_INGRESS’ undeclared (first use in this function)
return G_TC_AT(skb->tc_verd) & AT_INGRESS;
^
include/net/sch_generic.h:413:33: note: each undeclared identifier is reported only once for each function it appears in
cc1: all warnings being treated as errors
scripts/Makefile.build:258: recipe for target '/home/tux/dev/batman-adv-t_x/build/net/batman-adv/../../../compat-sources/net/core/skbuff.o' failed
make[3]: *** [/home/tux/dev/batman-adv-t_x/build/net/batman-adv/../../../compat-sources/net/core/skbuff.o] Error 1
scripts/Makefile.build:407: recipe for target '/home/tux/dev/batman-adv-t_x/build/net/batman-adv' failed
make[2]: *** [/home/tux/dev/batman-adv-t_x/build/net/batman-adv] Error 2
Makefile:1391: recipe for target '_module_/home/tux/dev/batman-adv-t_x/build' failed
make[1]: *** [_module_/home/tux/dev/batman-adv-t_x/build] Error 2
make[1]: Leaving directory '/home/tux/dev/linux/headers/usr/src/linux-headers-4.5.0+'
Makefile:90: recipe for target 'all' failed
make: *** [all] Error 2
</pre>
<p>I can reproduce the error with v2016.3, v2016.4, v2016.5 and master. The issue does not occur with a kernel 4.6 to 4.9 - those versions have a CONFIG_NET_CLS_ACT set in their .config, too, and the includes of net/pkt_cls.h, uapi/linux/pkt_cls.h or net/sch_generic.h look the same to me compared to 4.5.0.</p>
<p>Although the includes do indeed look a little strange, I'm currently wondering why "include/net/pkt_cls.h" is not "include/linux/pkt_cls.h" which would match better to the uapi variant, I guess?</p>
<p>I will try to reproduce the issue with a v4.5.7 kernel.</p>
<p><b><em>Update:</em></b></p>
<ul>
<li>4.5.7 does not work either</li>
<li>4.3.0 and 4.4.0 work fine</li>
</ul> batman-adv - Bug #311 (Rejected): Compiling with EXTRA_CFLAGS="-O0" failshttps://www.open-mesh.org/issues/3112016-11-12T09:53:43ZLinus Lüssinglinus.luessing@c0d3.blue
<p>Trying to compile batman-adv (current master) with gcc optimizations disabled fails with the following error message:</p>
<pre>
/usr/bin/make CONFIG_BATMAN_ADV_DEBUG=y CHECK="sparse -Wsparse-all -Wno-ptr-subtraction-blows -Werror -D__CHECK_ENDIAN__ -DDEBUG" CC=cgcc KERNELPATH=/home/tux/mesh-node/usr/src/linux-headers-4.8.0-rc7+ CONFIG_BATMAN_ADV_BATMAN_V=y CONFIG_BATMAN_ADV_DAT=y CONFIG_BATMAN_ADV_MCAST=y EXTRA_CFLAGS="-O0"
/home/tux/dev/batman-adv-t_x/gen-compat-autoconf.sh /home/tux/dev/batman-adv-t_x/compat-autoconf.h
/usr/bin/make -C /home/tux/mesh-node/usr/src/linux-headers-4.8.0-rc7+ M=/home/tux/dev/batman-adv-t_x/build PWD=/home/tux/dev/batman-adv-t_x/build REVISION=2016.4-76-g7c21738 CONFIG_BATMAN_ADV=m CONFIG_BATMAN_ADV_DEBUG=y CONFIG_BATMAN_ADV_DEBUGFS=y CONFIG_BATMAN_ADV_BLA=y CONFIG_BATMAN_ADV_DAT=y CONFIG_BATMAN_ADV_NC=n CONFIG_BATMAN_ADV_MCAST=y CONFIG_BATMAN_ADV_BATMAN_V=y INSTALL_MOD_DIR=updates/ modules
make[1]: Entering directory '/home/tux/mesh-node/usr/src/linux-headers-4.8.0-rc7+'
CC [M] /home/tux/dev/batman-adv-t_x/build/net/batman-adv/../../../compat-sources/net/core/skbuff.o
CC [M] /home/tux/dev/batman-adv-t_x/build/net/batman-adv/../../../compat-sources/net/ipv4/igmp.o
CC [M] /home/tux/dev/batman-adv-t_x/build/net/batman-adv/../../../compat-sources/net/ipv6/mcast_snoop.o
CC [M] /home/tux/dev/batman-adv-t_x/build/net/batman-adv/bat_algo.o
CC [M] /home/tux/dev/batman-adv-t_x/build/net/batman-adv/bat_iv_ogm.o
In file included from /home/tux/dev/batman-adv-t_x/build/../compat-include/linux/rculist.h:25:0,
from ./include/linux/sched.h:45,
from ./include/linux/kasan.h:4,
from ./include/linux/slab.h:118,
from /home/tux/dev/batman-adv-t_x/build/../compat-include/linux/slab.h:25,
from ./include/linux/textsearch.h:8,
from ./include/linux/skbuff.h:30,
from /home/tux/dev/batman-adv-t_x/build/../compat-include/linux/skbuff.h:25,
from ./include/linux/if_ether.h:23,
from /home/tux/dev/batman-adv-t_x/build/../compat-include/linux/if_ether.h:25,
from ./include/linux/etherdevice.h:25,
from /home/tux/dev/batman-adv-t_x/build/../compat-include/linux/etherdevice.h:25,
from /home/tux/dev/batman-adv-t_x/build/net/batman-adv/main.h:189,
from /home/tux/dev/batman-adv-t_x/build/net/batman-adv/bat_iv_ogm.h:21,
from /home/tux/dev/batman-adv-t_x/build/net/batman-adv/bat_iv_ogm.c:18:
./include/linux/rculist.h: In function ‘hlist_add_head_rcu’:
./include/linux/rculist.h:485:922: error: call to ‘__compiletime_assert_485’ declared with attribute error: Need native word sized stores/loads for atomicity.
rcu_assign_pointer(hlist_first_rcu(h), n);
^
scripts/Makefile.build:289: recipe for target '/home/tux/dev/batman-adv-t_x/build/net/batman-adv/bat_iv_ogm.o' failed
make[3]: *** [/home/tux/dev/batman-adv-t_x/build/net/batman-adv/bat_iv_ogm.o] Error 1
scripts/Makefile.build:440: recipe for target '/home/tux/dev/batman-adv-t_x/build/net/batman-adv' failed
make[2]: *** [/home/tux/dev/batman-adv-t_x/build/net/batman-adv] Error 2
Makefile:1471: recipe for target '_module_/home/tux/dev/batman-adv-t_x/build' failed
make[1]: *** [_module_/home/tux/dev/batman-adv-t_x/build] Error 2
make[1]: Leaving directory '/home/tux/mesh-node/usr/src/linux-headers-4.8.0-rc7+'
Makefile:90: recipe for target 'all' failed
make: *** [all] Error 2
</pre>
<p>I tried compiling for a 4.8-rc7 and a 4.9-rc3 kernel and various others, which are all failing. 3.14 works though while 3.15 doesn't, so seems to be related to some change introduced with 3.15.</p>
<p>GCC version is from Debian stable:</p>
<pre>
$ gcc --version
gcc-4.9.real (Debian 4.9.2-10) 4.9.2
[...]
</pre>
<p>Also, all v2015.x and v2016.x batman-adv versions fail, too.</p> batman-adv - Bug #305 (Closed): OOPses regarding netlinkhttps://www.open-mesh.org/issues/3052016-11-01T05:34:58ZLinus Lüssinglinus.luessing@c0d3.blue
<p>And another round of bisect'ing (I just want to rebase and fixup my patch, seems like the current code does not want me to :D).</p>
<p>Compiling batman-adv for a 4.9-rc3 kernel, I get the following traces when restarting batman-adv:</p>
<pre>
[ 1096.202195] batman_adv: loading out-of-tree module taints kernel.
[ 1096.221003] batman_adv: B.A.T.M.A.N. advanced 2016.4-59-gc776b4a (compatibility version 15) loaded
[ 1096.938371] batman_adv: bat0: Adding interface: ens4
[ 1096.939126] batman_adv: bat0: Interface activated: ens4
[ 1104.157213] BUG: unable to handle kernel paging request at ffffffffa0603070
[ 1104.158016] IP: [<ffffffff814dd474>] list_del+0x2d/0x51
[ 1104.158555] PGD 1e0b067 [ 1104.158794] PUD 1e0c063
PMD b4bb067 [ 1104.159162] PTE 800000000058a161
[ 1104.159493]
[ 1104.159665] Oops: 0003 [#1] SMP
[ 1104.159986] Modules linked in: batman_adv(O-) cfg80211 kvm_amd kvm irqbypass evdev acpi_cpufreq serio_raw tpm_tis tpm_tis_core tpm i2c_piix4 processor button i2c_core bridge stp llc ipv6 autofs4 dm_mirror dm_region_hash dm_log dm_mod 9p fscache 9pnet_virtio 9pnet 8139too ata_generic libata virtio_pci 8139cp scsi_mod e1000 virtio_ring virtio mii
[ 1104.160404] CPU: 0 PID: 2151 Comm: rmmod Tainted: G O 4.9.0-rc3+ #1
[ 1104.160404] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.7.5-20140531_083030-gandalf 04/01/2014
[ 1104.160404] task: ffff880009230300 task.stack: ffffc9000024c000
[ 1104.160404] RIP: 0010:[<ffffffff814dd474>] [<ffffffff814dd474>] list_del+0x2d/0x51
[ 1104.160404] RSP: 0018:ffffc9000024fe30 EFLAGS: 00010282
[ 1104.160404] RAX: dead000000000100 RBX: ffffffffa0603070 RCX: 0000000000000000
[ 1104.160404] RDX: 0000000000000050 RSI: ffffffff81f91160 RDI: ffffffffa0603070
[ 1104.160404] RBP: ffffc9000024fe38 R08: 0000000000000000 R09: ffffffff81b9cf7c
[ 1104.160404] R10: ffffc9000024fc08 R11: ffff8800054128d0 R12: 0000000000000001
[ 1104.160404] R13: 000000000000000a R14: 0000000000000000 R15: 0000000000000000
[ 1104.160404] FS: 00007f0b9d635700(0000) GS:ffff88000ee00000(0000) knlGS:0000000000000000
[ 1104.160404] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 1104.160404] CR2: ffffffffa0603070 CR3: 000000000db87000 CR4: 00000000000006f0
[ 1104.160404] Stack:
[ 1104.160404] ffffffffa0603000 ffffc9000024feb0 ffffffff8179c735 0000000108a44fa8
[ 1104.160404] ffffffffa0603070 ffffffff81131d6c ffffffff826b16c0 ffff880008a44ea8
[ 1104.160404] ffffc9000024feb0 ffffffff813a9d46 ffff880005e08108 ffffffffa0606580
[ 1104.160404] Call Trace:
[ 1104.160404] [<ffffffff8179c735>] genl_unregister_family+0x27f/0x36b
[ 1104.160404] [<ffffffff81131d6c>] ? synchronize_srcu+0x2d/0x30
[ 1104.160404] [<ffffffff813a9d46>] ? debugfs_remove_recursive+0x19a/0x263
[ 1104.160404] [<ffffffffa05f1363>] batadv_netlink_unregister+0x10/0x12 [batman_adv]
[ 1104.160404] [<ffffffffa05fdd05>] batadv_exit+0xe/0x309 [batman_adv]
[ 1104.160404] [<ffffffff81168473>] SyS_delete_module+0x213/0x286
[ 1104.160404] [<ffffffff818aa2ea>] entry_SYSCALL_64_fastpath+0x18/0xad
[ 1104.160404] [<ffffffff811016e8>] ? trace_hardirqs_off_caller+0x5a/0x168
[ 1104.160404] Code: 89 e5 53 48 89 fb e8 9b fe ff ff 48 85 db 75 0e 31 f6 48 c7 c7 e0 c4 3d 82 e8 67 6d 02 00 48 b8 00 01 00 00 00 00 ad de 48 85 db <48> 89 03 75 0e 31 f6 48 c7 c7 b0 c4 3d 82 e8 47 6d 02 00 48 b8
[ 1104.160404] RIP [<ffffffff814dd474>] list_del+0x2d/0x51
[ 1104.160404] RSP <ffffc9000024fe30>
[ 1104.160404] CR2: ffffffffa0603070
[ 1104.160404] ---[ end trace f1bad3aa0c610690 ]---
[ 1104.160404] BUG: sleeping function called from invalid context at ./include/linux/sched.h:3109
[ 1104.160404] in_atomic(): 0, irqs_disabled(): 1, pid: 2151, name: rmmod
[ 1104.160404] INFO: lockdep is turned off.
[ 1104.160404] irq event stamp: 29092
[ 1104.160404] hardirqs last enabled at (29091): [ 1104.160404] [<ffffffff818a9dae>] _raw_spin_unlock_irqrestore+0x3a/0x48
[ 1104.160404] hardirqs last disabled at (29092): [ 1104.160404] [<ffffffff818ac1b6>] error_entry+0x66/0xc0
[ 1104.160404] softirqs last enabled at (28500): [ 1104.160404] [<ffffffff8109de26>] __do_softirq+0x63b/0x85a
[ 1104.160404] softirqs last disabled at (28415): [ 1104.160404] [<ffffffff8109e2f4>] irq_exit+0x6f/0x11c
[ 1104.160404] CPU: 0 PID: 2151 Comm: rmmod Tainted: G D O 4.9.0-rc3+ #1
[ 1104.160404] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.7.5-20140531_083030-gandalf 04/01/2014
[ 1104.160404] ffffc9000024fe30 ffffffff814a1fe3 0000000000000006 ffffc9000024c000
[ 1104.160404] 0000000000000867 ffffc9000024fe60 ffffffff810d42f9 ffff880009230300
[ 1104.160404] ffffffff81b85605 0000000000000c25 0000000000000000 ffffc9000024fea0
[ 1104.160404] Call Trace:
[ 1104.160404] [<ffffffff814a1fe3>] dump_stack+0x68/0x99
[ 1104.160404] [<ffffffff810d42f9>] ___might_sleep+0x257/0x26c
[ 1104.160404] [<ffffffff810d439d>] __might_sleep+0x8f/0x132
[ 1104.160404] [<ffffffff810aef6d>] exit_signals+0x1e/0x26b
[ 1104.160404] [<ffffffff810991c1>] do_exit+0x1ef/0x1558
[ 1104.160404] [<ffffffff81168473>] ? SyS_delete_module+0x213/0x286
[ 1104.160404] [<ffffffff818ac3d7>] rewind_stack_do_exit+0x17/0x20
[ 1104.160404] [<ffffffff811016e8>] ? trace_hardirqs_off_caller+0x5a/0x168
</pre>
<p>Bisec'ting leads me to:</p>
<p>c776b4a071d82f8 ("batman-adv: genetlink: mark families as __ro_after_init")</p> batman-adv - Bug #304 (Rejected): gcc6: "error: code model kernel does not support PIC mode"https://www.open-mesh.org/issues/3042016-10-31T05:39:16ZLinus Lüssinglinus.luessing@c0d3.blue
<p>On a Debian Sid compiling for a 4.9-rc3 kernel with gcc 6.2.0-10, I curently get the following error:</p>
<pre>
root@Linus-Debian:/mnt/batman-adv-t_x# make
/mnt/batman-adv-t_x/gen-compat-autoconf.sh /mnt/batman-adv-t_x/compat-autoconf.h
mkdir -p /mnt/batman-adv-t_x/build/net/batman-adv/
compat-patches/replacements.sh
touch /mnt/batman-adv-t_x/build/net/batman-adv/.compat-prepared
make -C /lib/modules/4.9.0-rc3+/build M=/mnt/batman-adv-t_x PWD=/mnt/batman-adv-t_x REVISION=2016.4 CONFIG_BATMAN_ADV=m CONFIG_BATMAN_ADV_DEBUG=n CONFIG_BATMAN_ADV_DEBUGFS=y CONFIG_BATMAN_ADV_BLA=y CONFIG_BATMAN_ADV_DAT=y CONFIG_BATMAN_ADV_NC=n CONFIG_BATMAN_ADV_MCAST=y CONFIG_BATMAN_ADV_BATMAN_V=n INSTALL_MOD_DIR=updates/ modules
make[1]: Entering directory '/usr/src/linux-headers-4.9.0-rc3+'
cat: -: No such file or directory
CC [M] /mnt/batman-adv-t_x/build/net/batman-adv/../../../compat-sources/net/core/skbuff.o
/mnt/batman-adv-t_x/build/net/batman-adv/../../../compat-sources/net/core/skbuff.c:1:0: error: code model kernel does not support PIC mode
/*
scripts/Makefile.build:290: recipe for target '/mnt/batman-adv-t_x/build/net/batman-adv/../../../compat-sources/net/core/skbuff.o' failed
make[3]: *** [/mnt/batman-adv-t_x/build/net/batman-adv/../../../compat-sources/net/core/skbuff.o] Error 1
scripts/Makefile.build:475: recipe for target '/mnt/batman-adv-t_x/build/net/batman-adv' failed
make[2]: *** [/mnt/batman-adv-t_x/build/net/batman-adv] Error 2
Makefile:1482: recipe for target '_module_/mnt/batman-adv-t_x' failed
make[1]: *** [_module_/mnt/batman-adv-t_x] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.9.0-rc3+'
Makefile:89: recipe for target 'all' failed
make: *** [all] Error 2
</pre>
<p>It seems to have something to do with PIE hardening which got enabled by default in gcc6 last week in Debian: <a class="external" href="https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=835148">https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=835148</a></p>
<p>Compiling with '$ make EXTRA_CFLAGS="-fno-pie"' helps.</p>
<p>So my question is, whether this flag should be added to the batman-adv out-of-tree Makefile.</p>
<p>Some comments seem to suggest, that PIE does not work for kernels / kernel modules by design. (I have not looked at what PIE hardening actually is, so I have no clue yet whether disabling is the right choice)</p>