Re: [OpenWrt-Devel] uclient-fetch & SSL WAS:Re: DD: CONFIG_BUSYBOX_DEFAULT_WGET is not set
* Martin Tippmann [24.01.2016 09:10]: > Sorry if I was not clear - I meant uclient-fetch not wget. me too, i showed the link /bin/wget which *is* uclient-fetch > # opkg list | grep uclient > libuclient - 2016-01-21-b9808a8c3a8922ed8df4e6fe45848ac2e52f13be > uclient-fetch - 2016-01-21-b9808a8c3a8922ed8df4e6fe45848ac2e52f13be the same here. i'am running olsrd-git and there where a lot of fixes regarding the HTTP interface. i will try to downgrade and reproduce the issue. bye, bastian ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] DD: CONFIG_BUSYBOX_DEFAULT_WGET is not set
I'm currently looking on ddns-scripts and still got certificate problems I'm on r48470 including ca-certificates package installed root@OpenWrt:~# uclient-fetch -O- 'https://myuser:myp...@update.spdns.de/nic/update?hostname=myhost.example.com&ip=8.8.8.8' Downloading 'https://myuser:myp...@update.spdns.de/nic/update?hostname=myhost.example.com&ip=8.8.8.8' Connecting to 62.201.160.30:443 Connection error: Server hostname does not match SSL certificate GNU wget works as expected root@OpenWrt:~# wget -O- 'https://myuser:myp...@update.spdns.de/nic/update?hostname=myhost.example.com&ip=8.8.8.8' --2016-01-24 13:01:39-- https://myuser:myp...@update.spdns.de/nic/update?hostname=myhost.example.com&ip=8.8.8.8 Resolving update.spdns.de... 62.201.160.30, 2001:868:100:901:53::2 Connecting to update.spdns.de|62.201.160.30|:443... connected. HTTP request sent, awaiting response... 401 Unauthorized Authentication selected: Basic realm="spdns nic update" Reusing existing connection to update.spdns.de:443. HTTP request sent, awaiting response... 200 OK Length: unspecified [text/html] Saving to: 'STDOUT' - [<=>] 0 --.-KB/s invalidip - [ <=>] 10 --.-KB/s in 0s 2016-01-24 13:01:39 (1.20 MB/s) - written to stdout [10] What did I wrong ? Thanks Christian ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] Discussion: Replace BUSYBOX NSLOOKUP by hostip package
Citeren Christian Schoenebeck : For some (good) reason you decided to remove wget from BusyBox and replace it by uclient-fetch. Why not also remove nslookup from BusyBox. - If compiled with musl it malfunction with given dns-server Correct. It will completely ignore the [SERVER] argument from nslookup [HOST] [SERVER] (see [1] & [2]). Either nslookup.c from BusyBox should be changed to allow overriding the list of nameservers from /etc/resolv.conf (which are the only ones used with the musl library) or patched to allow this argument only when compiled against a library that actually supports this. I have little hope that musl can be convinced to make such functionality available. Note that in many cases one can workaround this issue by creating a new /etc/resolv.conf with the nameserver(s) to use. By default dnsmasq will not use this file, so this will only influence resolving locally (not on clients connected). - use hostip package instead. Tiny and functional It's not as big as bind-host, but I wouldn't call it tiny either (on ar71xx at least). The hostip package (~30k) requires libsodium (~120k), which is much higher than the additional size of nslookup in BusyBox (which is essentially just a bunch of calls to stuff which is already in the libc). Adding the functionality in BusyBox nslookup will increase the size of BusyBox somewhat, but not nearly by that much. If needed, I can write this. What do you think? I think adding this functionality to BusyBox will be far cheaper in terms of size used. Since for many people the [SERVER] argument is not going to be used anyway, so switching to hostip by default seems overkill. For the time being, people that need this functionality should either use a modified /etc/resolv.conf (if possible) or use bind-host instead. Regards, Arjen [1] https://dev.openwrt.org/ticket/18333 [2] https://dev.openwrt.org/ticket/20893 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] DD: CONFIG_BUSYBOX_DEFAULT_WGET is not set
Did you see my patch? [OpenWrt-Devel] [PATCH] base-files: fix sysupgrade 'wget' handling for uclient-fetch The key is that uclient-fetch needs to be copied to ramfs during a sysupgrade: install_bin /bin/uclient-fetch /bin/wget Notice that change r48451 only moves the symbolic link to busybox from /usr/bin/wget -> bustbox to /bin/wget -> busybox Here is ramfs after r48451 you submitted: @OpenWrt:/bin# ll drwxr-xr-x2 00 520 Jan 23 01:20 . drwxr-xr-x 13 00 260 Jan 23 01:20 .. lrwxrwxrwx1 00 12 Jan 23 01:20 ash -> /bin/busybox -rwxr-xr-x1 00 300327 Jan 23 01:20 busybox lrwxrwxrwx1 00 12 Jan 23 01:20 cat -> /bin/busybox lrwxrwxrwx1 00 12 Jan 23 01:20 chmod -> /bin/busybox lrwxrwxrwx1 00 12 Jan 23 01:20 cp -> /bin/busybox lrwxrwxrwx1 00 12 Jan 23 01:20 cut -> /bin/busybox lrwxrwxrwx1 00 12 Jan 23 01:20 dd -> /bin/busybox lrwxrwxrwx1 00 12 Jan 23 01:20 grep -> /bin/busybox lrwxrwxrwx1 00 12 Jan 23 01:20 kill -> /bin/busybox lrwxrwxrwx1 00 12 Jan 23 01:20 ls -> /bin/busybox lrwxrwxrwx1 00 12 Jan 23 01:20 mkdir -> /bin/busybox lrwxrwxrwx1 00 12 Jan 23 01:20 mount -> /bin/busybox lrwxrwxrwx1 00 12 Jan 23 01:20 mv -> /bin/busybox lrwxrwxrwx1 00 12 Jan 23 01:20 rm -> /bin/busybox lrwxrwxrwx1 00 12 Jan 23 01:20 rmdir -> /bin/busybox lrwxrwxrwx1 00 12 Jan 23 01:20 sh -> /bin/busybox lrwxrwxrwx1 00 12 Jan 23 01:20 sleep -> /bin/busybox lrwxrwxrwx1 00 12 Jan 23 01:20 sync -> /bin/busybox lrwxrwxrwx1 00 12 Jan 23 01:20 tar -> /bin/busybox *lrwxrwxrwx1 00 12 Jan 23 01:20 uclient-fetch -> /bin/busybox *lrwxrwxrwx1 00 12 Jan 23 01:20 umount -> /bin/busybox lrwxrwxrwx1 00 12 Jan 23 01:20 vi -> /bin/busybox lrwxrwxrwx1 00 12 Jan 23 01:20 wget -> /bin/busybox lrwxrwxrwx1 00 12 Jan 23 01:20 zcat -> /bin/busybox Here is ramfs after the patch I submitted yesterday: @OpenWrt:(unreachable)/lib/upgrade# ll /bin/ drwxr-xr-x2 00 520 Jan 24 12:13 . drwxr-xr-x 13 00 260 Jan 24 12:13 .. lrwxrwxrwx1 00 12 Jan 24 12:13 ash -> /bin/busybox -rwxr-xr-x1 00 300327 Jan 24 12:13 busybox lrwxrwxrwx1 00 12 Jan 24 12:13 cat -> /bin/busybox lrwxrwxrwx1 00 12 Jan 24 12:13 chmod -> /bin/busybox lrwxrwxrwx1 00 12 Jan 24 12:13 cp -> /bin/busybox lrwxrwxrwx1 00 12 Jan 24 12:13 cut -> /bin/busybox lrwxrwxrwx1 00 12 Jan 24 12:13 dd -> /bin/busybox lrwxrwxrwx1 00 12 Jan 24 12:13 grep -> /bin/busybox lrwxrwxrwx1 00 12 Jan 24 12:13 kill -> /bin/busybox lrwxrwxrwx1 00 12 Jan 24 12:13 ls -> /bin/busybox lrwxrwxrwx1 00 12 Jan 24 12:13 mkdir -> /bin/busybox lrwxrwxrwx1 00 12 Jan 24 12:13 mount -> /bin/busybox lrwxrwxrwx1 00 12 Jan 24 12:13 mv -> /bin/busybox lrwxrwxrwx1 00 12 Jan 24 12:13 rm -> /bin/busybox lrwxrwxrwx1 00 12 Jan 24 12:13 rmdir -> /bin/busybox lrwxrwxrwx1 00 12 Jan 24 12:13 sh -> /bin/busybox lrwxrwxrwx1 00 12 Jan 24 12:13 sleep -> /bin/busybox lrwxrwxrwx1 00 12 Jan 24 12:13 sync -> /bin/busybox lrwxrwxrwx1 00 12 Jan 24 12:13 tar -> /bin/busybox *-rwxr-xr-x1 0012343 Jan 24 12:13 uclient-fetch*lrwxrwxrwx 1 00 12 Jan 24 12:13 umount -> /bin/busybox lrwxrwxrwx1 00 12 Jan 24 12:13 vi -> /bin/busybox *lrwxrwxrwx1 00 18 Jan 24 12:13 wget -> /bin/uclient-fetch*lrwxrwxrwx1 00 12 Jan 24 12:13 zcat -> /bin/busybox On Fri, Jan 22, 2016 at 3:27 AM, Bastian Bittorf wrote: > * John Clark [22.01.2016 07:55]: > > Is it intentional that wget is not available by default in the > > i just send a patch. thanks for spotting this. > > bye, bastian > ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [CC 15.05] bind: Security update (4 CVEs)
The bind package has been rebuilt and was uploaded to the Chaos Calmer 15.05 repository due to multiple security issues. VERSION 9.9.7-P3-1 => 9.9.8-P3-1 CHANGELOG [Sun, 24 Jan 2016 12:43:29 +0100 41dcf83] Fixes: * CVE-2015-8704 * CVE-2015-3193 * CVE-2015-8000 * CVE-2015-8461 CHANGES net/bind/Makefile |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) REFERENCES * http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-3193 * http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-8000 * http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-8461 * http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-8704 * https://github.com/openwrt/packages/commit/41dcf83e53718bdb74aa9529f5713f4ef9703749 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] DD: CONFIG_BUSYBOX_DEFAULT_WGET is not set
Citeren Christian Schoenebeck : I'm currently looking on ddns-scripts and still got certificate problems I'm on r48470 including ca-certificates package installed root@OpenWrt:~# uclient-fetch -O- 'https://myuser:myp...@update.spdns.de/nic/update?hostname=myhost.example.com&ip=8.8.8.8' Downloading 'https://myuser:myp...@update.spdns.de/nic/update?hostname=myhost.example.com&ip=8.8.8.8' Connecting to 62.201.160.30:443 Connection error: Server hostname does not match SSL certificate The certificate is valid, but update.spdns.de uses a wildcard certificate (which technically is OK). subject=/serialNumber=YnFcKoUlVu1DhcIaoJxVwNDp/tTAKrDm/OU=GT17804807/OU=See www.rapidssl.com/resources/cps (c)14/OU=Domain Control Validated - RapidSSL(R)/CN=*.spdns.de issuer=/C=US/O=GeoTrust, Inc./CN=RapidSSL CA But you won't get an exact match on the hostname, so this is something that probably requires fixing. GNU wget works as expected root@OpenWrt:~# wget -O- 'https://myuser:myp...@update.spdns.de/nic/update?hostname=myhost.example.com&ip=8.8.8.8' --2016-01-24 13:01:39-- https://myuser:myp...@update.spdns.de/nic/update?hostname=myhost.example.com&ip=8.8.8.8 Resolving update.spdns.de... 62.201.160.30, 2001:868:100:901:53::2 Connecting to update.spdns.de|62.201.160.30|:443... connected. HTTP request sent, awaiting response... 401 Unauthorized Authentication selected: Basic realm="spdns nic update" Reusing existing connection to update.spdns.de:443. HTTP request sent, awaiting response... 200 OK Length: unspecified [text/html] Saving to: 'STDOUT' - [<=>] 0 --.-KB/s invalidip - [ <=>] 10 --.-KB/sin 0s 2016-01-24 13:01:39 (1.20 MB/s) - written to stdout [10] What did I wrong ? Thanks Christian ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH 1/2] swconfig: implement (PHY) generic PORT_LINK setter
Hi, On 21 January 2016 at 14:55, Rafał Miłecki wrote: > It's quite common for switches to have PHY per port so we may use a > generic function for setting port link. We just need an API to access > PHYs which this patch also adds. > > Signed-off-by: Rafał Miłecki > --- > .../linux/generic/files/drivers/net/phy/swconfig.c | 44 > -- > target/linux/generic/files/include/linux/switch.h | 3 ++ > 2 files changed, 44 insertions(+), 3 deletions(-) > > diff --git a/target/linux/generic/files/drivers/net/phy/swconfig.c > b/target/linux/generic/files/drivers/net/phy/swconfig.c > index 9a5f1e9..8b9bb51 100644 > --- a/target/linux/generic/files/drivers/net/phy/swconfig.c > +++ b/target/linux/generic/files/drivers/net/phy/swconfig.c > @@ -25,6 +25,7 @@ > #include > #include > #include > +#include > > #define SWCONFIG_DEVNAME "switch%d" > > @@ -131,10 +132,47 @@ static int > swconfig_set_link(struct switch_dev *dev, const struct switch_attr *attr, > struct switch_val *val) > { > - if (!dev->ops->set_port_link) > - return -EOPNOTSUPP; > + struct switch_port_link *link = val->value.link; > + int port = val->port_vlan; > + > + if (port == dev->cpu_port) > + return -EINVAL; The cpu port might not be the only port that may not be modified; sometimes there is more than one fixed connection, sometimes the phy ports aren't contiguous. I think it would make more sense to add a function for switch drivers to call than to do it directly in the callback, so they can do something like int b53_set_link(...) { /* TODO: BCM63XX requires special handling as it can have external phys, and ports might be GE or only FE */ if (is63xx(dev)) return -EINVAL; if (port == dev->CPU_PORT) return -EINVAL; if (!(BIT(port) & dev->enabled_ports)) return -EINVAL; if (link->speed == SWITCH_PORT_SPEED_1000 && (is5325() || is5365()) return -EINVAL; if (link->speed == SWITCH_PORT_SPEED_1000 && !link->duplex) return -EINVAL; return switch_generic_set_link(...); } > + > + /* Custom implementation */ > + if (dev->ops->set_port_link) > + return dev->ops->set_port_link(dev, port, link); > + And the following being the generic function to call: > + /* Chceck if we can use generic implementation */ *Check > + if (!dev->ops->phy_write16) > + return -ENOTSUPP; > + this-^ one maybe with a WARN_ON() to spot misusage. > + /* Generic implementation */ > + if (link->aneg) { > + dev->ops->phy_write16(dev, port, MII_BMCR, 0x); > + dev->ops->phy_write16(dev, port, MII_BMCR, BMCR_ANENABLE | > BMCR_ANRESTART); > + } else { > + u16 bmcr = 0; > > - return dev->ops->set_port_link(dev, val->port_vlan, val->value.link); > + if (link->duplex) > + bmcr |= BMCR_FULLDPLX; > + > + switch (link->speed) { > + case SWITCH_PORT_SPEED_10: > + break; > + case SWITCH_PORT_SPEED_100: > + bmcr |= BMCR_SPEED100; > + break; > + case SWITCH_PORT_SPEED_1000: > + bmcr |= BMCR_SPEED1000; > + break; > + default: > + return -ENOTSUPP; > + } > + > + dev->ops->phy_write16(dev, port, MII_BMCR, bmcr); > + } > + > + return 0; > } > > static int > diff --git a/target/linux/generic/files/include/linux/switch.h > b/target/linux/generic/files/include/linux/switch.h > index 4ada0e5..ab587ea 100644 > --- a/target/linux/generic/files/include/linux/switch.h > +++ b/target/linux/generic/files/include/linux/switch.h > @@ -99,6 +99,9 @@ struct switch_dev_ops { > struct switch_port_link *link); > int (*get_port_stats)(struct switch_dev *dev, int port, > struct switch_port_stats *stats); > + > + int (*phy_read16)(struct switch_dev *dev, int addr, u8 reg, u16 > *value); > + int (*phy_write16)(struct switch_dev *dev, int addr, u8 reg, u16 > value); > }; > > struct switch_dev { > -- > 1.8.4.5 Jonas ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] Discussion: Replace BUSYBOX NSLOOKUP by hostip package
I prepared ddns-scripts to use hostip if installed. I already published but closed the pull because of uclient-fetch to be implemented. Christian ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] DD: CONFIG_BUSYBOX_DEFAULT_WGET is not set
Additional question: If I understand right uclient-fetch only support to give an explicit certificate via command line switch --ca-certificate=:Load CA certificates from file so no path allowed !? Thanks Christian Am 24.01.2016 um 13:38 schrieb Arjen de Korte: > Citeren Christian Schoenebeck : > >> I'm currently looking on ddns-scripts and still got certificate problems >> I'm on r48470 including ca-certificates package installed >> >> root@OpenWrt:~# uclient-fetch -O- >> 'https://myuser:myp...@update.spdns.de/nic/update?hostname=myhost.example.com&ip=8.8.8.8' >> Downloading >> 'https://myuser:myp...@update.spdns.de/nic/update?hostname=myhost.example.com&ip=8.8.8.8' >> Connecting to 62.201.160.30:443 >> Connection error: Server hostname does not match SSL certificate > > The certificate is valid, but update.spdns.de uses a wildcard certificate > (which technically is OK). > > subject=/serialNumber=YnFcKoUlVu1DhcIaoJxVwNDp/tTAKrDm/OU=GT17804807/OU=See > www.rapidssl.com/resources/cps (c)14/OU=Domain Control Validated - > RapidSSL(R)/CN=*.spdns.de > issuer=/C=US/O=GeoTrust, Inc./CN=RapidSSL CA > > But you won't get an exact match on the hostname, so this is something that > probably requires fixing. > >> GNU wget works as expected >> root@OpenWrt:~# wget -O- >> 'https://myuser:myp...@update.spdns.de/nic/update?hostname=myhost.example.com&ip=8.8.8.8' >> --2016-01-24 13:01:39-- >> https://myuser:myp...@update.spdns.de/nic/update?hostname=myhost.example.com&ip=8.8.8.8 >> Resolving update.spdns.de... 62.201.160.30, 2001:868:100:901:53::2 >> Connecting to update.spdns.de|62.201.160.30|:443... connected. >> HTTP request sent, awaiting response... 401 Unauthorized >> Authentication selected: Basic realm="spdns nic update" >> Reusing existing connection to update.spdns.de:443. >> HTTP request sent, awaiting response... 200 OK >> Length: unspecified [text/html] >> Saving to: 'STDOUT' >> - [<=>] 0 >> --.-KB/s invalidip >> - [ <=>] 10 >> --.-KB/sin 0s >> 2016-01-24 13:01:39 (1.20 MB/s) - written to stdout [10] >> >> What did I wrong ? >> Thanks >> Christian >> ___ >> openwrt-devel mailing list >> openwrt-devel@lists.openwrt.org >> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel > ___ > openwrt-devel mailing list > openwrt-devel@lists.openwrt.org > https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel > ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] DD: CONFIG_BUSYBOX_DEFAULT_WGET is not set
On 2016-01-24 14:47, Christian Schoenebeck wrote: > Additional question: > If I understand right uclient-fetch only support to give an explicit > certificate via command line switch > --ca-certificate=:Load CA certificates from file > > so no path allowed !? Right now it defaults to loading all certificates from the default path /etc/ssl/certs. This option is for validating against a specific certificate instead. - Felix ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] DD: CONFIG_BUSYBOX_DEFAULT_WGET is not set
On 2016-01-24 13:06, Christian Schoenebeck wrote: > I'm currently looking on ddns-scripts and still got certificate problems > I'm on r48470 including ca-certificates package installed > > root@OpenWrt:~# uclient-fetch -O- > 'https://myuser:myp...@update.spdns.de/nic/update?hostname=myhost.example.com&ip=8.8.8.8' > Downloading > 'https://myuser:myp...@update.spdns.de/nic/update?hostname=myhost.example.com&ip=8.8.8.8' > Connecting to 62.201.160.30:443 > Connection error: Server hostname does not match SSL certificate > > GNU wget works as expected > root@OpenWrt:~# wget -O- > 'https://myuser:myp...@update.spdns.de/nic/update?hostname=myhost.example.com&ip=8.8.8.8' > --2016-01-24 13:01:39-- > https://myuser:myp...@update.spdns.de/nic/update?hostname=myhost.example.com&ip=8.8.8.8 > Resolving update.spdns.de... 62.201.160.30, 2001:868:100:901:53::2 > Connecting to update.spdns.de|62.201.160.30|:443... connected. > HTTP request sent, awaiting response... 401 Unauthorized > Authentication selected: Basic realm="spdns nic update" > Reusing existing connection to update.spdns.de:443. > HTTP request sent, awaiting response... 200 OK > Length: unspecified [text/html] > Saving to: 'STDOUT' > - [<=>] 0 > --.-KB/s invalidip > - [ <=>] 10 > --.-KB/sin 0s > 2016-01-24 13:01:39 (1.20 MB/s) - written to stdout [10] > > What did I wrong ? It's probably a bug. I will look into this. - Felix ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] vlandev: Add support for setting a unique MAC on a VLAN interface
There are cases where you need a different MAC on a VLAN interface, i.e. if if have move than one connection to a switch. A later change of the MAC is not possible on VLAN interfaces, so it has to be done on creation. The new macaddr option allows to set a unique MAC for a VLAN interface. Example: config device 'testvl' option type '8021ad' option name 'testvl' option ifname 'eth0' option vid '106' option macaddr 'f2:48:00:89:45:4c' config interface 'testif' option ifname 'testvl' option proto 'none' option auto '1' Signed-off-by: André Valentin --- system-linux.c | 2 ++ system.h | 7 +++ vlandev.c | 17 + 3 files changed, 26 insertions(+) diff --git a/system-linux.c b/system-linux.c index 909ba0f..ac657c2 100644 --- a/system-linux.c +++ b/system-linux.c @@ -1014,6 +1014,8 @@ int system_vlandev_add(struct device *vlandev, struct device *dev, struct vlande return -1; nlmsg_append(msg, &iim, sizeof(iim), 0); + if (cfg->flags & VLANDEV_OPT_MACADDR) + nla_put(msg, IFLA_ADDRESS, sizeof(cfg->macaddr), cfg->macaddr); nla_put_string(msg, IFLA_IFNAME, vlandev->ifname); nla_put_u32(msg, IFLA_LINK, dev->ifindex); diff --git a/system.h b/system.h index 97fbc8b..a053072 100644 --- a/system.h +++ b/system.h @@ -77,9 +77,16 @@ enum vlan_proto { VLAN_PROTO_8021AD = 0x88A8 }; +enum vlandev_opt { + VLANDEV_OPT_MACADDR = (1 << 0), +}; + struct vlandev_config { enum vlan_proto proto; uint16_t vid; + + enum vlandev_opt flags; + unsigned char macaddr[6]; }; static inline int system_get_addr_family(unsigned int flags) diff --git a/vlandev.c b/vlandev.c index b93527c..7f1eda7 100644 --- a/vlandev.c +++ b/vlandev.c @@ -13,15 +13,22 @@ */ #include +#include + +#ifdef linux +#include +#endif #include "netifd.h" #include "device.h" #include "interface.h" #include "system.h" + enum { VLANDEV_ATTR_TYPE, VLANDEV_ATTR_IFNAME, + VLANDEV_ATTR_MACADDR, VLANDEV_ATTR_VID, __VLANDEV_ATTR_MAX }; @@ -29,6 +36,7 @@ enum { static const struct blobmsg_policy vlandev_attrs[__VLANDEV_ATTR_MAX] = { [VLANDEV_ATTR_TYPE] = { "type", BLOBMSG_TYPE_STRING }, [VLANDEV_ATTR_IFNAME] = { "ifname", BLOBMSG_TYPE_STRING }, + [VLANDEV_ATTR_MACADDR] = { "macaddr", BLOBMSG_TYPE_STRING }, [VLANDEV_ATTR_VID] = { "vid", BLOBMSG_TYPE_INT32 }, }; @@ -157,6 +165,7 @@ vlandev_apply_settings(struct vlandev_device *mvdev, struct blob_attr **tb) { struct vlandev_config *cfg = &mvdev->config; struct blob_attr *cur; + struct ether_addr *ea; cfg->proto = VLAN_PROTO_8021Q; cfg->vid = 1; @@ -169,6 +178,14 @@ vlandev_apply_settings(struct vlandev_device *mvdev, struct blob_attr **tb) if ((cur = tb[VLANDEV_ATTR_VID])) cfg->vid = (uint16_t) blobmsg_get_u32(cur); + + if ((cur = tb[VLANDEV_ATTR_MACADDR])) { + ea = ether_aton(blobmsg_data(cur)); + if (ea) { + memcpy(cfg->macaddr, ea, 6); + cfg->flags |= VLANDEV_OPT_MACADDR; + } + } } static enum dev_change_type -- 2.1.4 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] vlandev: Add support for setting a unique MAC on a VLAN interface
Am 24.01.2016 um 20:47 schrieb André Valentin: > There are cases where you need a different MAC on a VLAN interface, i.e. if > if have move than one connection to a switch. A later change of the MAC > is not possible on VLAN interfaces, so it has to be done on creation. > The new macaddr option allows to set a unique MAC for a VLAN interface. > Example: > config device 'testvl' > option type '8021ad' > option name 'testvl' > option ifname 'eth0' > option vid '106' > option macaddr 'f2:48:00:89:45:4c' > > config interface 'testif' > option ifname 'testvl' > option proto 'none' > option auto '1' Wiki now inlcudes vlandev and the new macaddr option. https://wiki.openwrt.org/doc/uci/network#devices Kind regards, André ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] vlandev: Add support for setting a unique MAC on a VLAN interface
Am 24.01.2016 um 21:34 schrieb Gio: > On Sunday 24 January 2016 20:47:26 André Valentin wrote: >> There are cases where you need a different MAC on a VLAN interface, i.e. if >> if have move than one connection to a switch. A later change of the MAC >> is not possible on VLAN interfaces, so it has to be done on creation. >> The new macaddr option allows to set a unique MAC for a VLAN interface. > > I am the author of vlandev stuff are you sure that this doesn't break > assumptions made by linux kernel networking stack? > > Some time ago i have done some testing (not enough probably) about changing > mac address on a vlan and the vlan interface stopped receiving packets, I > think that linux kernel was assuming the vlan and the untagged interface have > the same mac address my setup was like this > > > > > My experience was that if eth0 and eth0.10 had differents mac, eth0.10 didn't > receiving packets, this may be caused by eth0 being in a bridge > > To overcome this i tried multiple permutations with macvlan in the middle but > none of them worked :( > > one of the permutation was this > > > > if i remember well i could not create the macvlan0 interface since eth0 was > in > the bridge :( The upper setup was exact that what I not wanted ;-) I know that there are problems if you create a bridge on the untagged VLAN and also on tagged ones depending on the kernel version. Personally I do not use such setup because of its instability. But with the documented setup below I have no problems, it's verified with several ar71xx devices. Kind regards, Andre > > Cheers! > >> Example: >> config device 'testvl' >> option type '8021ad' >> option name 'testvl' >> option ifname 'eth0' >> option vid '106' >> option macaddr 'f2:48:00:89:45:4c' >> >> config interface 'testif' >> option ifname 'testvl' >> option proto 'none' >> option auto '1' >> ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] vlandev: Add support for setting a unique MAC on a VLAN interface
Am 24.01.2016 um 22:00 schrieb Andre Valentin: > Am 24.01.2016 um 21:34 schrieb Gio: >> On Sunday 24 January 2016 20:47:26 André Valentin wrote: >>> There are cases where you need a different MAC on a VLAN interface, i.e. if >>> if have move than one connection to a switch. A later change of the MAC >>> is not possible on VLAN interfaces, so it has to be done on creation. >>> The new macaddr option allows to set a unique MAC for a VLAN interface. >> >> I am the author of vlandev stuff are you sure that this doesn't break >> assumptions made by linux kernel networking stack? >> >> Some time ago i have done some testing (not enough probably) about changing >> mac address on a vlan and the vlan interface stopped receiving packets, I >> think that linux kernel was assuming the vlan and the untagged interface >> have >> the same mac address my setup was like this >> >> >> >> >> My experience was that if eth0 and eth0.10 had differents mac, eth0.10 >> didn't >> receiving packets, this may be caused by eth0 being in a bridge >> >> To overcome this i tried multiple permutations with macvlan in the middle >> but >> none of them worked :( >> >> one of the permutation was this >> >> >> >> if i remember well i could not create the macvlan0 interface since eth0 was >> in >> the bridge :( > The upper setup was exact that what I not wanted ;-) > > I know that there are problems if you create a bridge on the untagged VLAN and > also on tagged ones depending on the kernel version. Personally I do not use > such > setup because of its instability. > But with the documented setup below I have no problems, it's verified with > several > ar71xx devices. By the way, you should always make sure that you use a unicast mac. There are several generators on the web which do not take care if this. It took me some time to remember this fact yesterday.. Kind regards, André ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] kernel: mtdsplit: add missing digest field to Seama header
Seama format has 2 similar headers: container (seal) header and entity header. The first one has size always set to 0 and doesn't contain MD5 digest. When dealing with Seama on a flash we deal directly with an entity. You can see mtdsplit_parse_seama reads from offset 0 and expects entity to be there. Seama container is used by bootloader / interface only which extract entity out of it and flash it. That said we should fix our header struct. This is important as we calculate possible rootfs offset assuming it may be placed right after Seama entity. So far calculate offset was always 16B too low. Signed-off-by: Rafał Miłecki --- target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_seama.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_seama.c b/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_seama.c index 6f21f8f..c762274 100644 --- a/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_seama.c +++ b/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_seama.c @@ -26,6 +26,7 @@ struct seama_header { __be16 reserved; /* reserved for */ __be16 metasize; /* size of the META data */ __be32 size; /* size of the image */ + u8 md5[16];/* digest */ }; static int mtdsplit_parse_seama(struct mtd_info *master, -- 1.8.4.5 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel