Re: [LEDE-DEV] [PATCH v2] ramips: add support for Ubiquiti EdgeRouter X-SFP

2017-06-08 Thread p . wassi
Hi guys,

I may be hijacking this specific thread, but as 'testing' was mentioned here...
I'm running an Edgerouter X since yesterday (not the -SPF version!) on LEDE 
r4356
and am getting these kernel errors/warnings every five minutes or so:

> [  470.41] INFO: rcu_sched detected stalls on CPUs/tasks:
> [  470.42]1-...: (127 GPs behind) idle=ee6/0/0 softirq=9641/9643 
> fqs=1 
> [  470.43](detected by 3, t=6004 jiffies, g=898, c=897, q=606)
> [  470.44] Task dump for CPU 1:
> [  470.45] swapper/1   R running  0 0  1 0x0010
> [  470.46] Stack :  0e406087 006d  0061 7795a2c0 
> 804df2a4 8049
> [  470.46]  8048c75c 0001 0001 8048c540 8048c724 8049 
>  800135e4
> [  470.46]  1100fc03 0003 8fc7 8fc71ec0 8049 8005ecc8 
> 1100fc03 0001
> [  470.46]   8049 804df2a4 8005ecc0 8049 8001b1a8 
> 1100fc03 
> [  470.46]  0004 8048c4a0 00a0 8001b1b0 b6fd a02eacbf 
> 5d3cafc3 7dbbdccc
> [  470.46]  ...
> [  470.53] Call Trace:
> [  470.54] [<8000be98>] __schedule+0x574/0x758
> [  470.55] [<800135e4>] r4k_wait_irqoff+0x0/0x20
> [  470.55] 
> [  470.56] rcu_sched kthread starved for 6016 jiffies! g898 c897 f0x0 s3 
> ->state=0x1

Kernel is 4.4.71

Also, just while editing a config file the router rebooted.
Does someone else also have this issue?

Best regards,
P. Wassi


> On 07/06/17 12:10, John Crispin wrote:
> 
> 
> On 07/06/17 01:36, Sven Roederer wrote:
> > John,
> >
> > just checked with master build f500799 as initrd-kernel. Looks fine as
> > I can see from bootlog.
> > Anything special to test?
> >
> > [1.71] MediaTek Nand driver init, version v2.1 Fix AHB virt2phys 
> > error
> > [1.72] Allocate 16 byte aligned buffer: 80592f90
> > [1.73] Enable NFI Clock
> > [1.74] # MTK NAND # : Use HW ECC
> > [1.74] Device found in MTK table, ID: 1da, EXT_ID: 909546
> > [1.76] Support this Device in MTK table! 1da
> > [1.77] nand: device found, Manufacturer ID: 0x01, Chip ID: 0xda
> > [1.78] nand: AMD/Spansion NAND 256MiB 3,3V 8-bit
> > [1.79] nand: 256 MiB, SLC, erase size: 128 KiB, page size: 2048, 
> > OOB size: 128
> > [1.80] [NAND]select ecc bit:12, sparesize :112 spare_per_sector=28
> > [1.82] Scanning device for bad blocks
> > [2.52] 6 ofpart partitions found on MTD device MT7621-NAND
> > [2.53] Creating 6 MTD partitions on "MT7621-NAND":
> > [2.54] 0x-0x0008 : "u-boot"
> > [2.55] 0x0008-0x000e : "u-boot-env"
> > [2.56] 0x000e-0x0014 : "factory"
> > [2.57] 0x0014-0x0044 : "kernel1"
> > [2.58] 0x0044-0x0074 : "kernel2"
> > [2.59] 0x0074-0x0ff0 : "ubi"
> > [2.61] [mtk_nand] probe successfully!
> > [2.61] Signature matched and data read!
> > [2.62] load_fact_bbt success 2047
> >
> >
> > Sven
> Thanks for testing, i just wanted a 2nd test result for the nand support 
> on v4.9. i think i'll just switch ramips to v4.9 and hope all goes well.
> 
>  John
> 
> ___
> Lede-dev mailing list
> Lede-dev@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev
> 

___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH v2] dnsmasq: manage resolv.conf iff when listening on 127.0.0.1#53

