OSDN Git Service

Merge git://git.kernel.org/pub/scm/linux/kernel/git/pkl/squashfs-linus
[android-x86/kernel.git] / net / bridge / br_netfilter.c
index 74ef4d4..3fa1231 100644 (file)
@@ -117,6 +117,10 @@ static struct dst_ops fake_dst_ops = {
  * ipt_REJECT needs it.  Future netfilter modules might
  * require us to fill additional fields.
  */
+static const u32 br_dst_default_metrics[RTAX_MAX] = {
+       [RTAX_MTU - 1] = 1500,
+};
+
 void br_netfilter_rtable_init(struct net_bridge *br)
 {
        struct rtable *rt = &br->fake_rtable;
@@ -124,7 +128,7 @@ void br_netfilter_rtable_init(struct net_bridge *br)
        atomic_set(&rt->dst.__refcnt, 1);
        rt->dst.dev = br->dev;
        rt->dst.path = &rt->dst;
-       dst_metric_set(&rt->dst, RTAX_MTU, 1500);
+       dst_init_metrics(&rt->dst, br_dst_default_metrics, true);
        rt->dst.flags   = DST_NOXFRM;
        rt->dst.ops = &fake_dst_ops;
 }
@@ -219,7 +223,7 @@ static inline void nf_bridge_update_protocol(struct sk_buff *skb)
 static int br_parse_ip_options(struct sk_buff *skb)
 {
        struct ip_options *opt;
-       struct iphdr *iph;
+       const struct iphdr *iph;
        struct net_device *dev = skb->dev;
        u32 len;
 
@@ -554,7 +558,7 @@ static unsigned int br_nf_pre_routing_ipv6(unsigned int hook,
                                           const struct net_device *out,
                                           int (*okfn)(struct sk_buff *))
 {
-       struct ipv6hdr *hdr;
+       const struct ipv6hdr *hdr;
        u32 pkt_len;
 
        if (skb->len < sizeof(struct ipv6hdr))