aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/addrconf.c
diff options
context:
space:
mode:
authorYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2008-04-10 02:42:09 -0400
committerYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2008-04-12 00:43:17 -0400
commitdfd982baff01c18e3e1717c97fdac79c28f105ce (patch)
tree70c7c7f90bbcb8b522030170cd73816c9d5ec72d /net/ipv6/addrconf.c
parent3eb84f49290461e2b83d6e8ee1f3f0e504340c8b (diff)
[IPV6] ADDRCONF: Uninline ipv6_isatap_eui64().
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Diffstat (limited to 'net/ipv6/addrconf.c')
-rw-r--r--net/ipv6/addrconf.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index b17fafc56241..d15f3e095e7e 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -1494,6 +1494,29 @@ static int addrconf_ifid_infiniband(u8 *eui, struct net_device *dev)
1494 return 0; 1494 return 0;
1495} 1495}
1496 1496
1497int __ipv6_isatap_ifid(u8 *eui, __be32 addr)
1498{
1499 eui[0] = (ipv4_is_zeronet(addr) || ipv4_is_private_10(addr) ||
1500 ipv4_is_loopback(addr) || ipv4_is_linklocal_169(addr) ||
1501 ipv4_is_private_172(addr) || ipv4_is_test_192(addr) ||
1502 ipv4_is_anycast_6to4(addr) || ipv4_is_private_192(addr) ||
1503 ipv4_is_test_198(addr) || ipv4_is_multicast(addr) ||
1504 ipv4_is_lbcast(addr)) ? 0x00 : 0x02;
1505 eui[1] = 0;
1506 eui[2] = 0x5E;
1507 eui[3] = 0xFE;
1508 memcpy(eui + 4, &addr, 4);
1509 return 0;
1510}
1511EXPORT_SYMBOL(__ipv6_isatap_ifid);
1512
1513static int addrconf_ifid_sit(u8 *eui, struct net_device *dev)
1514{
1515 if (dev->priv_flags & IFF_ISATAP)
1516 return __ipv6_isatap_ifid(eui, *(__be32 *)dev->dev_addr);
1517 return -1;
1518}
1519
1497static int ipv6_generate_eui64(u8 *eui, struct net_device *dev) 1520static int ipv6_generate_eui64(u8 *eui, struct net_device *dev)
1498{ 1521{
1499 switch (dev->type) { 1522 switch (dev->type) {
@@ -1506,8 +1529,7 @@ static int ipv6_generate_eui64(u8 *eui, struct net_device *dev)
1506 case ARPHRD_INFINIBAND: 1529 case ARPHRD_INFINIBAND:
1507 return addrconf_ifid_infiniband(eui, dev); 1530 return addrconf_ifid_infiniband(eui, dev);
1508 case ARPHRD_SIT: 1531 case ARPHRD_SIT:
1509 if (dev->priv_flags & IFF_ISATAP) 1532 return addrconf_ifid_sit(eui, dev);
1510 return ipv6_isatap_eui64(eui, *(__be32 *)dev->dev_addr);
1511 } 1533 }
1512 return -1; 1534 return -1;
1513} 1535}