Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
authorLinus Torvalds <torvalds@woody.linux-foundation.org>
Mon, 14 May 2007 19:28:11 +0000 (12:28 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Mon, 14 May 2007 19:28:11 +0000 (12:28 -0700)
* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6:
  [IPV4] SNMP: Display new statistics at /proc/net/netstat
  [IPV6]: Reverse sense of promisc tests in ip6_mc_input
  [NET_SCHED]: prio qdisc boundary condition
  [IPSEC]: Don't warn if high-order hash resize fails
  [IPSEC]: Check validity of direction in xfrm_policy_byid

net/ipv4/proc.c
net/ipv6/ip6_input.c
net/sched/sch_prio.c
net/xfrm/xfrm_hash.c
net/xfrm/xfrm_policy.c

index 37ab5802ca0881e46b3d79388ed44bd56c584b8b..cdbc6c1358494c616d8146c9a23712ca6c92e308 100644 (file)
@@ -109,6 +109,17 @@ static const struct snmp_mib snmp4_ipstats_list[] = {
        SNMP_MIB_SENTINEL
 };
 
+/* Following RFC4293 items are displayed in /proc/net/netstat */
+static const struct snmp_mib snmp4_ipextstats_list[] = {
+       SNMP_MIB_ITEM("InNoRoutes", IPSTATS_MIB_INNOROUTES),
+       SNMP_MIB_ITEM("InTruncatedPkts", IPSTATS_MIB_INTRUNCATEDPKTS),
+       SNMP_MIB_ITEM("InMcastPkts", IPSTATS_MIB_INMCASTPKTS),
+       SNMP_MIB_ITEM("OutMcastPkts", IPSTATS_MIB_OUTMCASTPKTS),
+       SNMP_MIB_ITEM("InBcastPkts", IPSTATS_MIB_INBCASTPKTS),
+       SNMP_MIB_ITEM("OutBcastPkts", IPSTATS_MIB_OUTBCASTPKTS),
+       SNMP_MIB_SENTINEL
+};
+
 static const struct snmp_mib snmp4_icmp_list[] = {
        SNMP_MIB_ITEM("InMsgs", ICMP_MIB_INMSGS),
        SNMP_MIB_ITEM("InErrors", ICMP_MIB_INERRORS),
@@ -338,6 +349,16 @@ static int netstat_seq_show(struct seq_file *seq, void *v)
                           snmp_fold_field((void **)net_statistics,
                                           snmp4_net_list[i].entry));
 
+       seq_puts(seq, "\nIpExt:");
+       for (i = 0; snmp4_ipextstats_list[i].name != NULL; i++)
+               seq_printf(seq, " %s", snmp4_ipextstats_list[i].name);
+
+       seq_puts(seq, "\nIpExt:");
+       for (i = 0; snmp4_ipextstats_list[i].name != NULL; i++)
+               seq_printf(seq, " %lu",
+                          snmp_fold_field((void **)ip_statistics,
+                                          snmp4_ipextstats_list[i].entry));
+
        seq_putc(seq, '\n');
        return 0;
 }
index be0ee8a34f9bd379a3e23d53099299e8ff6beea5..30a5cb1b203e1e644c0e3182692b91549c9c9725 100644 (file)
@@ -235,7 +235,7 @@ int ip6_mc_input(struct sk_buff *skb)
        IP6_INC_STATS_BH(ip6_dst_idev(skb->dst), IPSTATS_MIB_INMCASTPKTS);
 
        hdr = ipv6_hdr(skb);
-       deliver = likely(!(skb->dev->flags & (IFF_PROMISC|IFF_ALLMULTI))) ||
+       deliver = unlikely(skb->dev->flags & (IFF_PROMISC|IFF_ALLMULTI)) ||
            ipv6_chk_mcast_addr(skb->dev, &hdr->daddr, NULL);
 
        /*
index 269a6e17c6c4ac65ea5d38c866bcabf5251beb96..6d7542c26e47a7ce3b63df2a07a0e797a0bc9e1b 100644 (file)
@@ -75,7 +75,7 @@ prio_classify(struct sk_buff *skb, struct Qdisc *sch, int *qerr)
                band = res.classid;
        }
        band = TC_H_MIN(band) - 1;
-       if (band > q->bands)
+       if (band >= q->bands)
                return q->queues[q->prio2band[0]];
 
        return q->queues[band];
index 37643bb8768a83fe6bea2bb40a007cc2a78ee503..55ab5792af56ecdfd2e5cafe0de0cd697246f475 100644 (file)
@@ -22,7 +22,8 @@ struct hlist_head *xfrm_hash_alloc(unsigned int sz)
                n = __vmalloc(sz, GFP_KERNEL, PAGE_KERNEL);
        else
                n = (struct hlist_head *)
-                       __get_free_pages(GFP_KERNEL, get_order(sz));
+                       __get_free_pages(GFP_KERNEL | __GFP_NOWARN,
+                                        get_order(sz));
 
        if (n)
                memset(n, 0, sz);
index 95271e8426a11e3c4f31b3447322fcc02cde34b3..d0882e53b6fced18c5a4f2ef4b87b38c2a0716c7 100644 (file)
@@ -796,6 +796,10 @@ struct xfrm_policy *xfrm_policy_byid(u8 type, int dir, u32 id, int delete,
        struct hlist_head *chain;
        struct hlist_node *entry;
 
+       *err = -ENOENT;
+       if (xfrm_policy_id2dir(id) != dir)
+               return NULL;
+
        *err = 0;
        write_lock_bh(&xfrm_policy_lock);
        chain = xfrm_policy_byidx + idx_hash(id);