Hi,
the code you posted is wrong.
It's wrong now because it's wrong per-se, it's wrong because it's not right.
The above sentence was often said by one of my professors, just before making a student fail his exam.
The hidden meaning is that the sentence (or the code) could be "right", but not going the thing it was supposed to be doing. As a consequence, it's right, but it's also wrong.
What you get from your code its the MAC address, not the IP address... and the MAC address doesn't have a prefix.
The code you want is: