]> err.no Git - linux-2.6/blobdiff - net/ipv4/fib_rules.c
[IPV6]: Don't redo xfrm_lookup for cached dst entries
[linux-2.6] / net / ipv4 / fib_rules.c
index 39d0aadb9a2a451c93f6b8f34fbf3c84e8e09542..0b298bbc1518139d4dec18e6a8ebed9eb99a020e 100644 (file)
@@ -367,13 +367,14 @@ static struct notifier_block fib_rules_notifier = {
 
 static __inline__ int inet_fill_rule(struct sk_buff *skb,
                                     struct fib_rule *r,
-                                    struct netlink_callback *cb)
+                                    struct netlink_callback *cb,
+                                    unsigned int flags)
 {
        struct rtmsg *rtm;
        struct nlmsghdr  *nlh;
        unsigned char    *b = skb->tail;
 
-       nlh = NLMSG_PUT(skb, NETLINK_CREDS(cb->skb)->pid, cb->nlh->nlmsg_seq, RTM_NEWRULE, sizeof(*rtm));
+       nlh = NLMSG_NEW_ANSWER(skb, cb, RTM_NEWRULE, sizeof(*rtm), flags);
        rtm = NLMSG_DATA(nlh);
        rtm->rtm_family = AF_INET;
        rtm->rtm_dst_len = r->r_dst_len;
@@ -422,7 +423,7 @@ int inet_dump_rules(struct sk_buff *skb, struct netlink_callback *cb)
        for (r=fib_rules, idx=0; r; r = r->r_next, idx++) {
                if (idx < s_idx)
                        continue;
-               if (inet_fill_rule(skb, r, cb) < 0)
+               if (inet_fill_rule(skb, r, cb, NLM_F_MULTI) < 0)
                        break;
        }
        read_unlock(&fib_rules_lock);