diff options
Diffstat (limited to 'net/bridge')
-rw-r--r-- | net/bridge/br_device.c | 20 | ||||
-rw-r--r-- | net/bridge/br_if.c | 4 | ||||
-rw-r--r-- | net/bridge/br_netfilter.c | 12 | ||||
-rw-r--r-- | net/bridge/br_sysfs_br.c | 2 |
4 files changed, 27 insertions, 11 deletions
diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c index 6c023f0f8252..18538d7460d7 100644 --- a/net/bridge/br_device.c +++ b/net/bridge/br_device.c | |||
@@ -147,7 +147,7 @@ static int br_set_tx_csum(struct net_device *dev, u32 data) | |||
147 | return 0; | 147 | return 0; |
148 | } | 148 | } |
149 | 149 | ||
150 | static struct ethtool_ops br_ethtool_ops = { | 150 | static const struct ethtool_ops br_ethtool_ops = { |
151 | .get_drvinfo = br_getinfo, | 151 | .get_drvinfo = br_getinfo, |
152 | .get_link = ethtool_op_get_link, | 152 | .get_link = ethtool_op_get_link, |
153 | .get_tx_csum = ethtool_op_get_tx_csum, | 153 | .get_tx_csum = ethtool_op_get_tx_csum, |
@@ -160,21 +160,25 @@ static struct ethtool_ops br_ethtool_ops = { | |||
160 | .get_flags = ethtool_op_get_flags, | 160 | .get_flags = ethtool_op_get_flags, |
161 | }; | 161 | }; |
162 | 162 | ||
163 | static const struct net_device_ops br_netdev_ops = { | ||
164 | .ndo_open = br_dev_open, | ||
165 | .ndo_stop = br_dev_stop, | ||
166 | .ndo_start_xmit = br_dev_xmit, | ||
167 | .ndo_set_mac_address = br_set_mac_address, | ||
168 | .ndo_set_multicast_list = br_dev_set_multicast_list, | ||
169 | .ndo_change_mtu = br_change_mtu, | ||
170 | .ndo_do_ioctl = br_dev_ioctl, | ||
171 | }; | ||
172 | |||
163 | void br_dev_setup(struct net_device *dev) | 173 | void br_dev_setup(struct net_device *dev) |
164 | { | 174 | { |
165 | random_ether_addr(dev->dev_addr); | 175 | random_ether_addr(dev->dev_addr); |
166 | ether_setup(dev); | 176 | ether_setup(dev); |
167 | 177 | ||
168 | dev->do_ioctl = br_dev_ioctl; | 178 | dev->netdev_ops = &br_netdev_ops; |
169 | dev->hard_start_xmit = br_dev_xmit; | ||
170 | dev->open = br_dev_open; | ||
171 | dev->set_multicast_list = br_dev_set_multicast_list; | ||
172 | dev->change_mtu = br_change_mtu; | ||
173 | dev->destructor = free_netdev; | 179 | dev->destructor = free_netdev; |
174 | SET_ETHTOOL_OPS(dev, &br_ethtool_ops); | 180 | SET_ETHTOOL_OPS(dev, &br_ethtool_ops); |
175 | dev->stop = br_dev_stop; | ||
176 | dev->tx_queue_len = 0; | 181 | dev->tx_queue_len = 0; |
177 | dev->set_mac_address = br_set_mac_address; | ||
178 | dev->priv_flags = IFF_EBRIDGE; | 182 | dev->priv_flags = IFF_EBRIDGE; |
179 | 183 | ||
180 | dev->features = NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_HIGHDMA | | 184 | dev->features = NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_HIGHDMA | |
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c index 0a09ccf68c1c..727c5c510a60 100644 --- a/net/bridge/br_if.c +++ b/net/bridge/br_if.c | |||
@@ -373,7 +373,7 @@ int br_add_if(struct net_bridge *br, struct net_device *dev) | |||
373 | if (dev->flags & IFF_LOOPBACK || dev->type != ARPHRD_ETHER) | 373 | if (dev->flags & IFF_LOOPBACK || dev->type != ARPHRD_ETHER) |
374 | return -EINVAL; | 374 | return -EINVAL; |
375 | 375 | ||
376 | if (dev->hard_start_xmit == br_dev_xmit) | 376 | if (dev->netdev_ops->ndo_start_xmit == br_dev_xmit) |
377 | return -ELOOP; | 377 | return -ELOOP; |
378 | 378 | ||
379 | if (dev->br_port != NULL) | 379 | if (dev->br_port != NULL) |
@@ -460,7 +460,7 @@ void br_net_exit(struct net *net) | |||
460 | restart: | 460 | restart: |
461 | for_each_netdev(net, dev) { | 461 | for_each_netdev(net, dev) { |
462 | if (dev->priv_flags & IFF_EBRIDGE) { | 462 | if (dev->priv_flags & IFF_EBRIDGE) { |
463 | del_br(dev->priv); | 463 | del_br(netdev_priv(dev)); |
464 | goto restart; | 464 | goto restart; |
465 | } | 465 | } |
466 | } | 466 | } |
diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c index bf9d6af9628a..a65e43a17fbb 100644 --- a/net/bridge/br_netfilter.c +++ b/net/bridge/br_netfilter.c | |||
@@ -101,6 +101,17 @@ static inline __be16 pppoe_proto(const struct sk_buff *skb) | |||
101 | pppoe_proto(skb) == htons(PPP_IPV6) && \ | 101 | pppoe_proto(skb) == htons(PPP_IPV6) && \ |
102 | brnf_filter_pppoe_tagged) | 102 | brnf_filter_pppoe_tagged) |
103 | 103 | ||
104 | static void fake_update_pmtu(struct dst_entry *dst, u32 mtu) | ||
105 | { | ||
106 | } | ||
107 | |||
108 | static struct dst_ops fake_dst_ops = { | ||
109 | .family = AF_INET, | ||
110 | .protocol = __constant_htons(ETH_P_IP), | ||
111 | .update_pmtu = fake_update_pmtu, | ||
112 | .entries = ATOMIC_INIT(0), | ||
113 | }; | ||
114 | |||
104 | /* | 115 | /* |
105 | * Initialize bogus route table used to keep netfilter happy. | 116 | * Initialize bogus route table used to keep netfilter happy. |
106 | * Currently, we fill in the PMTU entry because netfilter | 117 | * Currently, we fill in the PMTU entry because netfilter |
@@ -117,6 +128,7 @@ void br_netfilter_rtable_init(struct net_bridge *br) | |||
117 | rt->u.dst.path = &rt->u.dst; | 128 | rt->u.dst.path = &rt->u.dst; |
118 | rt->u.dst.metrics[RTAX_MTU - 1] = 1500; | 129 | rt->u.dst.metrics[RTAX_MTU - 1] = 1500; |
119 | rt->u.dst.flags = DST_NOXFRM; | 130 | rt->u.dst.flags = DST_NOXFRM; |
131 | rt->u.dst.ops = &fake_dst_ops; | ||
120 | } | 132 | } |
121 | 133 | ||
122 | static inline struct rtable *bridge_parent_rtable(const struct net_device *dev) | 134 | static inline struct rtable *bridge_parent_rtable(const struct net_device *dev) |
diff --git a/net/bridge/br_sysfs_br.c b/net/bridge/br_sysfs_br.c index 158dee8b4965..603d89248e71 100644 --- a/net/bridge/br_sysfs_br.c +++ b/net/bridge/br_sysfs_br.c | |||
@@ -22,7 +22,7 @@ | |||
22 | #include "br_private.h" | 22 | #include "br_private.h" |
23 | 23 | ||
24 | #define to_dev(obj) container_of(obj, struct device, kobj) | 24 | #define to_dev(obj) container_of(obj, struct device, kobj) |
25 | #define to_bridge(cd) ((struct net_bridge *)(to_net_dev(cd)->priv)) | 25 | #define to_bridge(cd) ((struct net_bridge *)netdev_priv(to_net_dev(cd))) |
26 | 26 | ||
27 | /* | 27 | /* |
28 | * Common code for storing bridge parameters. | 28 | * Common code for storing bridge parameters. |