projects
/
powerpc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[IPV4] SNMP: Support OutMcastPkts and OutBcastPkts
[powerpc.git]
/
net
/
ipv4
/
fib_semantics.c
diff --git
a/net/ipv4/fib_semantics.c
b/net/ipv4/fib_semantics.c
index
e63b8a9
..
406ea70
100644
(file)
--- a/
net/ipv4/fib_semantics.c
+++ b/
net/ipv4/fib_semantics.c
@@
-85,12
+85,12
@@
for (nhsel=0; nhsel < 1; nhsel++)
#define endfor_nexthops(fi) }
#define endfor_nexthops(fi) }
-static const struct
+static const struct
{
int error;
u8 scope;
{
int error;
u8 scope;
-} fib_props[RT
A
_MAX + 1] = {
-
{
+} fib_props[RT
N
_MAX + 1] = {
+ {
.error = 0,
.scope = RT_SCOPE_NOWHERE,
}, /* RTN_UNSPEC */
.error = 0,
.scope = RT_SCOPE_NOWHERE,
}, /* RTN_UNSPEC */
@@
-314,9
+314,12
@@
void rtmsg_fib(int event, __be32 key, struct fib_alias *fa,
err = fib_dump_info(skb, info->pid, seq, event, tb_id,
fa->fa_type, fa->fa_scope, key, dst_len,
fa->fa_tos, fa->fa_info, 0);
err = fib_dump_info(skb, info->pid, seq, event, tb_id,
fa->fa_type, fa->fa_scope, key, dst_len,
fa->fa_tos, fa->fa_info, 0);
- /* failure implies BUG in fib_nlmsg_size() */
- BUG_ON(err < 0);
-
+ if (err < 0) {
+ /* -EMSGSIZE implies BUG in fib_nlmsg_size() */
+ WARN_ON(err == -EMSGSIZE);
+ kfree_skb(skb);
+ goto errout;
+ }
err = rtnl_notify(skb, info->pid, RTNLGRP_IPV4_ROUTE,
info->nlh, GFP_KERNEL);
errout:
err = rtnl_notify(skb, info->pid, RTNLGRP_IPV4_ROUTE,
info->nlh, GFP_KERNEL);
errout:
@@
-436,7
+439,7
@@
int fib_nh_match(struct fib_config *cfg, struct fib_info *fi)
rtnh = cfg->fc_mp;
remaining = cfg->fc_mp_len;
rtnh = cfg->fc_mp;
remaining = cfg->fc_mp_len;
-
+
for_nexthops(fi) {
int attrlen;
for_nexthops(fi) {
int attrlen;
@@
-505,9
+508,9
@@
int fib_nh_match(struct fib_config *cfg, struct fib_info *fi)
Normally it looks as following.
{universe prefix} -> (gw, oif) [scope link]
Normally it looks as following.
{universe prefix} -> (gw, oif) [scope link]
-
|
+ |
|-> {link prefix} -> (gw, oif) [scope local]
|-> {link prefix} -> (gw, oif) [scope local]
- |
+ |
|-> {local prefix} (terminal node)
*/
|-> {local prefix} (terminal node)
*/
@@
-861,7
+864,7
@@
err_inval:
err = -EINVAL;
failure:
err = -EINVAL;
failure:
-
if (fi) {
+ if (fi) {
fi->fib_dead = 1;
free_fib_info(fi);
}
fi->fib_dead = 1;
free_fib_info(fi);
}
@@
-924,7
+927,7
@@
int fib_semantic_match(struct list_head *head, const struct flowi *flp,
default:
printk(KERN_DEBUG "impossible 102\n");
return -EINVAL;
default:
printk(KERN_DEBUG "impossible 102\n");
return -EINVAL;
- }
;
+ }
}
return err;
}
}
return err;
}
@@
-960,7
+963,7
@@
int fib_dump_info(struct sk_buff *skb, u32 pid, u32 seq, int event,
nlh = nlmsg_put(skb, pid, seq, event, sizeof(*rtm), flags);
if (nlh == NULL)
nlh = nlmsg_put(skb, pid, seq, event, sizeof(*rtm), flags);
if (nlh == NULL)
- return -E
NOBUFS
;
+ return -E
MSGSIZE
;
rtm = nlmsg_data(nlh);
rtm->rtm_family = AF_INET;
rtm = nlmsg_data(nlh);
rtm->rtm_family = AF_INET;
@@
-1031,7
+1034,8
@@
int fib_dump_info(struct sk_buff *skb, u32 pid, u32 seq, int event,
return nlmsg_end(skb, nlh);
nla_put_failure:
return nlmsg_end(skb, nlh);
nla_put_failure:
- return nlmsg_cancel(skb, nlh);
+ nlmsg_cancel(skb, nlh);
+ return -EMSGSIZE;
}
/*
}
/*
@@
-1045,7
+1049,7
@@
int fib_sync_down(__be32 local, struct net_device *dev, int force)
{
int ret = 0;
int scope = RT_SCOPE_NOWHERE;
{
int ret = 0;
int scope = RT_SCOPE_NOWHERE;
-
+
if (force)
scope = -1;
if (force)
scope = -1;