| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
| |
If the Default Gateway parameter is not valid, throw the
InvalidArgument error.
Resolves openbmc/openbmc#3261
Tested: See the InvalidArgument error on values such as
"blah" or "1.0.8".
Change-Id: Ieeb0da7e3c3806144634cda6cd069758dba92a47
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reordering all the headers to the following structure:
header file:
local
c
cpp (including openbmc libraries)
source file:
source.hpp (if applicable)
local
c
cpp
Change-Id: Ia74a5c761a3029819366159de3cfd40c5e4c4a2c
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
| |
Change-Id: I845ec44a305e91a4880dc1266a3d212db0b4737c
Signed-off-by: Oskar Senft <osk@google.com>
|
|
|
|
|
| |
Change-Id: I0b2b3e204e8c50062ae4dfcfb1c50c274264fa81
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
unit tests is broken due to the
commit(https://gerrit.openbmc-project.xyz/#/c/10566)
in sdbusplus repo which starts throwing exception
after sdbusplus::bus::call.
Need to write mock class for sdbusplus methods.
Re-enable the unit test would be done with the following
issue https://github.com/openbmc/phosphor-networkd/issues/23
Change-Id: Ib113a65d63d14be1e9e57191851df23ffe8bc518
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
sdbusplus supports errors on properties, so we can now throw
exceptions on such cases as invalid parameters.
Also changed the journal log levels to ERR.
Tested: Built an image and see invalid parameter errors on values
like garbage MAC addresses and non-admin MAC Addresses.
Change-Id: I69687bbf34fe51f0c812f40dfc99bb88ce141a2f
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Partly resolves openbmc/openbmc 2905
Bonus! The new static_assert found a related bug in log.cpp:
log("msg", entry("fmt", data, entry("fmt", data)))
which should have been:
log("msg", entry("fmt", data), entry("fmt", data))
Tested: static_assert only
Change-Id: Ie1c550a27f454ef92ee096d812adcc400a1a25cf
Signed-off-by: Joseph Reynolds <jrey@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Checking if the interface name is not the same as the previous is based
upon the assumption that your list of interface names (ifa->ifa_name) will
always come back in sorted order of the interface they belong to, i.e.
eth0:
169.172.0.1
128.42.38.7
eth1:
14.243.48.103
fe80::740:61ff:fe74:3eb2
This assumption is wrong since the IP address can come in any order they
please, i.e.
eth0:
169.172.0.1
eth1:
fe80::740:61ff:fe74:3eb2
eth0:
128.42.38.7
eth1:
14.243.48.103
The if condition I removed is looking to see if the interface name is not
equal to the previous interface name, where it would assume it was
rolling over to the next free interface, always leaving you with the
last valid IP in the interface. In my case it was leaving me with only
IPv4 addresses and not including IPv6 addresses.
Tested By: Resetting my network to factory defaults, checking DBUS for
all ipv6 addresses:
dbus-send --system \
--print-reply \
--dest=xyz.openbmc_project.Network \
/xyz/openbmc_project/network/eth0/ipv6\
org.freedesktop.DBus.Introspectable.Introspect
Adding an IPv6 Address:
dbus-send --system \
--dest=xyz.openbmc_project.Network \
--type=method_call \
--print-reply \
/xyz/openbmc_project/network/eth0 \
xyz.openbmc_project.Network.IP.Create.IP \
string:"xyz.openbmc_project.Network.IP.Protocol.IPv6" \
string:"2002:1001:1001:1001:1001:1001:1001:1006" byte:10 \
string:"1001:1001:1001:1001:1001:1001:1001:1001" \
Validating the static IPv6 address appeared by the initial introspect command.
Change-Id: I3b85cecded696c251028accb28448f6e53bd9a7f
Signed-off-by: David Cobbley <david.j.cobbley@linux.intel.com>
|
|
|
|
|
| |
Change-Id: I20872cd07dccc3e6fb245fc42ac927a6127ff2ae
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
|
|
|
|
|
|
|
|
| |
As per the linux routing policy it always takes the
first matched route for the given network.
Change-Id: I1d9722fd773f3ba4619225f9d06d1db7da9b69c5
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
|
|
|
|
|
|
|
|
| |
Prior to this fix variable was being used even its
memory was moved which can lead to undefined behaviour.
Change-Id: Ibb611fd699df6f30bcfeaa66d151920556dac64e
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
|
|
|
|
|
|
|
| |
Each route should be its own Route Section.
Change-Id: I697d9d7e1cf2b1656cea7c31f9c342067a486fd2
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
|
|
|
|
|
|
|
|
|
| |
Spelling errors found using github.com/lucasdemarchi/codespell
A tool to fix common misspellings.
This tool is licensed under GNU General Public License, version 2.
Change-Id: Ia0a4d655510a1d5f81ac369bdad9f7cfbd675484
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit adds the functionality to
call the specific function depends on the
command given.
eg: Force a channel to be used.
ncsi-netlink --set -x 2 -p 0 -c 0
x: Interface Index
p: Package number
c: channel number
eg: Gets the info of a given interface
ncsi-netlink --info -x 2 -p 0
x: Interface Index
p: Package number
eg: Clear all the package/channel
ncsi-netlink --clear -x 2
x: Interface Index
This commit also removes the unnecessary
console messages.
Change-Id: I682f91452a3ab6362be0de8ac2658ffc9e160c29
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
| |
This function is used to dump all the info
of the package and the channels underlying
the package.
This function talks with the NCSI driver over
netlink messages.
Change-Id: Ie0aa8924049a6d3b32426627e025f653f84cfbe9
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
SetChannel:This function will ask underlying NCSI driver
to set the package or package/channel combination as the
preferred choice.
ClearInterface:This function clears any preferred setting
from the specific interface.
These functions talks with the NCSI driver through
the netlink messages.
Change-Id: Icb5ae35f83b5b0d0f9654ff4a0dd568fe10680a7
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
|
|
|
|
|
|
|
|
| |
Accepts command line arguments for interface index,
ncsi channel,package etc.
Change-Id: Ib2b049a2fb017593a0a4329b26bbd64c65c8b580
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
|
|
|
|
|
|
|
| |
Reworded cleaning the repo. The old wording did not make sense.
Change-Id: I7dabcd379b7efa0f198b3bfdd91377208ad7ceca
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With the changes done for the issue #2891, we are adding DHCP section
always into n/w config file, irrespective of DHCP enabled or not.
With those new changes when DHCP is disabled(i.e in static case)
DHCP=xxx entry is getting added into Route section and causing the
issue.
Resolves openbmc/openbmc#3030
Change-Id: I97b30129de97eff5d25e78a09e9cb713c45ad4a7
Signed-off-by: Nagaraju Goruganti <ngorugan@in.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With MAKEFLAGS=-jN for N > 1 we hit race conditions in the test suite.
Multiple independent tests use the same absolute path under /tmp for
test case IO. This leads to corruption across the tests manifesting as
intermittent failures. Make the file-names semi-unique.
This solution is poor in that it makes no attempt at ensuring the file
names are absolutely unique, but they are at least unique wither respect
to the other test file names, which is an improvement.
Change-Id: I6b312093a2d9cd52261d02821566b69e874e7770
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We were hitting test failures caused by
EXPECT_EQ(true, isInterfaceAdded("igb5"));
at the end of the WithSingleInterface case. There appears to be a race
condition between the netlink handling and the timer expiry, so
increment the number of retries for test stability.
Change-Id: I6cd2e4e95ee4d183466c73fa8a36a5580f566227
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
|
|
|
|
|
|
|
|
|
| |
All the test was doing was verifying that an exception hadn't occurred.
The test would fail if one had, so we're better off just not doing the
dance.
Change-Id: Iff7d9e4947e86b24f4cf99ddbac3e9c42e63f1d3
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We were hitting a SEGFAULT by nullptr dereference in the WithSingleInterface
test when calling sd_bus_ref() via the timer callback with code generated at
-O2 from Ubuntu Artful's gcc-7.2.0:
Running main() from gtest_main.cc
Note: Google Test filter = TestRtNetlink.WithSingleInterface
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from TestRtNetlink
[ RUN ] TestRtNetlink.WithSingleInterface
ASAN:DEADLYSIGNAL
=================================================================
==19427==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7f8a944922ca bp 0x0fffd7e37fc2 sp 0x7ffebf1bfda8 T0)
==19427==The signal is caused by a READ memory access.
==19427==Hint: address points to the zero page.
#0 0x7f8a944922c9 in sd_bus_ref (/lib/x86_64-linux-gnu/libsystemd.so.0+0x2e2c9)
#1 0x7f8a93a5c616 in sdbusplus::bus::bus::bus(sd_bus*) /usr/local/include/sdbusplus/bus.hpp:340
#2 0x7f8a93a5c616 in sdbusplus::server::interface::interface::interface(sdbusplus::bus::bus&, char const*, char const*, sd_bus_vtable const*, void*) /usr/local/include/sdbusplus/server/interface.hpp:61
...
#16 0x559d611755e7 in phosphor::network::Manager::createInterfaces() ../network_manager.cpp:151
#17 0x559d61178e12 in phosphor::network::Manager::createChildObjects() ../network_manager.cpp:166
#18 0x559d611ed59b in std::function<void ()>::operator()() const /usr/include/c++/7/bits/std_function.h:706
#19 0x559d611ed59b in phosphor::network::Timer::timeoutHandler(sd_event_source*, unsigned long, void*) ../timer.cpp:72
#20 0x7f8a9448e80d (/lib/x86_64-linux-gnu/libsystemd.so.0+0x2a80d)
#21 0x7f8a944903e9 in sd_event_dispatch (/lib/x86_64-linux-gnu/libsystemd.so.0+0x2c3e9)
#22 0x7f8a94490566 in sd_event_run (/lib/x86_64-linux-gnu/libsystemd.so.0+0x2c566)
#23 0x559d610e122e in phosphor::network::TestRtNetlink_WithSingleInterface_Test::TestBody() /tmp/openbmc-build-scripts.wUcrvx/phosphor-networkd/test/test_rtnetlink.cpp:135
...
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (/lib/x86_64-linux-gnu/libsystemd.so.0+0x2e2c9) in sd_bus_ref
==19427==ABORTING
Move the bus storage to namespace scope alongside the Manager to avoid it
getting cleaned up before the callback fires.
Change-Id: I3126d0b7b92fb6e66d82f9e32b43a52e44356884
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
DHCP config object.
Each time when we update config file we recreate DHCP config object,
with existing code DHCP configuration values are getting initialized
to default values.
With these changes we get DHCP configuration values from n/w config.
Resolves openbmc/openbmc#2891
Change-Id: I95d50d52a8aa569493739a46b88e4a378e399698
Signed-off-by: Nagaraju Goruganti <ngorugan@in.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Presently the code was creating the elog during reading of
the values from the config parser which creates
the journal log internally("Internal error Occured")
Apart from creating elog,Code also logs into the journal
more descriptive message saying which section and key
was not found.
The code which catches the exception that also logs
into the journal.
In the changed approach instead of throwing exception
we are returning the return code as not finding a section
or key in the network config file is not an error.
Change-Id: Ib89a3af6541fdf93fb5fa9a8e583d6c6ed88da79
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
|
|
|
|
|
|
|
|
|
| |
If the MAC address hasn't been set or has changed,
set it. Otherwise, don't set it because it will cause
the link to reset.
Change-Id: I9018df6a3fa4743894bc0f3cd47bdf1be71632e4
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
|
| |
std::function is not found with a GCC 7.2 runtime.
Tested: Built repository with GCC 7.2
Change-Id: I4f122039e7708a2cb9f785210e49c7d22abb8510
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When the network manager comes up it creates the network
Dbus objects,With the recent change we start writing the
network configuration file,which doesn't create the network
objects immediately rather it waits for a time window, when
the timer gets expired,It creates the objects.
so it introduces a window where other application which is
waiting for a D-Bus object,gets the notification that object
exist but during accessing of object that object doesn't exist
due to network timer got expired and it is recreating the
network objects.
It is kind of race condition.
Resolves openbmc/openbmc#2897
Change-Id: I4d557d21940ec3f149426a26cf6363010c422dd7
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
|
|
|
|
|
|
|
|
| |
Added the attribute "SendHostname", when it is true machine's hostname
will be included in DHCP packet.
Change-Id: I9bf5f76980f152d48f7f3acf7448c8bc199905bb
Signed-off-by: Nagaraju Goruganti <ngorugan@in.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
systemd-timesyncd will not pick the updated NTP server list in network
config until systemd-networkd is reloaded.
So if NTPServers are updated in network config, reload networkd, and
timesyncd will automatically pick the updated NTP servers.
Resolves openbmc/openbmc#2859
Change-Id: I7c01a58d9d1652eee236c8818a41d66eda5b266e
Signed-off-by: Lei YU <mine260309@gmail.com>
|
|
|
|
|
|
|
|
|
|
| |
1. Added testcases to validate IP/PrefixLengnth/MACAddress.
2. Added test to rtnetlink.
Resolves openbmc/openbmc#2546
Change-Id: I61efbf69682a50f7479b68e32d9714e9c81a32d7
Signed-off-by: Nagaraju Goruganti <ngorugan@in.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In ipv6 network where ipv6 router is there which keeps advertising
the router prefix, as part of handling this message BMC keeps adding the
new IP address on the interface which is leading to refresh the
network objects periodically.
This fix stops accepting the router advertisement messaage.
Resolves openbmc/openbmc#2739
Change-Id: I0a4068b5419133a25a2ea3f769f730e73860da50
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
-elog<InvalidArgument> is throwing an exception in bad path
testing and we don't have catch for it in current code.
-Updated the yaml file(added error) which will catch the exception
and will return error.
Fixes openbmc/openbmc#2576
Change-Id: If3db07e5d96231189bd2742cc6803b480b9ac462
Signed-off-by: Nagaraju Goruganti <ngorugan@in.ibm.com>
|
|
|
|
|
|
|
|
| |
we have updated yaml file to return error code in case of
invalid ip/gateway/prefix, no need of return statement now.
Change-Id: I9a32e3df12f8f521f5353b011c6a51698bd77403
Signed-off-by: Nagaraju Goruganti <ngorugan@in.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
-Use "%02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx".Here hh is to
tell snprintf that the argument is an unsigned char, 0 is to get
zero padding and 2 to set the width to 2. x or X for
lower/uppercase hex characters.
Fixes openbmc/openbmc#2701
Change-Id: I92a62541157683f8c1e7048160b3d3de772e6125
Signed-off-by: Nagaraju Goruganti <ngorugan@in.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Prior to this patch we did't have any code in place to validate
the given dafault gateway.
We need to support multiple default gateways to support dual
stack(ipv4/ipv6).
Currently we only supports ipv4 so here we validate gw only for ipv4.
Opened new issue: https://github.com/openbmc/openbmc/issues/2570 to
support ipv6.
Resolves openbmc/openbmc#2520
Change-Id: Ia84cb185b28966e651597666ad71d58a67dd78b9
Signed-off-by: Nagaraju Goruganti <ngorugan@in.ibm.com>
|
|
|
|
|
|
|
|
| |
The log contains a fair amount of extra whitespace,
which this addresses.
Change-Id: I08a954665803cf9096fe6f3d7539e9e7818b70fa
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds a common method to make changes to the network manager
configuration. Pushed the basic configuration up to a single method,
which checks for minimum required fields, at which point, each
individual configuration change can be applied on top of that.
Pushed network restart functions to a central point.
Set & get hostname
Set & get gateway outside of existing static IP set & get
Set & get gratuitous ARP.
Change-Id: I74e4a9ce22a350fa05d6ce4ac7b09ef96a789b9f
Signed-off-by: David Cobbley <david.j.cobbley@linux.intel.com>
|
|
|
|
|
|
|
|
|
|
| |
Increase the waiting time for refreshing the objects as
event for link local object comes late by sec or two.
Resolves openbmc/openbmc#2644
Change-Id: I5c767877f437c8538e9af7efde8f04ad088458ab
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
|
|
|
|
|
| |
Change-Id: I1a02c0050c5a3f1d89664e4b37676a7dbdcf8a56
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As socket lifetime goes out of scope before starting the
sd event loop,so now create the socket outside and pass
it to rtnetlink server.
Resolves openbmc/openbmc#2562
Resolves openbmc/openbmc#2575
Resolves openbmc/openbmc#2632
Change-Id: If80a9cc3556c201a8864836e738d23fcef80b9e7
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
|
|
|
|
|
| |
Change-Id: I514dd86b3bcca916cc4c3479e0441e1e200c95f5
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
|
|
|
|
|
| |
Change-Id: Ifeb3d4f1f56bf189299e79728c280e16b21039b9
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
|
|
|
|
|
|
|
|
| |
Default gateway would be whose destination is 0 but gateway
entry should be nonzero.
Change-Id: I14b318998741e69db33ce603b2f131b49545b5de
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
|
|
|
|
|
|
|
|
|
| |
During creation of IP address objects, We determine the ipaddress origin
and if the first address is link local then the origin property was not
changed for other static addresses.
Change-Id: Iacea6393121271327be5c79206492422b5d21a73
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
We have the issue opened for where link local address should not
implement the delete interface at all, we need some refactoring there
so for quick fix if delete operation performed on link local address
we are just logging it in the journal and return.
Resolves openbmc/openbmc#2561
Change-Id: I031e92206b98b729ea0bc0b135fb406563fc5dd0
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
|
|
|
|
|
|
|
| |
Fixes openbmc/openbmc#2107
Change-Id: Id6810be3527e4861430077364a5af4dc00e52f3b
Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
| |
This commit adds support for enabling user to specify the
DNS entries and then updating the resolver file with the same
Change-Id: Ib78b822592ea8bdd1f821ccbf1362d96a5021b90
Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
| |
MAC Address validate method is retruning true for address:
00:00:00:00:00:00 which is an invalid address.
Resolves openbmc/openbmc#2333
Change-Id: Ida6c84855abeb11c95673087a8b361f151b0a3bc
Signed-off-by: Nagaraju Goruganti <ngorugan@in.ibm.com>
|
|
|
|
|
| |
Change-Id: I953614024660287b94d835e30b117cc4023e749b
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
|