Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 341871
b: refs/heads/master
c: adfa85e
h: refs/heads/master
i:
  341869: 4c71403
  341867: 95b00c7
  341863: 2d79aa3
  341855: 1649d9e
v: v3
  • Loading branch information
Nicolas Dichtel authored and David S. Miller committed Dec 4, 2012
1 parent 0b52fef commit c7752d9
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 70b386a0cc65041fb01aacf5d4b8d1fa49fc8ce9
refs/heads/master: adfa85e45dac616ff4f8bfceff1621ccafc0b1ff
7 changes: 7 additions & 0 deletions trunk/include/uapi/linux/rtnetlink.h
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ enum rtattr_type_t {
RTA_MP_ALGO, /* no longer used */
RTA_TABLE,
RTA_MARK,
RTA_MFC_STATS,
__RTA_MAX
};

Expand Down Expand Up @@ -408,6 +409,12 @@ struct rta_session {
} u;
};

struct rta_mfc_stats {
__u64 mfcs_packets;
__u64 mfcs_bytes;
__u64 mfcs_wrong_if;
};

/****
* General form of address family dependent message.
****/
Expand Down
7 changes: 7 additions & 0 deletions trunk/net/ipv4/ipmr.c
Original file line number Diff line number Diff line change
Expand Up @@ -2046,6 +2046,7 @@ static int __ipmr_fill_mroute(struct mr_table *mrt, struct sk_buff *skb,
int ct;
struct rtnexthop *nhp;
struct nlattr *mp_attr;
struct rta_mfc_stats mfcs;

/* If cache is unresolved, don't try to parse IIF and OIF */
if (c->mfc_parent >= MAXVIFS)
Expand Down Expand Up @@ -2074,6 +2075,12 @@ static int __ipmr_fill_mroute(struct mr_table *mrt, struct sk_buff *skb,

nla_nest_end(skb, mp_attr);

mfcs.mfcs_packets = c->mfc_un.res.pkt;
mfcs.mfcs_bytes = c->mfc_un.res.bytes;
mfcs.mfcs_wrong_if = c->mfc_un.res.wrong_if;
if (nla_put(skb, RTA_MFC_STATS, sizeof(mfcs), &mfcs) < 0)
return -EMSGSIZE;

rtm->rtm_type = RTN_MULTICAST;
return 1;
}
Expand Down
7 changes: 7 additions & 0 deletions trunk/net/ipv6/ip6mr.c
Original file line number Diff line number Diff line change
Expand Up @@ -2120,6 +2120,7 @@ static int __ip6mr_fill_mroute(struct mr6_table *mrt, struct sk_buff *skb,
int ct;
struct rtnexthop *nhp;
struct nlattr *mp_attr;
struct rta_mfc_stats mfcs;

/* If cache is unresolved, don't try to parse IIF and OIF */
if (c->mf6c_parent >= MAXMIFS)
Expand Down Expand Up @@ -2149,6 +2150,12 @@ static int __ip6mr_fill_mroute(struct mr6_table *mrt, struct sk_buff *skb,

nla_nest_end(skb, mp_attr);

mfcs.mfcs_packets = c->mfc_un.res.pkt;
mfcs.mfcs_bytes = c->mfc_un.res.bytes;
mfcs.mfcs_wrong_if = c->mfc_un.res.wrong_if;
if (nla_put(skb, RTA_MFC_STATS, sizeof(mfcs), &mfcs) < 0)
return -EMSGSIZE;

rtm->rtm_type = RTN_MULTICAST;
return 1;
}
Expand Down

0 comments on commit c7752d9

Please sign in to comment.