Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 194054
b: refs/heads/master
c: 0f87b1d
h: refs/heads/master
v: v3
  • Loading branch information
Patrick McHardy authored and David S. Miller committed Apr 13, 2010
1 parent 59631d8 commit 139cf77
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 9 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: 28bb17268b92b0c568f2496e5e631008f9108409
refs/heads/master: 0f87b1dd01b51dc3c789f7a212656a4a87eee1bd
7 changes: 7 additions & 0 deletions trunk/include/linux/fib_rules.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@
/* 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

struct fib_rule_hdr {
__u8 family;
__u8 dst_len;
Expand Down
15 changes: 10 additions & 5 deletions trunk/net/core/rtnetlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,11 @@ static rtnl_doit_func rtnl_get_doit(int protocol, int msgindex)
{
struct rtnl_link *tab;

tab = rtnl_msg_handlers[protocol];
if (protocol < NPROTO)
tab = rtnl_msg_handlers[protocol];
else
tab = NULL;

if (tab == NULL || tab[msgindex].doit == NULL)
tab = rtnl_msg_handlers[PF_UNSPEC];

Expand All @@ -129,7 +133,11 @@ static rtnl_dumpit_func rtnl_get_dumpit(int protocol, int msgindex)
{
struct rtnl_link *tab;

tab = rtnl_msg_handlers[protocol];
if (protocol < NPROTO)
tab = rtnl_msg_handlers[protocol];
else
tab = NULL;

if (tab == NULL || tab[msgindex].dumpit == NULL)
tab = rtnl_msg_handlers[PF_UNSPEC];

Expand Down Expand Up @@ -1444,9 +1452,6 @@ static int rtnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
return 0;

family = ((struct rtgenmsg *)NLMSG_DATA(nlh))->rtgen_family;
if (family >= NPROTO)
return -EAFNOSUPPORT;

sz_idx = type>>2;
kind = type&3;

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 struct fib_rules_ops dn_fib_rules_ops_template = {
.family = AF_DECnet,
.family = FIB_RULES_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 struct fib_rules_ops fib4_rules_ops_template = {
.family = AF_INET,
.family = FIB_RULES_IPV4,
.rule_size = sizeof(struct fib4_rule),
.addr_size = sizeof(u32),
.action = fib4_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 struct fib_rules_ops fib6_rules_ops_template = {
.family = AF_INET6,
.family = FIB_RULES_IPV6,
.rule_size = sizeof(struct fib6_rule),
.addr_size = sizeof(struct in6_addr),
.action = fib6_rule_action,
Expand Down

0 comments on commit 139cf77

Please sign in to comment.