|
@@ -103,12 +103,24 @@ int addrconf_prefix_rcv_add_addr(struct net *net, struct net_device *dev,
|
|
u32 addr_flags, bool sllao, bool tokenized,
|
|
u32 addr_flags, bool sllao, bool tokenized,
|
|
__u32 valid_lft, u32 prefered_lft);
|
|
__u32 valid_lft, u32 prefered_lft);
|
|
|
|
|
|
|
|
+static inline void addrconf_addr_eui48_base(u8 *eui, const char *const addr)
|
|
|
|
+{
|
|
|
|
+ memcpy(eui, addr, 3);
|
|
|
|
+ eui[3] = 0xFF;
|
|
|
|
+ eui[4] = 0xFE;
|
|
|
|
+ memcpy(eui + 5, addr + 3, 3);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static inline void addrconf_addr_eui48(u8 *eui, const char *const addr)
|
|
|
|
+{
|
|
|
|
+ addrconf_addr_eui48_base(eui, addr);
|
|
|
|
+ eui[0] ^= 2;
|
|
|
|
+}
|
|
|
|
+
|
|
static inline int addrconf_ifid_eui48(u8 *eui, struct net_device *dev)
|
|
static inline int addrconf_ifid_eui48(u8 *eui, struct net_device *dev)
|
|
{
|
|
{
|
|
if (dev->addr_len != ETH_ALEN)
|
|
if (dev->addr_len != ETH_ALEN)
|
|
return -1;
|
|
return -1;
|
|
- memcpy(eui, dev->dev_addr, 3);
|
|
|
|
- memcpy(eui + 5, dev->dev_addr + 3, 3);
|
|
|
|
|
|
|
|
/*
|
|
/*
|
|
* The zSeries OSA network cards can be shared among various
|
|
* The zSeries OSA network cards can be shared among various
|
|
@@ -123,14 +135,16 @@ static inline int addrconf_ifid_eui48(u8 *eui, struct net_device *dev)
|
|
* case. Hence the resulting interface identifier has local
|
|
* case. Hence the resulting interface identifier has local
|
|
* scope according to RFC2373.
|
|
* scope according to RFC2373.
|
|
*/
|
|
*/
|
|
|
|
+
|
|
|
|
+ addrconf_addr_eui48_base(eui, dev->dev_addr);
|
|
|
|
+
|
|
if (dev->dev_id) {
|
|
if (dev->dev_id) {
|
|
eui[3] = (dev->dev_id >> 8) & 0xFF;
|
|
eui[3] = (dev->dev_id >> 8) & 0xFF;
|
|
eui[4] = dev->dev_id & 0xFF;
|
|
eui[4] = dev->dev_id & 0xFF;
|
|
} else {
|
|
} else {
|
|
- eui[3] = 0xFF;
|
|
|
|
- eui[4] = 0xFE;
|
|
|
|
eui[0] ^= 2;
|
|
eui[0] ^= 2;
|
|
}
|
|
}
|
|
|
|
+
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|