route.c (b8d3e4163a3562d7cba486687904383e78e7dd6a) route.c (c3a8d9474684d391b0afc3970d9b249add15ec07)
1/*
2 * Linux INET6 implementation
3 * FIB front-end.
4 *
5 * Authors:
6 * Pedro Roque <roque@di.fc.ul.pt>
7 *
8 * This program is free software; you can redistribute it and/or

--- 1684 unchanged lines hidden (view full) ---

1693out:
1694 net->ipv6.ip6_rt_gc_expire -= net->ipv6.ip6_rt_gc_expire>>rt_elasticity;
1695 return entries > rt_max_size;
1696}
1697
1698static int ip6_convert_metrics(struct mx6_config *mxc,
1699 const struct fib6_config *cfg)
1700{
1/*
2 * Linux INET6 implementation
3 * FIB front-end.
4 *
5 * Authors:
6 * Pedro Roque <roque@di.fc.ul.pt>
7 *
8 * This program is free software; you can redistribute it and/or

--- 1684 unchanged lines hidden (view full) ---

1693out:
1694 net->ipv6.ip6_rt_gc_expire -= net->ipv6.ip6_rt_gc_expire>>rt_elasticity;
1695 return entries > rt_max_size;
1696}
1697
1698static int ip6_convert_metrics(struct mx6_config *mxc,
1699 const struct fib6_config *cfg)
1700{
1701 bool ecn_ca = false;
1701 struct nlattr *nla;
1702 int remaining;
1703 u32 *mp;
1704
1705 if (!cfg->fc_mx)
1706 return 0;
1707
1708 mp = kzalloc(sizeof(u32) * RTAX_MAX, GFP_KERNEL);

--- 8 unchanged lines hidden (view full) ---

1717 continue;
1718 if (unlikely(type > RTAX_MAX))
1719 goto err;
1720
1721 if (type == RTAX_CC_ALGO) {
1722 char tmp[TCP_CA_NAME_MAX];
1723
1724 nla_strlcpy(tmp, nla, sizeof(tmp));
1702 struct nlattr *nla;
1703 int remaining;
1704 u32 *mp;
1705
1706 if (!cfg->fc_mx)
1707 return 0;
1708
1709 mp = kzalloc(sizeof(u32) * RTAX_MAX, GFP_KERNEL);

--- 8 unchanged lines hidden (view full) ---

1718 continue;
1719 if (unlikely(type > RTAX_MAX))
1720 goto err;
1721
1722 if (type == RTAX_CC_ALGO) {
1723 char tmp[TCP_CA_NAME_MAX];
1724
1725 nla_strlcpy(tmp, nla, sizeof(tmp));
1725 val = tcp_ca_get_key_by_name(tmp);
1726 val = tcp_ca_get_key_by_name(tmp, &ecn_ca);
1726 if (val == TCP_CA_UNSPEC)
1727 goto err;
1728 } else {
1729 val = nla_get_u32(nla);
1730 }
1731 if (type == RTAX_FEATURES && (val & ~RTAX_FEATURE_MASK))
1732 goto err;
1733
1734 mp[type - 1] = val;
1735 __set_bit(type - 1, mxc->mx_valid);
1736 }
1737
1727 if (val == TCP_CA_UNSPEC)
1728 goto err;
1729 } else {
1730 val = nla_get_u32(nla);
1731 }
1732 if (type == RTAX_FEATURES && (val & ~RTAX_FEATURE_MASK))
1733 goto err;
1734
1735 mp[type - 1] = val;
1736 __set_bit(type - 1, mxc->mx_valid);
1737 }
1738
1738 mxc->mx = mp;
1739 if (ecn_ca) {
1740 __set_bit(RTAX_FEATURES - 1, mxc->mx_valid);
1741 mp[RTAX_FEATURES - 1] |= DST_FEATURE_ECN_CA;
1742 }
1739
1743
1744 mxc->mx = mp;
1740 return 0;
1741 err:
1742 kfree(mp);
1743 return -EINVAL;
1744}
1745
1746int ip6_route_add(struct fib6_config *cfg)
1747{

--- 1863 unchanged lines hidden ---
1745 return 0;
1746 err:
1747 kfree(mp);
1748 return -EINVAL;
1749}
1750
1751int ip6_route_add(struct fib6_config *cfg)
1752{

--- 1863 unchanged lines hidden ---