<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="12" style="border: 1px #c9c399 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="https://git.reviewboard.kde.org/r/124747/">https://git.reviewboard.kde.org/r/124747/</a>
     </td>
    </tr>
   </table>
   <br />










<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On August 15th, 2015, 6:53 p.m. UTC, <b>Lamarque Souza</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  


<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
 <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
    <a href="https://git.reviewboard.kde.org/r/124747/diff/1/?file=394828#file394828line133" style="color: black; font-weight: bold; text-decoration: underline;">libs/editor/settings/wificonnectionwidget.cpp</a>
    <span style="font-weight: normal;">

     (Diff revision 1)

    </span>
   </th>
  </tr>
 </thead>

 <tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
  <tr>

   <td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">void WifiConnectionWidget::generateRandomClonedMac()</pre></td>

  </tr>
 </tbody>



 
 

 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">133</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span class="n">mac</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">=</span> <span class="n">mac</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">&</span> <span class="o">~</span><span class="mi">1</span><span class="p">;</span></pre></td>
  </tr>

 </tbody>

</table>

  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">You can use:</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">mac[0] &= ~0x1;
mac[0] |= 0x2;</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">It is more common to specify bits in hexadecimal than decimal. I know, in this particular case they use the same digits.</p></pre>
 </blockquote>



 <p>On August 15th, 2015, 6:59 p.m. UTC, <b>Boudhayan Gupta</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">I'll fix it to use hex, but using the &= and |= shorthand gives a very weird build error:</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;"><div class="codehilite" style="background: #f8f8f8"><pre style="line-height: 125%"><span style="border: 1px solid #FF0000">/home/bg14ina/Projects/plasma-nm/libs/editor/settings/wificonnectionwidget.cpp: In member function ‘void WifiConnectionWidget::generateRandomClonedMac()’:</span>
<span style="border: 1px solid #FF0000">/home/bg14ina/Projects/plasma-nm/libs/editor/settings/wificonnectionwidget.cpp:133:12: error: no match for ‘operator&=’ (operand types are ‘QByteRef’ and ‘int’)</span>
     mac<span style="color: #BC7A00">[</span><span style="color: #666666">0</span><span style="color: #BC7A00">]</span> <span style="color: #666666">&=</span> <span style="color: #666666">~1</span>;
            <span style="color: #666666">^</span>
<span style="border: 1px solid #FF0000">/home/bg14ina/Projects/plasma-nm/libs/editor/settings/wificonnectionwidget.cpp:134:12: error: no match for ‘operator|=’ (operand types are ‘QByteRef’ and ‘int’)</span>
     mac<span style="color: #BC7A00">[</span><span style="color: #666666">0</span><span style="color: #BC7A00">]</span> <span style="color: #666666">|=</span> <span style="color: #666666">2</span>;
            <span style="color: #666666">^</span>