2017-06-08 Thread Paul Oranje
With this patch the dnsmasq init script manages resolv.conf if and only if
when dnsmasq will listen on 127.0.0.1#53 (is main resolver instance).
Also, resolvfile is now set irrespective of the value of noresolv.

Fixes (partially) FS#785

Signed-off-by: Paul Oranje 
---
History
v1 -> v2corrected synxtax error

The intended invariant is that resolv.conf is managed whenever a resolver
listens on 127.0.0.1#53. Besides dnsmasq, unbound can take that role as well.
When no instance of dnsmasq has been configured to listen on 127.0.0.1#53 then
resolv.conf is not touched.

Currently unbound handles resolv.conf also, but leaves it to dnsmasq whenever
that will run, even when no dnsmasq instance will listen on localhost:53. So
for unbound PR#4454  has been submitted to make sure it always manages
resov.conf when it owns localhost:domain.

Paul
---
 .../network/services/dnsmasq/files/dnsmasq.init| 60 +-
 1 file changed, 35 insertions(+), 25 deletions(-)

diff --git a/package/network/services/dnsmasq/files/dnsmasq.init 
b/package/network/services/dnsmasq/files/dnsmasq.init
index 62a3169c67..a03c402f6d 100644
--- a/package/network/services/dnsmasq/files/dnsmasq.init
+++ b/package/network/services/dnsmasq/files/dnsmasq.init
@@ -695,6 +695,21 @@ dhcp_relay_add() {
fi
 }
 
