<html><body><p>We are late on tagging a release for Rackspace and so pushing through some final fixes. We can open an issue to remind us to review later.<br><br><br>Regards,<br>Norman James<br>IBM - POWER Systems Architect<br>Phone: 1-512-286-6807 (T/L: 363-6807)<br>Internet: njames@us.ibm.com<br><br><br><img width="16" height="16" src="cid:1__=09BBF5DCDF9719F38f9e8a93df938690918c09B@" border="0" alt="Inactive hide details for Joel Stanley ---02/03/2016 06:22:03 PM---On Thu, Feb 4, 2016 at 10:40 AM, OpenBMC Patches <openbmc-pa"><font color="#424282">Joel Stanley ---02/03/2016 06:22:03 PM---On Thu, Feb 4, 2016 at 10:40 AM, OpenBMC Patches <openbmc-patches@stwcx.xyz> wrote:</font><br><br><font size="2" color="#5F5F5F">From: </font><font size="2">Joel Stanley <joel@jms.id.au></font><br><font size="2" color="#5F5F5F">To: </font><font size="2">OpenBMC Patches <openbmc-patches@stwcx.xyz></font><br><font size="2" color="#5F5F5F">Cc: </font><font size="2">OpenBMC Maillist <openbmc@lists.ozlabs.org></font><br><font size="2" color="#5F5F5F">Date: </font><font size="2">02/03/2016 06:22 PM</font><br><font size="2" color="#5F5F5F">Subject: </font><font size="2">Re: [PATCH phosphor-host-ipmid] Add Set MAC address</font><br><font size="2" color="#5F5F5F">Sent by: </font><font size="2">"openbmc" <openbmc-bounces+njames=us.ibm.com@lists.ozlabs.org></font><br><hr width="100%" size="2" align="left" noshade style="color:#8091A5; "><br><br><br><tt>On Thu, Feb 4, 2016 at 10:40 AM, OpenBMC Patches<br><openbmc-patches@stwcx.xyz> wrote:<br>> From: Adriana Kobylak <anoo@us.ibm.com><br>><br>> Add Set MAC address parameter command<br><br>I notice you posted this patch 40 minutes ago, but had already merged<br>it. That doesn't give much opportunity for review.<br><br>> ---<br>> transporthandler.C | 32 ++++++++++++++++++++++++++++++++<br>> 1 file changed, 32 insertions(+)<br>><br>> diff --git a/transporthandler.C b/transporthandler.C<br>> index dac8fe8..c38adea 100644<br>> --- a/transporthandler.C<br>> +++ b/transporthandler.C<br>> @@ -14,6 +14,7 @@<br>> #endif<br>><br>> // OpenBMC System Manager dbus framework<br>> +extern sd_bus *bus;<br><br>Don't use extern.<br><br>We have ipmid_get_sd_bus_connection() to get a pointer to the sd_bus.<br><br>> const char *app = "org.openbmc.NetworkManager";<br>> const char *obj = "/org/openbmc/NetworkManager/Interface";<br>> const char *ifc = "org.openbmc.NetworkManager";<br>> @@ -64,6 +65,37 @@ ipmi_ret_t ipmi_transport_set_lan(ipmi_netfn_t netfn, ipmi_cmd_t cmd,<br>> {<br>> sprintf(new_ipaddr, "%d.%d.%d.%d", reqptr->data[0], reqptr->data[1], reqptr->data[2], reqptr->data[3]);<br>> }<br>> + else if (reqptr->parameter == 5) // MAC<br>> + {<br>> + char mac[18];<br>> + sd_bus_message *reply = NULL, *m = NULL;<br>> + sd_bus_error error = SD_BUS_ERROR_NULL;<br>> + int r = 0;<br><br>I don't think any of these should be initialised here.<br><br>> +<br>> + sprintf(mac, "%x:%x:%x:%x:%x:%x",<br><br>You want to use snprintf here.<br><br>Also, does this work? I would have thought you'd need to do %02x to<br>ensure leading zeroes are in the string.<br><br>> + reqptr->data[0],<br>> + reqptr->data[1],<br>> + reqptr->data[2],<br>> + reqptr->data[3],<br>> + reqptr->data[4],<br>> + reqptr->data[5]);<br>> +<br>> + r = sd_bus_message_new_method_call(bus,&m,app,obj,ifc,"SetHwAddress");<br>> + if (r < 0) {<br>> + fprintf(stderr, "Failed to add method object: %s\n", strerror(-r));<br>> + return -1;<br>> + }<br>> + r = sd_bus_message_append(m, "s", mac);<br>> + if (r < 0) {<br>> + fprintf(stderr, "Failed to append message data: %s\n", strerror(-r));<br>> + return -1;<br>> + }<br>> + r = sd_bus_call(bus, m, 0, &error, &reply);<br>> + if (r < 0) {<br>> + fprintf(stderr, "Failed to call method: %s\n", strerror(-r));<br>> + return -1;<br>> + }<br>> + }<br>> else if (reqptr->parameter == 6) // Subnet<br>> {<br>> sprintf(new_netmask, "%d.%d.%d.%d", reqptr->data[0], reqptr->data[1], reqptr->data[2], reqptr->data[3]);<br>> --<br>> 2.6.4<br>><br>><br>> _______________________________________________<br>> openbmc mailing list<br>> openbmc@lists.ozlabs.org<br>> </tt><tt><a href="https://lists.ozlabs.org/listinfo/openbmc">https://lists.ozlabs.org/listinfo/openbmc</a></tt><tt><br>_______________________________________________<br>openbmc mailing list<br>openbmc@lists.ozlabs.org<br></tt><tt><a href="https://lists.ozlabs.org/listinfo/openbmc">https://lists.ozlabs.org/listinfo/openbmc</a></tt><tt><br></tt><br><BR>
</body></html>