In file included from <span style="color: #666666">/</span>usr<span style="color: #666666">/</span>include<span style="color: #666666">/</span>qt<span style="color: #666666">/</span>QtCore<span style="color: #666666">/</span>QtCore<span style="color: #666666">:48:0</span>,
                 from <span style="color: #666666">/</span>usr<span style="color: #666666">/</span>include<span style="color: #666666">/</span>qt<span style="color: #666666">/</span>QtDBus<span style="color: #666666">/</span>QtDBusDepends<span style="color: #666666">:3</span>,
                 from <span style="color: #666666">/</span>usr<span style="color: #666666">/</span>include<span style="color: #666666">/</span>qt<span style="color: #666666">/</span>QtDBus<span style="color: #666666">/</span>QtDBus<span style="color: #666666">:3</span>,
                 from <span style="color: #666666">/</span>usr<span style="color: #666666">/</span>include<span style="color: #666666">/</span>KF5<span style="color: #666666">/</span>ModemManagerQt<span style="color: #666666">/</span>generictypes.h<span style="color: #666666">:30</span>,
                 from <span style="color: #666666">/</span>usr<span style="color: #666666">/</span>include<span style="color: #666666">/</span>KF5<span style="color: #666666">/</span>ModemManagerQt<span style="color: #666666">/</span>bearer.h<span style="color: #666666">:30</span>,
                 from <span style="color: #666666">/</span>usr<span style="color: #666666">/</span>include<span style="color: #666666">/</span>KF5<span style="color: #666666">/</span>ModemManagerQt<span style="color: #666666">/</span>modem.h<span style="color: #666666">:37</span>,
                 from <span style="color: #666666">/</span>home<span style="color: #666666">/</span>bg14ina<span style="color: #666666">/</span>Projects<span style="color: #666666">/</span>plasma<span style="color: #666666">-</span>nm<span style="color: #666666">/</span>libs<span style="color: #666666">/</span>uiutils.h<span style="color: #666666">:41</span>,
                 from <span style="color: #666666">/</span>home<span style="color: #666666">/</span>bg14ina<span style="color: #666666">/</span>Projects<span style="color: #666666">/</span>plasma<span style="color: #666666">-</span>nm<span style="color: #666666">/</span>libs<span style="color: #666666">/</span>editor<span style="color: #666666">/</span>settings<span style="color: #666666">/</span>wificonnectionwidget.cpp<span style="color: #666666">:28:</span>
<span style="border: 1px solid #FF0000">/usr/include/qt/QtCore/qurl.h:377:33: note: candidate: QUrl::FormattingOptions& operator|=(QUrl::FormattingOptions&, QUrl::ComponentFormattingOptions)</span>
 inline QUrl<span style="color: #666666">::</span>FormattingOptions <span style="color: #666666">&</span>operator<span style="color: #666666">|=</span>(QUrl<span style="color: #666666">::</span>FormattingOptions <span style="color: #666666">&</span>i, QUrl<span style="color: #666666">::</span>ComponentFormattingOptions f)
                                 <span style="color: #666666">^</span>
<span style="border: 1px solid #FF0000">/usr/include/qt/QtCore/qurl.h:377:33: note:   no known conversion for argument 1 from ‘QByteRef’ to ‘QUrl::FormattingOptions& {aka QUrlTwoFlags<QUrl::UrlFormattingOption, QUrl::ComponentFormattingOption>&}’</span>
</pre></div>
</p></pre>
 </blockquote>







</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Ok, let's use the old version then. Do you have a developer account or do you need me to push this patch for you?</p></pre>
<br />




<p>- Lamarque</p>


<br />
<p>On August 15th, 2015, 7:03 p.m. UTC, Boudhayan Gupta wrote:</p>








<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="12" style="border: 1px #888a85 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
 <tr>
  <td>

<div>Review request for Network Management.</div>
<div>By Boudhayan Gupta.</div>


<p style="color: grey;"><i>Updated Aug. 15, 2015, 7:03 p.m.</i></p>









<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
plasma-nm
</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Randomly generated MAC addresses aren't truly random; they should have an even first octet (LSB set to 0) to signify that this is an Unicast address, and the second least-significant-bit should be set to 1 to specify that it is a locally administered MAC, not a globally enforced one.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Setting the Multicast bit (current behaviour half the time) will result in the kernel refusing to set the randomly generated MAC address, with a small entry in Journalctl/Syslog:</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">[platform/nm-linux-platform.c:2782] do_change_link(): platform-linux: do-change-link: failure changing link 3: Invalid address for specified address family (19)</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">This small patch fixes random MAC generation for both Wired and WiFi connections</p></pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Builds, correctly generates random MACs with last two bits of first octet set to 10, saves said MAC.</p></pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>libs/editor/settings/wificonnectionwidget.cpp <span style="color: grey">(d22fda0)</span></li>

 <li>libs/editor/settings/wiredconnectionwidget.cpp <span style="color: grey">(80523ef)</span></li>

</ul>

<p><a href="https://git.reviewboard.kde.org/r/124747/diff/" style="margin-left: 3em;">View Diff</a></p>






  </td>
 </tr>
</table>







  </div>
 </body>
</html>