Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 314667
b: refs/heads/master
c: 92a395e
h: refs/heads/master
i:
  314665: df587c3
  314663: f70397f
v: v3
  • Loading branch information
Thomas Graf authored and David S. Miller committed Jun 27, 2012
1 parent f0e6a47 commit 00bce72
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 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: 6e277ed59a45544786f4c4643a69527138c24fc1
refs/heads/master: 92a395e52f0c97f38ff675d7c698404bfc812dc2
28 changes: 14 additions & 14 deletions trunk/net/ipv4/ipmr.c
Original file line number Diff line number Diff line change
Expand Up @@ -2006,37 +2006,37 @@ static int __ipmr_fill_mroute(struct mr_table *mrt, struct sk_buff *skb,
{
int ct;
struct rtnexthop *nhp;
u8 *b = skb_tail_pointer(skb);
struct rtattr *mp_head;
struct nlattr *mp_attr;

/* If cache is unresolved, don't try to parse IIF and OIF */
if (c->mfc_parent >= MAXVIFS)
return -ENOENT;

if (VIF_EXISTS(mrt, c->mfc_parent))
RTA_PUT(skb, RTA_IIF, 4, &mrt->vif_table[c->mfc_parent].dev->ifindex);
if (VIF_EXISTS(mrt, c->mfc_parent) &&
nla_put_u32(skb, RTA_IIF, mrt->vif_table[c->mfc_parent].dev->ifindex) < 0)
return -EMSGSIZE;

mp_head = (struct rtattr *)skb_put(skb, RTA_LENGTH(0));
if (!(mp_attr = nla_nest_start(skb, RTA_MULTIPATH)))
return -EMSGSIZE;

for (ct = c->mfc_un.res.minvif; ct < c->mfc_un.res.maxvif; ct++) {
if (VIF_EXISTS(mrt, ct) && c->mfc_un.res.ttls[ct] < 255) {
if (skb_tailroom(skb) < RTA_ALIGN(RTA_ALIGN(sizeof(*nhp)) + 4))
goto rtattr_failure;
nhp = (struct rtnexthop *)skb_put(skb, RTA_ALIGN(sizeof(*nhp)));
if (!(nhp = nla_reserve_nohdr(skb, sizeof(*nhp)))) {
nla_nest_cancel(skb, mp_attr);
return -EMSGSIZE;
}

nhp->rtnh_flags = 0;
nhp->rtnh_hops = c->mfc_un.res.ttls[ct];
nhp->rtnh_ifindex = mrt->vif_table[ct].dev->ifindex;
nhp->rtnh_len = sizeof(*nhp);
}
}
mp_head->rta_type = RTA_MULTIPATH;
mp_head->rta_len = skb_tail_pointer(skb) - (u8 *)mp_head;

nla_nest_end(skb, mp_attr);

rtm->rtm_type = RTN_MULTICAST;
return 1;

rtattr_failure:
nlmsg_trim(skb, b);
return -EMSGSIZE;
}

int ipmr_get_route(struct net *net, struct sk_buff *skb,
Expand Down

0 comments on commit 00bce72

Please sign in to comment.