diff options
author | Jason M. Bills <jason.m.bills@linux.intel.com> | 2021-05-24 22:54:37 +0300 |
---|---|---|
committer | Jason M. Bills <jason.m.bills@linux.intel.com> | 2021-05-24 23:12:35 +0300 |
commit | 2a64b8ae9b952b18b4aef38cb7c41ce6dba16c50 (patch) | |
tree | 704eb802dc7b987411a0e44d128bdd8978745d8c /meta-openbmc-mods/meta-common/recipes-network | |
parent | 0e0df451ae365f09d5c0c766b253f23de26901f2 (diff) | |
download | openbmc-2a64b8ae9b952b18b4aef38cb7c41ce6dba16c50.tar.xz |
Update to internal 0.52
Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
Diffstat (limited to 'meta-openbmc-mods/meta-common/recipes-network')
3 files changed, 17 insertions, 144 deletions
diff --git a/meta-openbmc-mods/meta-common/recipes-network/network/phosphor-network/0003-Adding-channel-specific-privilege-to-network.patch b/meta-openbmc-mods/meta-common/recipes-network/network/phosphor-network/0003-Adding-channel-specific-privilege-to-network.patch index a8dd27f8a..6bfe783af 100644 --- a/meta-openbmc-mods/meta-common/recipes-network/network/phosphor-network/0003-Adding-channel-specific-privilege-to-network.patch +++ b/meta-openbmc-mods/meta-common/recipes-network/network/phosphor-network/0003-Adding-channel-specific-privilege-to-network.patch @@ -1,4 +1,4 @@ -From c5c5634ccc31cd494ad5333987fa6076f0f7464a Mon Sep 17 00:00:00 2001 +From 07bba51a168b769563a649f1c0f3a9126f480e57 Mon Sep 17 00:00:00 2001 From: AppaRao Puli <apparao.puli@linux.intel.com> Date: Thu, 2 Apr 2020 17:06:07 +0530 Subject: [PATCH] Adding channel specific privilege to network @@ -19,17 +19,17 @@ Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com> Signed-off-by: Yong Li <yong.b.li@linux.intel.com> Signed-off-by: Johnathan Mantey <johnathanx.mantey@intel.com> --- - ethernet_interface.cpp | 123 +++++++++++++++++++++++++++++++++++++++++ - ethernet_interface.hpp | 37 ++++++++++++- - network_manager.cpp | 102 ++++++++++++++++++++++++++++++++++ + ethernet_interface.cpp | 124 +++++++++++++++++++++++++++++++++++++++++ + ethernet_interface.hpp | 37 +++++++++++- + network_manager.cpp | 102 +++++++++++++++++++++++++++++++++ network_manager.hpp | 9 +++ - 4 files changed, 270 insertions(+), 1 deletion(-) + 4 files changed, 271 insertions(+), 1 deletion(-) diff --git a/ethernet_interface.cpp b/ethernet_interface.cpp -index 522be57..89adf69 100644 +index c47a759..d7a4168 100644 --- a/ethernet_interface.cpp +++ b/ethernet_interface.cpp -@@ -44,6 +44,10 @@ constexpr auto PROPERTY_INTERFACE = "org.freedesktop.DBus.Properties"; +@@ -45,6 +45,10 @@ constexpr auto PROPERTY_INTERFACE = "org.freedesktop.DBus.Properties"; constexpr auto RESOLVED_SERVICE_PATH = "/org/freedesktop/resolve1/link/"; constexpr auto METHOD_GET = "Get"; @@ -40,7 +40,7 @@ index 522be57..89adf69 100644 struct EthernetIntfSocket { EthernetIntfSocket(int domain, int type, int protocol) -@@ -101,6 +105,7 @@ EthernetInterface::EthernetInterface(sdbusplus::bus::bus& bus, +@@ -128,6 +132,7 @@ EthernetInterface::EthernetInterface(sdbusplus::bus::bus& bus, EthernetInterfaceIntf::autoNeg(std::get<2>(ifInfo)); EthernetInterfaceIntf::speed(std::get<0>(ifInfo)); #endif @@ -48,10 +48,11 @@ index 522be57..89adf69 100644 // Emit deferred signal. if (emitSignal) -@@ -1068,5 +1073,123 @@ void EthernetInterface::deleteAll() +@@ -1148,5 +1153,124 @@ std::string EthernetInterface::defaultGateway6(std::string gateway) manager.writeToConfigurationFile(); + return gw; } - ++ +nlohmann::json EthernetInterface::readJsonFile(const std::string& configFile) +{ + std::ifstream jsonFile(configFile); @@ -173,7 +174,7 @@ index 522be57..89adf69 100644 } // namespace network } // namespace phosphor diff --git a/ethernet_interface.hpp b/ethernet_interface.hpp -index abaf43e..f6d6363 100644 +index e2418a2..60fd272 100644 --- a/ethernet_interface.hpp +++ b/ethernet_interface.hpp @@ -2,11 +2,14 @@ @@ -216,9 +217,9 @@ index abaf43e..f6d6363 100644 class Manager; // forward declaration of network manager. -@@ -223,6 +230,14 @@ class EthernetInterface : public Ifaces +@@ -233,6 +240,14 @@ class EthernetInterface : public Ifaces */ - void deleteAll(); + std::string defaultGateway6(std::string gateway) override; + /** @brief sets the channel maxium privilege. + * @param[in] value - Channel privilege which needs to be set on the @@ -231,7 +232,7 @@ index abaf43e..f6d6363 100644 using EthernetInterfaceIntf::dHCPEnabled; using EthernetInterfaceIntf::interfaceName; using EthernetInterfaceIntf::linkUp; -@@ -344,6 +359,26 @@ class EthernetInterface : public Ifaces +@@ -356,6 +371,26 @@ class EthernetInterface : public Ifaces * @returns true/false value if the address is static */ bool originIsManuallyAssigned(IP::AddressOrigin origin); @@ -406,5 +407,5 @@ index 6815d3f..96e20a6 100644 } // namespace network -- -2.29.2 +2.17.1 diff --git a/meta-openbmc-mods/meta-common/recipes-network/network/phosphor-network/0004-Improved-IPv6-netmask-parsing.patch b/meta-openbmc-mods/meta-common/recipes-network/network/phosphor-network/0004-Improved-IPv6-netmask-parsing.patch deleted file mode 100644 index d0ba59ccd..000000000 --- a/meta-openbmc-mods/meta-common/recipes-network/network/phosphor-network/0004-Improved-IPv6-netmask-parsing.patch +++ /dev/null @@ -1,127 +0,0 @@ -From 371fb36e7a92b4139022b568a278e7624727bbaf Mon Sep 17 00:00:00 2001 -From: Johnathan Mantey <johnathanx.mantey@intel.com> -Date: Tue, 26 Jan 2021 15:02:54 -0800 -Subject: [PATCH] Improved IPv6 netmask parsing - -The subnet mask parsing in toV6CIDR only worked for very well behaved -subnet strings. This became apparent after the BMC received a DHCP -assigned IPv6 address with an Address Prefix equal to /128. Any -netmask values trailing the final ":" character were ignored. In -addition it assumed all subnet entries would be submitted in shorthand -form. - -The changes here handle mask values supplied following the final ":" -character. It also does more sanity checking on the incoming subnet -string. - -Tested: -Supplied the function with the following test patterns, and confirmed -the function returns accurate address prefix values. - ffff:ffff:: - ffff:fc00:: - ffff:0:0:0:0:0:0:0 - ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff - ffff:ffff:ffff:ffff:ffff:ffff:ffff:fffc - ffff:0:0:6:0:0:0:0 - : - :: - -Change-Id: Ib2c73fe07a6a3f1c7a5f0e8f231dfef21badb3af -Signed-off-by: Johnathan Mantey <johnathanx.mantey@intel.com> - -%% original patch: 0004-Improved-IPv6-netmask-parsing.patch ---- - util.cpp | 67 ++++++++++++++++++++------------------------------------ - 1 file changed, 24 insertions(+), 43 deletions(-) - -diff --git a/util.cpp b/util.cpp -index 0c5dbff..c230221 100644 ---- a/util.cpp -+++ b/util.cpp -@@ -37,59 +37,40 @@ namespace fs = std::filesystem; - - uint8_t toV6Cidr(const std::string& subnetMask) - { -- uint8_t pos = 0; -- uint8_t prevPos = 0; -- uint8_t cidr = 0; -- uint16_t buff{}; -- do -+ struct in6_addr subnet; -+ int ret = inet_pton(AF_INET6, subnetMask.c_str(), &subnet); -+ if (ret != 1) - { -- // subnet mask look like ffff:ffff:: -- // or ffff:c000:: -- pos = subnetMask.find(":", prevPos); -- if (pos == std::string::npos) -- { -- break; -- } -- -- auto str = subnetMask.substr(prevPos, (pos - prevPos)); -- prevPos = pos + 1; -+ log<level::ERR>("Invalid Mask", -+ entry("SUBNETMASK=%s", subnetMask.c_str())); -+ return 0; -+ } - -- // String length is 0 -- if (!str.length()) -- { -- return cidr; -- } -- // converts it into number. -- if (sscanf(str.c_str(), "%hx", &buff) <= 0) -+ uint8_t cidr = 0; -+ bool zeroesFound = false; -+ int bitsSet, trailingZeroes; -+ for (int lv = 0; lv < 4; lv++) -+ { -+ subnet.s6_addr32[lv] = be32toh(subnet.s6_addr32[lv]); -+ bitsSet = __builtin_popcount(subnet.s6_addr32[lv]); -+ if (zeroesFound && bitsSet) - { - log<level::ERR>("Invalid Mask", - entry("SUBNETMASK=%s", subnetMask.c_str())); -- - return 0; - } -+ trailingZeroes = __builtin_ctz(subnet.s6_addr32[lv]); -+ zeroesFound |= trailingZeroes; - -- // convert the number into bitset -- // and check for how many ones are there. -- // if we don't have all the ones then make -- // sure that all the ones should be left justify. -- -- if (__builtin_popcount(buff) != 16) -+ if (bitsSet + trailingZeroes != 32) - { -- if (((sizeof(buff) * 8) - (__builtin_ctz(buff))) != -- __builtin_popcount(buff)) -- { -- log<level::ERR>("Invalid Mask", -- entry("SUBNETMASK=%s", subnetMask.c_str())); -- -- return 0; -- } -- cidr += __builtin_popcount(buff); -- return cidr; -+ // There are '1' bits interspersed with '0' bits -+ log<level::ERR>("Invalid Mask", -+ entry("SUBNETMASK=%s", subnetMask.c_str())); -+ return 0; - } -- -- cidr += 16; -- } while (1); -- -+ cidr += bitsSet; -+ } - return cidr; - } - } // anonymous namespace --- -2.26.2 - diff --git a/meta-openbmc-mods/meta-common/recipes-network/network/phosphor-network_%.bbappend b/meta-openbmc-mods/meta-common/recipes-network/network/phosphor-network_%.bbappend index 973cba09e..3540e93b4 100644 --- a/meta-openbmc-mods/meta-common/recipes-network/network/phosphor-network_%.bbappend +++ b/meta-openbmc-mods/meta-common/recipes-network/network/phosphor-network_%.bbappend @@ -3,10 +3,9 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" DEPENDS += "nlohmann-json boost" SRC_URI = "git://github.com/openbmc/phosphor-networkd" -SRCREV = "1b5ec9c5367947d19bdf6efd08251eeb55dd90f4" +SRCREV = "ee5b2c9469a56205567a8b1b120ecf34fc9f5ef4" SRC_URI += "file://0003-Adding-channel-specific-privilege-to-network.patch \ - file://0004-Improved-IPv6-netmask-parsing.patch \ " EXTRA_OECONF_append = " --enable-nic-ethtool=yes" |