Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 194550
b: refs/heads/master
c: 25239ce
h: refs/heads/master
v: v3
  • Loading branch information
Patrick McHardy committed Apr 26, 2010
1 parent 1f9e02a commit b8acee7
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 20 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3d0c9c4eb2dbdcc461be4084abd87a9a9e70f713
refs/heads/master: 25239cee7e8732dbdc9f5d324f1c22a3bdec1d1f
8 changes: 0 additions & 8 deletions trunk/include/linux/fib_rules.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,6 @@
/* try to find source address in routing lookups */
#define FIB_RULE_FIND_SADDR 0x00010000

/* fib_rules families. values up to 127 are reserved for real address
* families, values above 128 may be used arbitrarily.
*/
#define FIB_RULES_IPV4 AF_INET
#define FIB_RULES_IPV6 AF_INET6
#define FIB_RULES_DECNET AF_DECnet
#define FIB_RULES_IPMR 128

struct fib_rule_hdr {
__u8 family;
__u8 dst_len;
Expand Down
6 changes: 6 additions & 0 deletions trunk/include/linux/rtnetlink.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
#include <linux/if_addr.h>
#include <linux/neighbour.h>

/* rtnetlink families. Values up to 127 are reserved for real address
* families, values above 128 may be used arbitrarily.
*/
#define RTNL_FAMILY_IPMR 128
#define RTNL_FAMILY_MAX 128

/****
* Routing/neighbour discovery messages.
****/
Expand Down
14 changes: 7 additions & 7 deletions trunk/net/core/rtnetlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ int lockdep_rtnl_is_held(void)
EXPORT_SYMBOL(lockdep_rtnl_is_held);
#endif /* #ifdef CONFIG_PROVE_LOCKING */

static struct rtnl_link *rtnl_msg_handlers[NPROTO];
static struct rtnl_link *rtnl_msg_handlers[RTNL_FAMILY_MAX + 1];

static inline int rtm_msgindex(int msgtype)
{
Expand All @@ -118,7 +118,7 @@ static rtnl_doit_func rtnl_get_doit(int protocol, int msgindex)
{
struct rtnl_link *tab;

if (protocol < NPROTO)
if (protocol <= RTNL_FAMILY_MAX)
tab = rtnl_msg_handlers[protocol];
else
tab = NULL;
Expand All @@ -133,7 +133,7 @@ static rtnl_dumpit_func rtnl_get_dumpit(int protocol, int msgindex)
{
struct rtnl_link *tab;

if (protocol < NPROTO)
if (protocol <= RTNL_FAMILY_MAX)
tab = rtnl_msg_handlers[protocol];
else
tab = NULL;
Expand Down Expand Up @@ -167,7 +167,7 @@ int __rtnl_register(int protocol, int msgtype,
struct rtnl_link *tab;
int msgindex;

BUG_ON(protocol < 0 || protocol >= NPROTO);
BUG_ON(protocol < 0 || protocol > RTNL_FAMILY_MAX);
msgindex = rtm_msgindex(msgtype);

tab = rtnl_msg_handlers[protocol];
Expand Down Expand Up @@ -219,7 +219,7 @@ int rtnl_unregister(int protocol, int msgtype)
{
int msgindex;

BUG_ON(protocol < 0 || protocol >= NPROTO);
BUG_ON(protocol < 0 || protocol > RTNL_FAMILY_MAX);
msgindex = rtm_msgindex(msgtype);

if (rtnl_msg_handlers[protocol] == NULL)
Expand All @@ -241,7 +241,7 @@ EXPORT_SYMBOL_GPL(rtnl_unregister);
*/
void rtnl_unregister_all(int protocol)
{
BUG_ON(protocol < 0 || protocol >= NPROTO);
BUG_ON(protocol < 0 || protocol > RTNL_FAMILY_MAX);

kfree(rtnl_msg_handlers[protocol]);
rtnl_msg_handlers[protocol] = NULL;
Expand Down Expand Up @@ -1384,7 +1384,7 @@ static int rtnl_dump_all(struct sk_buff *skb, struct netlink_callback *cb)

if (s_idx == 0)
s_idx = 1;
for (idx = 1; idx < NPROTO; idx++) {
for (idx = 1; idx <= RTNL_FAMILY_MAX; idx++) {
int type = cb->nlh->nlmsg_type-RTM_BASE;
if (idx < s_idx || idx == PF_PACKET)
continue;
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/decnet/dn_rules.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ static void dn_fib_rule_flush_cache(struct fib_rules_ops *ops)
}

static const struct fib_rules_ops __net_initdata dn_fib_rules_ops_template = {
.family = FIB_RULES_DECNET,
.family = AF_DECnet,
.rule_size = sizeof(struct dn_fib_rule),
.addr_size = sizeof(u16),
.action = dn_fib_rule_action,
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/ipv4/fib_rules.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ static void fib4_rule_flush_cache(struct fib_rules_ops *ops)
}

static const struct fib_rules_ops __net_initdata fib4_rules_ops_template = {
.family = FIB_RULES_IPV4,
.family = AF_INET,
.rule_size = sizeof(struct fib4_rule),
.addr_size = sizeof(u32),
.action = fib4_rule_action,
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/ipv4/ipmr.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ static int ipmr_rule_fill(struct fib_rule *rule, struct sk_buff *skb,
}

static const struct fib_rules_ops __net_initdata ipmr_rules_ops_template = {
.family = FIB_RULES_IPMR,
.family = RTNL_FAMILY_IPMR,
.rule_size = sizeof(struct ipmr_rule),
.addr_size = sizeof(u32),
.action = ipmr_rule_action,
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/ipv6/fib6_rules.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ static size_t fib6_rule_nlmsg_payload(struct fib_rule *rule)
}

static const struct fib_rules_ops __net_initdata fib6_rules_ops_template = {
.family = FIB_RULES_IPV6,
.family = AF_INET6,
.rule_size = sizeof(struct fib6_rule),
.addr_size = sizeof(struct in6_addr),
.action = fib6_rule_action,
Expand Down

0 comments on commit b8acee7

Please sign in to comment.