2020-03-31 |
net: Add ifdown support and command
...
ifdown is the counterpart to ifup and disables one or all ethernet
interfaces.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 31 Mar 2020
|
net: Open ethernet devices explicitly
...
Open ethernet devices explicitly rather than implicitly when sending
packets. This allows us to not only enable, but in the next step to
also disable ethernet devices.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 31 Mar 2020
|
2018-11-29 |
net: dns: return error codes
...
The resolv() function used to return the IP address. When net_udp_new()
fails we return an error code though which the callers of resolv() take
as an IP address. This is wrong of course and we could return 0 in this
case. Instead we return an error code and pass the resolved IP as a
pointer which allows us to return proper error codes.
This patch also adds error messages and error returns to the various
callers of resolv() which used to just continue with a zero IP and
let the user figure out what went wrong.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 29 Nov 2018
|
2017-12-15 |
net: Add linuxdevname property
...
When you have a static network environment but more than one network
device on your machine it is necessary to provide the <device> parameter
to the ip parameter at kernel cmd line.
The device name assigned by Linux cannot in general be predicted as it
depends on driver bind order.
This patch introduces a new property linux.devname to eth devices.
The value is added to bootargs per interface and can be changed in
env/network/INTF
Based on patch by Gavin Schenk <g.schenk@eckelmann.de>.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 15 Dec 2017
|
2017-12-14 |
net: Provide new way to configure network devices
...
This provides a new way to configure network interfaces based
on nvvars. A network interface can now be configured with variables
in the nv.dev.<ethname>.* namespace. There is a new network device
parameter "mode" which specifies the mode used to obtain IP settings.
The mode can be "dhcp", "static" or "disabled":
nv.dev.eth0.mode=dhcp
(ipaddr, netmask are ignored in this setting)
nv.dev.eth0.mode=static
nv.dev.eth0.ipaddr=192.168.0.17
nv.dev.eth0.netmask=255.255.0.0
nv.dev.eth0.mode=disabled
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 14 Dec 2017
|
net: remove "current" network device
...
Now that we can do routing we no longer need a "current"
network device. Remove it.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 14 Dec 2017
|
net: Pick network device based on IP settings
...
The IP/netmask/gateway settings contain all informations
needed to pick the correct network device. This patch
adds support for that and makes specifying the "current"
network interface using the ethact command unnecessary.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 14 Dec 2017
|
net: dhcp: Allow to specify network device
...
Instead of allowing to DHCP only on the "current" network
device, allow to specify the desired network device. This
is a first step to get rid of the concept of a "current"
network device.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 14 Dec 2017
|
2017-12-01 |
net: allow udp connections on specified network device
...
This allows the DHCP code to configure specific network
devices so that DHCP no longer depends on any "current"
network device.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 1 Dec 2017
|
net: Use a single gateway
...
There is not much point in having a network device specific
gateway. If barebox really is part of such a complicated network
in which it needs multiple gateways, then we probably need a
real routing table. Until this happens, a single gateway should
be enough.
This introduces global.net.gateway which holds the gateway ip. The
previously used device specific <ethx>.gateway variables still exist,
but are only aliases for the single gateway.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 1 Dec 2017
|
net: dhcp: Do not overwrite serverip if it is valid
...
Some DHCP servers provide the wrong serverip in which case
it is desired to specify it manually and won't let the dhcp
command overwrite it.
This has previously been done by setting the serverip again
to the desired value after dhcp has been executed. With this
patch we do not overwrite it in the first place if it is valid
already. This is necessary when the serverip is not set via
/env/network/eth* but via nv.net.server.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 1 Dec 2017
|
net: introduce global.net.server
...
The server to use is independent of the network device, there is
not much point to make the server specific to a network device.
This introduces global.net.server as the serverip which is
used as standard NFS/tftp server. The previously used eth
device specific parameters still exist, but are only aliases
for the global single variable.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 1 Dec 2017
|
net: Add functions to get/set nameserver and domainname
...
It's more convenient to have getter/setter functions for
variables rather than using the detour around global vars
which use string matching and all kinds of overhead in the
background.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 1 Dec 2017
|
net: Add and use IP_BROADCAST
...
Rather than using the hardcoded value 0xffffffff in several places
add a define for the broadcast IP.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 1 Dec 2017
|
2016-09-22 |
net: add linux.bootarg parameter from ifup call
...
This sets a `ip=dhcp` or
`ip=<clientip>:<serverip>:<gatewayip>:<netmaskip>::<iface>:` bootarg for
the network device upon execution of 'ifup'. This is the only point
where we can distinguish between a static ip and a dhcp-based network
setup and thus set a valid bootarg options as it will be required for
nfs boot, for example.
Signed-off-by: Enrico Jorns <ejo@pengutronix.de>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Enrico Jorns
authored
on 19 Sep 2016
Sascha Hauer
committed
on 22 Sep 2016
|
convert users to %pI4
...
Convert users of ip_to_string() and print_IPaddr() to %pI4 and
remove the now unused functions.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 22 Sep 2016
|
2016-07-14 |
net: eth: add name to struct eth_device
...
Using dev_name often is not a good idea since it's a statically
allocated string which gets overwritten by later calls to dev_name.
Add a devname string to struct eth_device to have the name available
for later use.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 14 Jul 2016
|
net: introduce for_each_netdev iterator
...
for_each_netdev is nicer to read. Also export the list of network
devices since it will be used by code outside of net/eth.c in later
patches.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 14 Jul 2016
|
2015-12-14 |
net: resolv: Make argument const
...
resolv() is not allowed to change the hostname argument, make it const.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 14 Dec 2015
|
2015-11-20 |
net: eth: Remove ethaddr_param
...
commit d00db554 introduce ethaddr_param. But it is not initialized, so
devinfo fails to show the mac. Remove it and use edev->ethaddr.
Signed-off-by: Jan Remmet <j.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Jan Remmet
authored
on 19 Nov 2015
Sascha Hauer
committed
on 20 Nov 2015
|
2015-07-20 |
net_udp_bind(): use uint16_t type for source port
...
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Antony Pavlov
authored
on 19 Jul 2015
Sascha Hauer
committed
on 20 Jul 2015
|
2015-06-26 |
net: eth: Do not rely on CONFIG_PARAMETER to be enabled
...
register_preset_mac_address only works when CONFIG_PARAMETER
is enabled because otherwise dev_set_param is a no-op. Add a
function to set the MAC address explicitly without the need
of CONFIG_PARAMETER and use it where appropriate.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 26 Jun 2015
|
net: Make set_ethaddr argument const
...
The set_ethaddr callback should not modify the MAC address passed to it, so
make it const.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 26 Jun 2015
|
2014-07-02 |
net.h: add ETH_ALEN constant; fix whitespaces
...
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Antony Pavlov
authored
on 1 Jul 2014
Sascha Hauer
committed
on 2 Jul 2014
|
2014-05-15 |
net: Allow to use multiple network interfaces at once
...
In barebox network packets always go out at the current ethernet
device and are expected to be received from the current interface.
This has some side effects. When for example an NFS is mounted when
one interface is active and the interface is changed afterwards the
NFS packets leave the new interface, but the NFS server won't be
reachable there.
Instead of changing the whole network traffic to the current ethernet
interface we now initialize a network connection with the current
network interface, but then the connection will continue to use that
interface even when the current interface is changed.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 15 May 2014
|
net: Pass eth_device to net_receive
...
So that barebox has the information which interface a packet
came from.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 15 May 2014
|
2014-03-07 |
net: Add ifup support
...
The defaultenv-2 has ifup support as a shell script. This patch
replaces it with a command which is more robust, can be called
from C and now can also bring up all configured interfaces.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 7 Mar 2014
|
net: constify eth_get_byname argument
...
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 7 Mar 2014
|
2014-02-10 |
net: new function net_read_uint64
...
This is needed for nfs3 support as some types became bigger compared to
nfs2.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Uwe Kleine-König
authored
on 7 Feb 2014
Sascha Hauer
committed
on 10 Feb 2014
|
net: net_read_uint32: assert that only 32 bit are read
...
On some architectures (e.g. alpha, amd64, arm64, ia64, s390x, mips64)
sizeof(ulong) is 8 which made net_read_uint32 actually read too much and
even returned the wrong value on big endian machines.
(Note the second issue isn't that critical though, because the only
architecture from the list above that uses big endian byte order is s390x
...)
Also change the argument to void * because the pointer is not necessarily
properly aligned.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Uwe Kleine-König
authored
on 7 Feb 2014
Sascha Hauer
committed
on 10 Feb 2014
|