@@ -1559,6 +1559,11 @@ static int addrconf_ifid_sit(u8 *eui, struct net_device *dev)
1559
1559
return -1 ;
1560
1560
}
1561
1561
1562
+ static int addrconf_ifid_gre (u8 * eui , struct net_device * dev )
1563
+ {
1564
+ return __ipv6_isatap_ifid (eui , * (__be32 * )dev -> dev_addr );
1565
+ }
1566
+
1562
1567
static int ipv6_generate_eui64 (u8 * eui , struct net_device * dev )
1563
1568
{
1564
1569
switch (dev -> type ) {
@@ -1572,6 +1577,8 @@ static int ipv6_generate_eui64(u8 *eui, struct net_device *dev)
1572
1577
return addrconf_ifid_infiniband (eui , dev );
1573
1578
case ARPHRD_SIT :
1574
1579
return addrconf_ifid_sit (eui , dev );
1580
+ case ARPHRD_IPGRE :
1581
+ return addrconf_ifid_gre (eui , dev );
1575
1582
}
1576
1583
return -1 ;
1577
1584
}
@@ -2423,6 +2430,29 @@ static void addrconf_sit_config(struct net_device *dev)
2423
2430
}
2424
2431
#endif
2425
2432
2433
+ #if defined(CONFIG_NET_IPGRE ) || defined(CONFIG_NET_IPGRE_MODULE )
2434
+ static void addrconf_gre_config (struct net_device * dev )
2435
+ {
2436
+ struct inet6_dev * idev ;
2437
+ struct in6_addr addr ;
2438
+
2439
+ pr_info ("ipv6: addrconf_gre_config(%s)\n" , dev -> name );
2440
+
2441
+ ASSERT_RTNL ();
2442
+
2443
+ if ((idev = ipv6_find_idev (dev )) == NULL ) {
2444
+ printk (KERN_DEBUG "init gre: add_dev failed\n" );
2445
+ return ;
2446
+ }
2447
+
2448
+ ipv6_addr_set (& addr , htonl (0xFE800000 ), 0 , 0 , 0 );
2449
+ addrconf_prefix_route (& addr , 64 , dev , 0 , 0 );
2450
+
2451
+ if (!ipv6_generate_eui64 (addr .s6_addr + 8 , dev ))
2452
+ addrconf_add_linklocal (idev , & addr );
2453
+ }
2454
+ #endif
2455
+
2426
2456
static inline int
2427
2457
ipv6_inherit_linklocal (struct inet6_dev * idev , struct net_device * link_dev )
2428
2458
{
@@ -2538,6 +2568,11 @@ static int addrconf_notify(struct notifier_block *this, unsigned long event,
2538
2568
case ARPHRD_SIT :
2539
2569
addrconf_sit_config (dev );
2540
2570
break ;
2571
+ #endif
2572
+ #if defined(CONFIG_NET_IPGRE ) || defined(CONFIG_NET_IPGRE_MODULE )
2573
+ case ARPHRD_IPGRE :
2574
+ addrconf_gre_config (dev );
2575
+ break ;
2541
2576
#endif
2542
2577
case ARPHRD_TUNNEL6 :
2543
2578
addrconf_ip6_tnl_config (dev );
0 commit comments