コード例 #1
0
ファイル: addrconf.c プロジェクト: hugh712/Jollen
static void addrconf_sit_config(struct net_device *dev)
{
	struct inet6_dev *idev;

	ASSERT_RTNL();

	/* 
	 * Configure the tunnel with one of our IPv4 
	 * addresses... we should configure all of 
	 * our v4 addrs in the tunnel
	 */

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

	sit_add_v4_addrs(idev);

	if (dev->flags&IFF_POINTOPOINT) {
		addrconf_add_mroute(dev);
		addrconf_add_lroute(dev);
	} else
		sit_route_add(dev);
}
コード例 #2
0
static void init_loopback(struct device *dev)
{
    struct in6_addr addr;
    struct inet6_dev  *idev;
    struct inet6_ifaddr * ifp;

    /* ::1 */

    memset(&addr, 0, sizeof(struct in6_addr));
    addr.s6_addr[15] = 1;

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

    ifp = ipv6_add_addr(idev, &addr, IFA_HOST);

    if (ifp == NULL) {
        printk(KERN_DEBUG "init_loopback: add_addr failed\n");
        return;
    }

    ifp->flags |= ADDR_PERMANENT;
    ifp->prefix_len = 128;

    ipv6_ifa_notify(RTM_NEWADDR, ifp);
}
コード例 #3
0
ファイル: addrconf.c プロジェクト: hugh712/Jollen
static void init_loopback(struct net_device *dev)
{
	struct in6_addr addr;
	struct inet6_dev  *idev;
	struct inet6_ifaddr * ifp;

	/* ::1 */

	ASSERT_RTNL();

	memset(&addr, 0, sizeof(struct in6_addr));
	addr.s6_addr[15] = 1;

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

	ifp = ipv6_add_addr(idev, &addr, 128, IFA_HOST, IFA_F_PERMANENT);
	if (ifp) {
		spin_lock_bh(&ifp->lock);
		ifp->flags &= ~IFA_F_TENTATIVE;
		spin_unlock_bh(&ifp->lock);
		ipv6_ifa_notify(RTM_NEWADDR, ifp);
		in6_ifa_put(ifp);
	}
}
コード例 #4
0
static struct inet6_dev *addrconf_add_dev(struct device *dev)
{
    struct inet6_dev *idev;

    if ((idev = ipv6_find_idev(dev)) == NULL)
        return NULL;

    /* Add default multicast route */
    addrconf_add_mroute(dev);

    /* Add link local route */
    addrconf_add_lroute(dev);
    return idev;
}