]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - net/bridge/br_netfilter.c
net: use the macros defined for the members of flowi
[net-next-2.6.git] / net / bridge / br_netfilter.c
index 865fd7634b673d4233c8a6758e2426db55696514..6e13920939113b07e7ae1bbed452323e261865d2 100644 (file)
@@ -131,17 +131,18 @@ void br_netfilter_rtable_init(struct net_bridge *br)
 
 static inline struct rtable *bridge_parent_rtable(const struct net_device *dev)
 {
-       if (!br_port_exists(dev))
-               return NULL;
-       return &br_port_get_rcu(dev)->br->fake_rtable;
+       struct net_bridge_port *port;
+
+       port = br_port_get_rcu(dev);
+       return port ? &port->br->fake_rtable : NULL;
 }
 
 static inline struct net_device *bridge_parent(const struct net_device *dev)
 {
-       if (!br_port_exists(dev))
-               return NULL;
+       struct net_bridge_port *port;
 
-       return br_port_get_rcu(dev)->br->dev;
+       port = br_port_get_rcu(dev);
+       return port ? port->br->dev : NULL;
 }
 
 static inline struct nf_bridge_info *nf_bridge_alloc(struct sk_buff *skb)
@@ -412,13 +413,8 @@ static int br_nf_pre_routing_finish(struct sk_buff *skb)
        if (dnat_took_place(skb)) {
                if ((err = ip_route_input(skb, iph->daddr, iph->saddr, iph->tos, dev))) {
                        struct flowi fl = {
-                               .nl_u = {
-                                       .ip4_u = {
-                                                .daddr = iph->daddr,
-                                                .saddr = 0,
-                                                .tos = RT_TOS(iph->tos) },
-                               },
-                               .proto = 0,
+                               .fl4_dst = iph->daddr,
+                               .fl4_tos = RT_TOS(iph->tos),
                        };
                        struct in_device *in_dev = __in_dev_get_rcu(dev);