+dnsmasq_ismain()
+{
+   local cfg="$1"
+   local port notinterfaces
+
+   config_get port "$cfg" port "53"
+   [ $port = "53" ] || return 1
+
+   config_get notinterfaces "$cfg" notinterface ""
+   [ -n $notinterfaces ] && list_contains $notinterfaces "loopback" || 
return 1
+
+   # dnsmasq instance is designated to listen on 127.0.0.1#53.
+   return 0
+}
+
 dnsmasq_start()
 {
local cfg="$1" disabled resolvfile user_dhcpscript
@@ -839,14 +854,10 @@ dnsmasq_start()
[ -n "$leasefile" -a \! -e "$leasefile" ] && touch "$leasefile"
config_get_bool cachelocal "$cfg" cachelocal 1
 
-   config_get_bool noresolv "$cfg" noresolv 0
-   if [ "$noresolv" != "1" ]; then
-   config_get resolvfile "$cfg" resolvfile "/tmp/resolv.conf.auto"
-   # So jail doesn't complain if file missing
-   [ -n "$resolvfile" -a \! -e "$resolvfile" ] && touch 
"$resolvfile"
-   fi
-
-   [ -n "$resolvfile" ] && xappend "--resolv-file=$resolvfile"
+   config_get resolvfile "$cfg" resolvfile "/tmp/resolv.conf.auto"
+   xappend "--resolv-file=$resolvfile"
+   # So jail doesn't complain if file missing
+   [ \! -e "$resolvfile" ] && touch "$resolvfile"
 
config_get hostsfile "$cfg" dhcphostsfile
[ -e "$hostsfile" ] && xappend "--dhcp-hostsfile=$hostsfile"
@@ -959,16 +970,6 @@ dnsmasq_start()
echo >> $CONFIGFILE_TMP
mv -f $CONFIGFILE_TMP $CONFIGFILE
 
-   [ "$resolvfile" = "/tmp/resolv.conf.auto" ] && {
-   rm -f /tmp/resolv.conf
-   [ $ADD_LOCAL_DOMAIN -eq 1 ] && [ -n "$DOMAIN" ] && {
-   echo "search $DOMAIN" >> /tmp/resolv.conf
-   }
-   DNS_SERVERS="$DNS_SERVERS 127.0.0.1"
-   for DNS_SERVER in $DNS_SERVERS ; do
-   echo "nameserver $DNS_SERVER" >> /tmp/resolv.conf
-   done
-   }
 
procd_open_instance $cfg
procd_set_param command $PROG -C $CONFIGFILE -k -x 
/var/run/dnsmasq/dnsmasq."${cfg}".pid
@@ -986,20 +987,29 @@ dnsmasq_start()
procd_add_jail_mount_rw /var/run/dnsmasq/ $leasefile
 
procd_close_instance
+
+
+   # write /tmp/resolve.conf only for main instance
+   dnsmasq_ismain $cfg && {
+   rm -f /tmp/resolv.conf
+   [ $ADD_LOCAL_DOMAIN -eq 1 ] && [ -n "$DOMAIN" ] && {
+   echo "search $DOMAIN" >> /tmp/resolv.conf
+   }
+   DNS_SERVERS="$DNS_SERVERS 127.0.0.1"
+   for DNS_SERVER in $DNS_SERVERS ; do
+   echo "nameserver $DNS_SERVER" >> /tmp/resolv.conf
+   done
+   }
 }
 
 dnsmasq_stop()
 {
local cfg="$1"
 
-   config_get resolvfile "$cfg" "resolvfile"
-
#relink /tmp/resolve.conf only for main instance
-   [ "$resolvfile" = "/tmp/resolv.conf.auto" ] && {
-   [ -f /tmp/resolv.conf ] && {
-   rm -f /tmp/resolv.conf
-   ln -s "$resolvfile" /tmp/resolv.conf
-   }
+   dnsmasq_ismain $cfg && {
+   [ -f /tmp/resolv.conf ] && rm -f /tmp/resolv.conf
+   ln -s /tmp/resolv.conf.auto /tmp/resolv.conf
}
 
rm -f ${BASEDHCPSTAMPFILE}.${cfg}.*.dhcp
-- 
2.13.1


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH] dnsmasq: manage resolv.conf iff when listening on 127.0.0.1#53

2017-06-08 Thread Paul Oranje
Hi Hans,

Please see my reaction/question on your remark about #53 and the main instance.

Thanks for reviewing,
Paul


> Op 8 jun. 2017, om 16:34 heeft Hans Dedecker  het 
> volgende geschreven:
> 
> On Wed, Jun 7, 2017 at 12:07 PM, Paul Oranje  wrote:
>> With this patch the dnsmasq init script manages resolv.conf if and only if
>> when dnsmasq will listen on 127.0.0.1#53 (is main resolver instance).
>> Also, resolvfile is now set irrespective of the value of noresolv.
>> 
>> Fixes (partially) FS#785
>> 
>> Signed-off-by: Paul Oranje 
>> ---
>> The intended invariant is that resolv.conf is managed whenever a resolver
>> listens on 127.0.0.1#53. Besides dnsmasq, unbound can take that role as well.
>> When no instance of dnsmasq has been configured to listen on 127.0.0.1#53 
>> then
>> resolv.conf is not touched.
>> 
>> Currently unbound handles resolv.conf also, but leaves it to dnsmasq whenever
>> that will run, even when no dnsmasq instance will listen on localhost:53. So
>> for unbound PR#4454a  has been submitted to make sure it always manages
>> resov.conf when it owns localhost:domain.
>> 
>> Background:
>> This patch has been discussed with Hans Dedecker and Eric Luerhsen and 
>> replaces
>> an earlier patch that is hereby retracted:
>>dnsmasq: write resolv.conf also when noresolv = 1
>> 
>> Paul
>> 
>> ---
>> .../network/services/dnsmasq/files/dnsmasq.init| 60 
>> +-
>> 1 file changed, 35 insertions(+), 25 deletions(-)
>> 
>> diff --git a/package/network/services/dnsmasq/files/dnsmasq.init 
>> b/package/network/services/dnsmasq/files/dnsmasq.init
>> index 62a3169c67..cab3d2843c 100644
>> --- a/package/network/services/dnsmasq/files/dnsmasq.init
>> +++ b/package/network/services/dnsmasq/files/dnsmasq.init
>> @@ -695,6 +695,21 @@ dhcp_relay_add() {
>>fi
>> }
>> 
>> +dnsmasq_ismain()
>> +{
>> +   local cfg="$1"
>> +   local port notinterfaces
>> +
>> +   config_get port "$cfg" port "53"
>> +   [ $port = "53" ] || return 1
> Any reason why a dnsmasq instance has to be bound on port 53 to be
> considered as main instance ? If port is not 0 it can be considered as
> a dnsmasq main instance as a dnat rule can rewrite the udp destination
> port
The "main instance" is with respect to /etc/resolv.conf and its format does not 
support setting a port for the nameserver [1].
A dnat rule that rewrites the destination port absolutely did not cross my mind 
- would one rewrite a local port ?

The management of resolv.conf by the init script of dnsmasq (and of unbound) is 
about making **itself** the nameserver for the processes running on the same 
host. When it cannot be assumed that 127.0.0.1#53 is listened on by a local 
daemon, how can one pick the "right" instance when multiple instances resolver 
are possible ?

If rewriting of a local port to another local port must be coped with, then a 
separate config value that explicitly denotes the instance that will run as the 
nameserver for the local processes might be needed.

[1] man 5 resolv.conf


>> +
>> +   config_get notinterfaces "$cfg" notinterface ""
>> +   [ -n $notinterfaces -a list_contains $notinterfaces "loopback" ] || 
>> return 1
> Has this been tested ?
> Following error is thrown "sh: loopback: unknown operand" when doing
> dnsmasq restart
Yes tested, evidently not enough, not with dnsmasq owning #53, so the test did 
not cover this code path.
Will take care of that (and test with dnsmasq owning #53).
A grep on this erroneous syntax revealed it being the only one.

>> +
>> +   # dnsmasq instance is designated to listen on 127.0.0.1#53.
>> +   return 0
>> +}
>> +
>> dnsmasq_start()
>> {
>>local cfg="$1" disabled resolvfile user_dhcpscript
>> @@ -839,14 +854,10 @@ dnsmasq_start()
>>[ -n "$leasefile" -a \! -e "$leasefile" ] && touch "$leasefile"
>>config_get_bool cachelocal "$cfg" cachelocal 1
>> 
>> -   config_get_bool noresolv "$cfg" noresolv 0
>> -   if [ "$noresolv" != "1" ]; then
>> -   config_get resolvfile "$cfg" resolvfile 
>> "/tmp/resolv.conf.auto"
>> -   # So jail doesn't complain if file missing
>> -   [ -n "$resolvfile" -a \! -e "$resolvfile" ] && touch 
>> "$resolvfile"
>> -   fi
>> -
>> -   [ -n "$resolvfile" ] && xappend "--resolv-file=$resolvfile"
>> +   config_get resolvfile "$cfg" resolvfile "/tmp/resolv.conf.auto"
>> +   xappend "--resolv-file=$resolvfile"
>> +   # So jail doesn't complain if file missing
>> +   [ \! -e "$resolvfile" ] && touch "$resolvfile"
>> 
>>config_get hostsfile "$cfg" dhcphostsfile
>>[ -e "$hostsfile" ] && xappend "--dhcp-hostsfile=$hostsfile"
>> @@ -959,16 +970,6 @@ dnsmasq_start()
>>echo >> $CONFIGFILE_TMP
>>mv -f $CONFIGFILE_TMP $CONFIGFILE
>> 
>> -   [ "$resolvfile" = "/tmp/resolv.conf.auto" ] && {
>> -   rm -f /tmp/resolv.conf
>> -   [ $ADD_LOCAL_DOMAIN -eq 1 ] && [ -n "$DOMAIN" ] 

Re: [LEDE-DEV] /lib/functions/network.sh & ip6ifaceid

2017-06-08 Thread Eric Masson

Le 08/06/2017 à 13:57, Hans Dedecker a écrit :

Hi Hans & all,


Meanwhile the issue has been fixed by jow on trunk
(https://git.lede-project.org/?p=source.git;a=commit;h=7f91cabd0d5b6e1a716d9e3fab4103730d9d2888)
and lede-17.0.1 branch
(https://git.lede-project.org/?p=source.git;a=commit;h=df4363b607629710240dcaccf4e3f0bc6fae93ae)


Seems jow has fixed the remaining issues :
https://git.lede-project.org/?p=source.git;a=commit;h=6426e4edef7baddf377ee63baf43fbe39f4f5e79

@jow : Thanks a lot for this quick fix. I'll now try to understand the 
diff as shell scripting looks like some kind of black magic to me ;)


Regards

Éric Masson


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH] ramips: fix GPIOs for Ubiquiti EdgeRouter X-SFP

2017-06-08 Thread Sven Roederer
This adds the i2c-gpio and i2c-pca95xx module to the default kernel.
Even they are listed in the dependencies of the board, they are not
built and for this missing in the imagefile. This causes that the
accessed hardware is not avail.

Signed-off-by: Sven Roederer 
---
 target/linux/ramips/mt7621/config-4.4 | 3 +++
 target/linux/ramips/mt7621/config-4.9 | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/target/linux/ramips/mt7621/config-4.4 
b/target/linux/ramips/mt7621/config-4.4
index 383370b..b7f7a3d 100644
--- a/target/linux/ramips/mt7621/config-4.4
+++ b/target/linux/ramips/mt7621/config-4.4
@@ -70,6 +70,8 @@ CONFIG_GENERIC_TIME_VSYSCALL=y
 CONFIG_GPIOLIB=y
 CONFIG_GPIO_DEVRES=y
 CONFIG_GPIO_MT7621=y
+CONFIG_GPIO_PCA953X=y
+CONFIG_GPIO_PCA953X_IRQ=n
 # CONFIG_GPIO_RALINK is not set
 CONFIG_GPIO_SYSFS=y
 CONFIG_HARDWARE_WATCHPOINTS=y
@@ -116,6 +118,7 @@ CONFIG_HIGHMEM=y
 CONFIG_HW_HAS_PCI=y
 CONFIG_HZ_PERIODIC=y
 CONFIG_I2C=y
+CONFIG_I2C_GPIO=y
 CONFIG_I2C_MT7621=y
 # CONFIG_IMG_MDC_DMA is not set
 CONFIG_INITRAMFS_SOURCE=""
diff --git a/target/linux/ramips/mt7621/config-4.9 
b/target/linux/ramips/mt7621/config-4.9
index 6e95468..ca64117 100644
--- a/target/linux/ramips/mt7621/config-4.9
+++ b/target/linux/ramips/mt7621/config-4.9
@@ -75,6 +75,8 @@ CONFIG_GENERIC_SMP_IDLE_THREAD=y
 CONFIG_GENERIC_TIME_VSYSCALL=y
 CONFIG_GPIOLIB=y
 CONFIG_GPIO_MT7621=y
+CONFIG_GPIO_PCA953X=y
+CONFIG_GPIO_PCA953X_IRQ=n
 # CONFIG_GPIO_RALINK is not set
 CONFIG_GPIO_SYSFS=y
 CONFIG_HANDLE_DOMAIN_IRQ=y
@@ -123,6 +125,7 @@ CONFIG_HW_HAS_PCI=y
 CONFIG_HZ_PERIODIC=y
 CONFIG_I2C=y
 CONFIG_I2C_BOARDINFO=y
+CONFIG_I2C_GPIO=y
 CONFIG_I2C_MT7621=y
 CONFIG_INITRAMFS_SOURCE=""
 CONFIG_IRQCHIP=y
-- 
2.1.4


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] /lib/functions/network.sh & ip6ifaceid

2017-06-08 Thread e9hack
Am 07.06.2017 um 19:33 schrieb Eric Masson:
>> root@rtrwrtfenint:/tmp#  . /lib/functions/network.sh; 
>> network_get_ipaddrs_all ipaddrs lan ; echo $ipaddrs
>> 192.168.85.15 fd75:43df:37f2::1

This function or the way how it is used by /etc/init.d/dropbear has more issues:

root@WLAN-DSL8:~# . /lib/functions/network.sh; network_get_ipaddrs_all ipaddrs 
wan ; echo $ipaddrs
217.xxx.xxx.xxx fe80:::::

root@WLAN-DSL8:~# ifconfig pppoe-wan
pppoe-wan Link encap:Point-to-Point Protocol
  inet addr:217.xxx.xxx.xxx  P-t-P:87.yyy.yyy.yyy  Mask:255.255.255.255
  inet6 addr: 2003:::::::/64 Scope:Global
  inet6 addr: fe80:::::/10 Scope:Link
  UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1492  Metric:1
  RX packets:7693 errors:0 dropped:0 overruns:0 frame:0
  TX packets:4597 errors:0 dropped:0 overruns:0 carrier:0
  collisions:0 txqueuelen:3
  RX bytes:7357150 (7.0 MiB)  TX bytes:1929354 (1.8 MiB)

root@WLAN-DSL8:~# ps -ww
23253 root  1160 S/usr/sbin/dropbear -F -P /var/run/dropbear.2.pid -g 
-p 217.xxx.xxx.xxx:2022 -p
fe80::::::2 -K 300

Dropbear doesn't listen on the global ipv6 address 
2003:::::::.

Regards,
Hartmut

___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [RFC PATCH] tools/squashfs: change to upstream and update to new version 5.0-rc1

2017-06-08 Thread Alexander Couzens
Hi Phillip,

nice to hear you're still there!

There was no offense meant in my patch, I just couldn't reach you
via email nor did anybody respond to patches for a year on the ml. So my
simple conlusion was there is an orphaned project with is important for
the community. Many distributions use squashfs for their Installer
or even as rootfs. 

In the future how would you as the maintainer like to receive
contributions to simplify things on your side?
Do you still want to use the mailinglist at sourceforge?
What are your plans regarding the many out-of-tree patches from
different distributions?

Best,
lynxis
-- 
Alexander Couzens

mail: lyn...@fe80.eu
jabber: lyn...@fe80.eu
mobile: +4915123277221
gpg: 390D CF78 8BF9 AA50 4F8F  F1E2 C29E 9DA6 A0DF 8604


pgpDUrIU8MFPm.pgp
Description: OpenPGP digital signature
___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH] dnsmasq: manage resolv.conf iff when listening on 127.0.0.1#53

2017-06-08 Thread Hans Dedecker
On Wed, Jun 7, 2017 at 12:07 PM, Paul Oranje  wrote:
> With this patch the dnsmasq init script manages resolv.conf if and only if
> when dnsmasq will listen on 127.0.0.1#53 (is main resolver instance).
> Also, resolvfile is now set irrespective of the value of noresolv.
>
> Fixes (partially) FS#785
>
> Signed-off-by: Paul Oranje 
> ---
> The intended invariant is that resolv.conf is managed whenever a resolver
> listens on 127.0.0.1#53. Besides dnsmasq, unbound can take that role as well.
> When no instance of dnsmasq has been configured to listen on 127.0.0.1#53 then
> resolv.conf is not touched.
>
> Currently unbound handles resolv.conf also, but leaves it to dnsmasq whenever
> that will run, even when no dnsmasq instance will listen on localhost:53. So
> for unbound PR#4454a  has been submitted to make sure it always manages
> resov.conf when it owns localhost:domain.
>
> Background:
> This patch has been discussed with Hans Dedecker and Eric Luerhsen and 
> replaces
> an earlier patch that is hereby retracted:
> dnsmasq: write resolv.conf also when noresolv = 1
>
> Paul
>
> ---
>  .../network/services/dnsmasq/files/dnsmasq.init| 60 
> +-
>  1 file changed, 35 insertions(+), 25 deletions(-)
>
> diff --git a/package/network/services/dnsmasq/files/dnsmasq.init 
> b/package/network/services/dnsmasq/files/dnsmasq.init
> index 62a3169c67..cab3d2843c 100644
> --- a/package/network/services/dnsmasq/files/dnsmasq.init
> +++ b/package/network/services/dnsmasq/files/dnsmasq.init
> @@ -695,6 +695,21 @@ dhcp_relay_add() {
> fi
>  }
>
> +dnsmasq_ismain()
> +{
> +   local cfg="$1"
> +   local port notinterfaces
> +
> +   config_get port "$cfg" port "53"
> +   [ $port = "53" ] || return 1
Any reason why a dnsmasq instance has to be bound on port 53 to be
considered as main instance ? If port is not 0 it can be considered as
a dnsmasq main instance as a dnat rule can rewrite the udp destination
port
> +
> +   config_get notinterfaces "$cfg" notinterface ""
> +   [ -n $notinterfaces -a list_contains $notinterfaces "loopback" ] || 
> return 1
Has this been tested ?
Following error is thrown "sh: loopback: unknown operand" when doing
dnsmasq restart
> +
> +   # dnsmasq instance is designated to listen on 127.0.0.1#53.
> +   return 0
> +}
> +
>  dnsmasq_start()
>  {
> local cfg="$1" disabled resolvfile user_dhcpscript
> @@ -839,14 +854,10 @@ dnsmasq_start()
> [ -n "$leasefile" -a \! -e "$leasefile" ] && touch "$leasefile"
> config_get_bool cachelocal "$cfg" cachelocal 1
>
> -   config_get_bool noresolv "$cfg" noresolv 0
> -   if [ "$noresolv" != "1" ]; then
> -   config_get resolvfile "$cfg" resolvfile 
> "/tmp/resolv.conf.auto"
> -   # So jail doesn't complain if file missing
> -   [ -n "$resolvfile" -a \! -e "$resolvfile" ] && touch 
> "$resolvfile"
> -   fi
> -
> -   [ -n "$resolvfile" ] && xappend "--resolv-file=$resolvfile"
> +   config_get resolvfile "$cfg" resolvfile "/tmp/resolv.conf.auto"
> +   xappend "--resolv-file=$resolvfile"
> +   # So jail doesn't complain if file missing
> +   [ \! -e "$resolvfile" ] && touch "$resolvfile"
>
> config_get hostsfile "$cfg" dhcphostsfile
> [ -e "$hostsfile" ] && xappend "--dhcp-hostsfile=$hostsfile"
> @@ -959,16 +970,6 @@ dnsmasq_start()
> echo >> $CONFIGFILE_TMP
> mv -f $CONFIGFILE_TMP $CONFIGFILE
>
> -   [ "$resolvfile" = "/tmp/resolv.conf.auto" ] && {
> -   rm -f /tmp/resolv.conf
> -   [ $ADD_LOCAL_DOMAIN -eq 1 ] && [ -n "$DOMAIN" ] && {
> -   echo "search $DOMAIN" >> /tmp/resolv.conf
> -   }
> -   DNS_SERVERS="$DNS_SERVERS 127.0.0.1"
> -   for DNS_SERVER in $DNS_SERVERS ; do
> -   echo "nameserver $DNS_SERVER" >> /tmp/resolv.conf
> -   done
> -   }
>
> procd_open_instance $cfg
> procd_set_param command $PROG -C $CONFIGFILE -k -x 
> /var/run/dnsmasq/dnsmasq."${cfg}".pid
> @@ -986,20 +987,29 @@ dnsmasq_start()
> procd_add_jail_mount_rw /var/run/dnsmasq/ $leasefile
>
> procd_close_instance
> +
> +
> +   # write /tmp/resolve.conf only for main instance
> +   dnsmasq_ismain $cfg && {
> +   rm -f /tmp/resolv.conf
> +   [ $ADD_LOCAL_DOMAIN -eq 1 ] && [ -n "$DOMAIN" ] && {
> +   echo "search $DOMAIN" >> /tmp/resolv.conf
> +   }
> +   DNS_SERVERS="$DNS_SERVERS 127.0.0.1"
> +   for DNS_SERVER in $DNS_SERVERS ; do
> +   echo "nameserver $DNS_SERVER" >> /tmp/resolv.conf
> +   done
> +   }
>  }
>
>  dnsmasq_stop()
>  {
> local cfg="$1"
>
> -   config_get resolvfile "$cfg" "resolvfile"
> -
> #relink /tmp/resolve.conf only for main instance
> -   [ "$resolvfile" = "/tmp/resolv.conf.auto" ] && {
> -   

Re: [LEDE-DEV] /lib/functions/network.sh & ip6ifaceid

2017-06-08 Thread Eric Masson

Le 08/06/2017 à 13:57, Hans Dedecker a écrit :

Hi Hans,


Meanwhile the issue has been fixed by jow on trunk
(https://git.lede-project.org/?p=source.git;a=commit;h=7f91cabd0d5b6e1a716d9e3fab4103730d9d2888)
and lede-17.0.1 branch
(https://git.lede-project.org/?p=source.git;a=commit;h=df4363b607629710240dcaccf4e3f0bc6fae93ae)


Great, it seems to me that network_get_ipaddrs_all() still has the problem :


# determine all IP addresses of given logical interface
# 1: destination variable
# 2: interface
network_get_ipaddrs_all() {
local __addr
local __list=""

if __network_ifstatus "__addr" "$2" 
"['ipv4-address','ipv6-address','ipv6-prefix-assignment'][*].address"; then
for __addr in $__addr; do
case "$__addr" in
*:) __list="${__list:+$__list }${__addr}1" ;; 
Hardcoded value 1
*)  __list="${__list:+$__list }${__addr}"  ;;
esac
done

export "$1=$__list"
return 0
fi

unset "$1"
return 1
}


Regards

Éric Masson


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] github oauth for webpage editing requests too many permission

2017-06-08 Thread Thomas Endt
> Von: Lede-dev [mailto:lede-dev-boun...@lists.infradead.org] Im Auftrag
> von Alberto Bursi
> Gesendet: Mittwoch, 7. Juni 2017 20:11
> 
> On 06/07/2017 05:45 PM, Martin Tippmann wrote:
> > On Wed, Jun 7, 2017 at 5:00 PM, Karl Palsson 
> wrote:
> >> Hi,
> >>
> >> I was trying to fix something on the documentation pages of
> >> lede-project today, and tried to login with github.
> >>
> >> However, the docuwiki/oauth thing is demanding full read/write
> access
> >> to my account, which seems excessive...
> > Hi, we already noticed this:
> > http://lists.infradead.org/pipermail/lede-dev/2016-
> October/003099.html
> >
> > https://github.com/cosmocode/dokuwiki-plugin-oauth/issues/41
> >
> > Looks like the original plugin is still not updated.
> >
> 
> Seems like the fix is pretty trivial though (change a line in a php
> file), see this commit from a fork:
> https://github.com/micgro42/dokuwiki-plugin-
> oauth/commit/39b9184bb4c606c3d0fc43d8e565368bcaab2f92
> 
> Anyone with root access to the server can easily do that on our side.
> 
> I can do that if we agree it's OK to do so.
> 
> -Alberto


Seems there is finally some movement after I nudged a bit: Pull request has
been opened.
https://github.com/cosmocode/dokuwiki-plugin-oauth/issues/41

However, the real implementation date is still unknown, and since the
solution is so easy, I'd say: Go ahead, apply that change to the LEDE wiki.


Thomas




___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] /lib/functions/network.sh & ip6ifaceid

2017-06-08 Thread Hans Dedecker
On Thu, Jun 8, 2017 at 10:01 AM, Eric Masson  wrote:
> Le 07/06/2017 à 21:59, Hans Dedecker a écrit :
>
> Hi Hans,
>
>> This is definitely a bug;
>
>
> Ok, thanks
>
>> can you log an issue in flyspray (https://bugs.lede-project.org/) ?
>
>
> I've tried to register with the mail address used to send messages here,
> with no luck at the moment (no mail received, so no password to access and
> create the issue)
Hi Eric,

Meanwhile the issue has been fixed by jow on trunk
(https://git.lede-project.org/?p=source.git;a=commit;h=7f91cabd0d5b6e1a716d9e3fab4103730d9d2888)
and lede-17.0.1 branch
(https://git.lede-project.org/?p=source.git;a=commit;h=df4363b607629710240dcaccf4e3f0bc6fae93ae)

Hans
>
>
> Regards
>
> Éric Masson
>
>
> ___
> Lede-dev mailing list
> Lede-dev@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev

___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] /lib/functions/network.sh & ip6ifaceid

2017-06-08 Thread Eric Masson

Le 07/06/2017 à 21:59, Hans Dedecker a écrit :

Hi Hans,


This is definitely a bug;


Ok, thanks


can you log an issue in flyspray (https://bugs.lede-project.org/) ?


I've tried to register with the mail address used to send messages here, 
with no luck at the moment (no mail received, so no password to access 
and create the issue)


Regards

Éric Masson


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev