firewall: fix potential NULL pointer access

Properly skip struct ifaddr entries with NULL ifa_addr, thanks Kostas Papadopoulos for reporting.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@42138 3c298f89-4303-0410-b956-a3cf2f4a3e73
base-files: /lib/functions/network.sh: fix network_get_ipaddr6

When looking for the first ipaddr also consider the current prefix just
like network_get_ipaddrs6 does. If ipv6-address was empty the function
did not return the first ipaddr even if the list was non-empty.

fixes commit 83e9122f88a002871d5cdf421cf6aa6052b7e006

Signed-off-by: Henning Schild <henning@hennsch.de>

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@42139 3c298f89-4303-0410-b956-a3cf2f4a3e73
mac80211: fix warning with kernel 3.14

This fixes a redefinition of net_get_random_once() warning.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>


git-svn-id: svn://svn.openwrt.org/openwrt/trunk@42141 3c298f89-4303-0410-b956-a3cf2f4a3e73
bcm53xx: remove BCM4360 from PCI ids

bcma does not support this card and b43 hangs when probing this card.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>


git-svn-id: svn://svn.openwrt.org/openwrt/trunk@42142 3c298f89-4303-0410-b956-a3cf2f4a3e73
bcm53xx: add b43 wifi support

Now it is possible to use b43 wifi.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>


git-svn-id: svn://svn.openwrt.org/openwrt/trunk@42143 3c298f89-4303-0410-b956-a3cf2f4a3e73
imx6: kernel: backport an upstream pci hang fix

Signed-off-by: Tim Harvey <tharvey@gateworks.com>

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@42144 3c298f89-4303-0410-b956-a3cf2f4a3e73
imx6: kernel: fix occasional link failure

Signed-off-by: Tim Harvey <tharvey@gateworks.com>

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@42145 3c298f89-4303-0410-b956-a3cf2f4a3e73
imx6: kernel: add GW16082 miniPCI Expansion Mezzanine support

The GW16082 miniPCI Expansion Mezzanine has the INTA/B/C/D IRQ's reversed
from the PCI standard. This will soon be resolved in the bootloader via
devicetree, but in the meantime this will work around the issue.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@42146 3c298f89-4303-0410-b956-a3cf2f4a3e73
imx6: kernel: add GW16083 Ethernet Expansion Mezzanine support

The GW16083 Ethernet Expansion Mezzanine adds the following to supported
Gateworks baseboards:
 * 7-port Ethernet Switch
  * 4x RJ45 ports (ENET1-4) supporing 802.11af/at PoE (with optional PoE module)
  * 2x RJ45 ports or SFP module (ENET5-6) (auto-selected)

This series adds support for a phy driver that adds support for ENET5/ENET6
PHY adding initialization for those PHY's and a polling mechanism that detects
SFP insertion and configuration.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@42147 3c298f89-4303-0410-b956-a3cf2f4a3e73
imx6: kernel: add GW5520 support

The GW5520 is a small form-factor single-board computer with the following
features:
 * 70x100mm form-factor
 * IMX6DL 800MHz SoC (IMX6Q optional)
 * 512MB 32bit DDR3 SDRAM (up to 2GB optional)
 * 256MB NAND FLASH (up to 2GB optional)
 * Gateworks System Controller
 * 2x front-panel Intel i210 GbE adapters with passive PoE support
 * 2x MiniPCIe sockets with USB support
 * 2x front-panel USB
 * 1x rear-panel full-size HDMI connector
 * 1x front-panel bi-color user LED
 * 1x front-panel user pushbutton
 * 1x rear-panel barrel jack for power
 * 1x Application connector with:
  * 2x TTL level UARTs
  * 10x TTL level Digital IO

Signed-off-by: Tim Harvey <tharvey@gateworks.com>

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@42148 3c298f89-4303-0410-b956-a3cf2f4a3e73
imx6: update kernel config

Signed-off-by: Luka Perkov <luka@openwrt.org>

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@42149 3c298f89-4303-0410-b956-a3cf2f4a3e73
package: fix segfault of iwinfo.scanlist("radio0").

This is a bug revealed in r41830.

First, the static variable `char nif[IFNAMSIZ]` of nl80211_phy2ifname()
would be zeroed out if the argument is "wlan0" or the like.  This will
happen in the following call stack.

 nl80211_get_scanlist("radio0", buf, len);
   nl80211_phy2ifname("radio0")			// return static var nif with content "wlan0"
   nl80211_get_scanlist(nif, buf, len);		// tail call
     nl80211_get_mode(nif);
        nl80211_phy2ifname(nif);		// zero out nif

Later we try nl80211_ifadd("") which was supposed to create interface
"tmp.", but that won't happen because nl80211_msg() will put an invalid
ifidx 0 to the nlmsg.

Then iwinfo_ifup() and iwinfo_ifdown() would fail and happily
nl80211_get_scanlist() returned 0 and left *len undefined.

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@42151 3c298f89-4303-0410-b956-a3cf2f4a3e73
odhcpd: multiple DHCPv4 improvements (thx Christian Mehlis)

Signed-off-by: Steven Barth <steven@midlink.org>

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@42153 3c298f89-4303-0410-b956-a3cf2f4a3e73
ppp: enable IPv6CP by default

Signed-off-by: Steven Barth <steven@midlink.org>

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@42158 3c298f89-4303-0410-b956-a3cf2f4a3e73
odhcpd: improve DHCPv6-PD detection

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@42160 3c298f89-4303-0410-b956-a3cf2f4a3e73
netifd: assign ipv6-prefixes with length <64 with /64 on-link routes

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@42161 3c298f89-4303-0410-b956-a3cf2f4a3e73
dropbear: fix keepalive with putty

Don't send SSH_MSG_UNIMPLEMENTED for keepalive responses, which broke
at least putty.

Fixes #17522 / #17523.

Signed-off-by: Jonas Gorski <jogo@openwrt.org>

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@42162 3c298f89-4303-0410-b956-a3cf2f4a3e73
brcm47xx: fix brcm47xx.legacy build

we should check for ssb here.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>


git-svn-id: svn://svn.openwrt.org/openwrt/trunk@42164 3c298f89-4303-0410-b956-a3cf2f4a3e73
brcm47xx: image: update list of Netgear WNR* firmwares

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>


git-svn-id: svn://svn.openwrt.org/openwrt/trunk@42165 3c298f89-4303-0410-b956-a3cf2f4a3e73
ar7: remove 972-cpmac_fixup patch

This patch is causing more harm than good on most AR7 routers out there,
better have no manageable switch rather than no ethernet connection, at
least for now.

Fixes #16523, #5927

Signed-off-by: Florian Fainelli <florian@openwrt.org>

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@42168 3c298f89-4303-0410-b956-a3cf2f4a3e73