Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 255458
b: refs/heads/master
c: aee80b5
h: refs/heads/master
v: v3
  • Loading branch information
stephen hemminger authored and David S. Miller committed Jun 9, 2011
1 parent 91c9979 commit b6304e8
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8ef207d63f8ecc0eae41cded066dd0e0ee170edf
refs/heads/master: aee80b54b235d34d87b25dfbe32f0f0ffee1b544
35 changes: 35 additions & 0 deletions trunk/net/ipv6/addrconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1559,6 +1559,11 @@ static int addrconf_ifid_sit(u8 *eui, struct net_device *dev)
return -1;
}

static int addrconf_ifid_gre(u8 *eui, struct net_device *dev)
{
return __ipv6_isatap_ifid(eui, *(__be32 *)dev->dev_addr);
}

static int ipv6_generate_eui64(u8 *eui, struct net_device *dev)
{
switch (dev->type) {
Expand All @@ -1572,6 +1577,8 @@ static int ipv6_generate_eui64(u8 *eui, struct net_device *dev)
return addrconf_ifid_infiniband(eui, dev);
case ARPHRD_SIT:
return addrconf_ifid_sit(eui, dev);
case ARPHRD_IPGRE:
return addrconf_ifid_gre(eui, dev);
}
return -1;
}
Expand Down Expand Up @@ -2423,6 +2430,29 @@ static void addrconf_sit_config(struct net_device *dev)
}
#endif

#if defined(CONFIG_NET_IPGRE) || defined(CONFIG_NET_IPGRE_MODULE)
static void addrconf_gre_config(struct net_device *dev)
{
struct inet6_dev *idev;
struct in6_addr addr;

pr_info("ipv6: addrconf_gre_config(%s)\n", dev->name);

ASSERT_RTNL();

if ((idev = ipv6_find_idev(dev)) == NULL) {
printk(KERN_DEBUG "init gre: add_dev failed\n");
return;
}

ipv6_addr_set(&addr, htonl(0xFE800000), 0, 0, 0);
addrconf_prefix_route(&addr, 64, dev, 0, 0);

if (!ipv6_generate_eui64(addr.s6_addr + 8, dev))
addrconf_add_linklocal(idev, &addr);
}
#endif

static inline int
ipv6_inherit_linklocal(struct inet6_dev *idev, struct net_device *link_dev)
{
Expand Down Expand Up @@ -2538,6 +2568,11 @@ static int addrconf_notify(struct notifier_block *this, unsigned long event,
case ARPHRD_SIT:
addrconf_sit_config(dev);
break;
#endif
#if defined(CONFIG_NET_IPGRE) || defined(CONFIG_NET_IPGRE_MODULE)
case ARPHRD_IPGRE:
addrconf_gre_config(dev);
break;
#endif
case ARPHRD_TUNNEL6:
addrconf_ip6_tnl_config(dev);
Expand Down

0 comments on commit b6304e8

Please sign in to comment.