aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorMatan Barak <matanb@mellanox.com>2015-07-30 11:33:22 -0400
committerDoug Ledford <dledford@redhat.com>2015-08-30 18:08:49 -0400
commit399e6f95811bd36fb64b3d30cf8529d633884b4c (patch)
tree538932f48b22f09c157df97972c182d585088813 /net
parentd9f272c523db47a56a64942eb6f25361c400de66 (diff)
net/ipv6: Export addrconf_ifid_eui48
For loopback purposes, RoCE devices should have a default GID in the port GID table, even when the interface is down. In order to do so, we use the IPv6 link local address which would have been genenrated for the related Ethernet netdevice when it goes up as a default GID. addrconf_ifid_eui48 is used to gernerate this address, export it. Signed-off-by: Matan Barak <matanb@mellanox.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'net')
-rw-r--r--net/ipv6/addrconf.c31
1 files changed, 0 insertions, 31 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 21c2c818df3b..5b0c041323d7 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -1845,37 +1845,6 @@ static void addrconf_leave_anycast(struct inet6_ifaddr *ifp)
1845 __ipv6_dev_ac_dec(ifp->idev, &addr); 1845 __ipv6_dev_ac_dec(ifp->idev, &addr);
1846} 1846}
1847 1847
1848static int addrconf_ifid_eui48(u8 *eui, struct net_device *dev)
1849{
1850 if (dev->addr_len != ETH_ALEN)
1851 return -1;
1852 memcpy(eui, dev->dev_addr, 3);
1853 memcpy(eui + 5, dev->dev_addr + 3, 3);
1854
1855 /*
1856 * The zSeries OSA network cards can be shared among various
1857 * OS instances, but the OSA cards have only one MAC address.
1858 * This leads to duplicate address conflicts in conjunction
1859 * with IPv6 if more than one instance uses the same card.
1860 *
1861 * The driver for these cards can deliver a unique 16-bit
1862 * identifier for each instance sharing the same card. It is
1863 * placed instead of 0xFFFE in the interface identifier. The
1864 * "u" bit of the interface identifier is not inverted in this
1865 * case. Hence the resulting interface identifier has local
1866 * scope according to RFC2373.
1867 */
1868 if (dev->dev_id) {
1869 eui[3] = (dev->dev_id >> 8) & 0xFF;
1870 eui[4] = dev->dev_id & 0xFF;
1871 } else {
1872 eui[3] = 0xFF;
1873 eui[4] = 0xFE;
1874 eui[0] ^= 2;
1875 }
1876 return 0;
1877}
1878
1879static int addrconf_ifid_eui64(u8 *eui, struct net_device *dev) 1848static int addrconf_ifid_eui64(u8 *eui, struct net_device *dev)
1880{ 1849{
1881 if (dev->addr_len != IEEE802154_ADDR_LEN) 1850 if (dev->addr_len != IEEE802154_ADDR_LEN)