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 | 11 | ||||
-rw-r--r-- | net/bridge/br_sysfs_br.c | 2 | ||||
-rw-r--r-- | net/bridge/netfilter/ebt_log.c | 18 |
5 files changed, 26 insertions, 29 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 45f61c348e36..274194b78247 100644 --- a/net/bridge/br_netfilter.c +++ b/net/bridge/br_netfilter.c | |||
@@ -109,7 +109,6 @@ static struct dst_ops fake_dst_ops = { | |||
109 | .family = AF_INET, | 109 | .family = AF_INET, |
110 | .protocol = __constant_htons(ETH_P_IP), | 110 | .protocol = __constant_htons(ETH_P_IP), |
111 | .update_pmtu = fake_update_pmtu, | 111 | .update_pmtu = fake_update_pmtu, |
112 | .entry_size = sizeof(struct rtable), | ||
113 | .entries = ATOMIC_INIT(0), | 112 | .entries = ATOMIC_INIT(0), |
114 | }; | 113 | }; |
115 | 114 | ||
@@ -951,35 +950,35 @@ static ctl_table brnf_table[] = { | |||
951 | .data = &brnf_call_arptables, | 950 | .data = &brnf_call_arptables, |
952 | .maxlen = sizeof(int), | 951 | .maxlen = sizeof(int), |
953 | .mode = 0644, | 952 | .mode = 0644, |
954 | .proc_handler = &brnf_sysctl_call_tables, | 953 | .proc_handler = brnf_sysctl_call_tables, |
955 | }, | 954 | }, |
956 | { | 955 | { |
957 | .procname = "bridge-nf-call-iptables", | 956 | .procname = "bridge-nf-call-iptables", |
958 | .data = &brnf_call_iptables, | 957 | .data = &brnf_call_iptables, |
959 | .maxlen = sizeof(int), | 958 | .maxlen = sizeof(int), |
960 | .mode = 0644, | 959 | .mode = 0644, |
961 | .proc_handler = &brnf_sysctl_call_tables, | 960 | .proc_handler = brnf_sysctl_call_tables, |
962 | }, | 961 | }, |
963 | { | 962 | { |
964 | .procname = "bridge-nf-call-ip6tables", | 963 | .procname = "bridge-nf-call-ip6tables", |
965 | .data = &brnf_call_ip6tables, | 964 | .data = &brnf_call_ip6tables, |
966 | .maxlen = sizeof(int), | 965 | .maxlen = sizeof(int), |
967 | .mode = 0644, | 966 | .mode = 0644, |
968 | .proc_handler = &brnf_sysctl_call_tables, | 967 | .proc_handler = brnf_sysctl_call_tables, |
969 | }, | 968 | }, |
970 | { | 969 | { |
971 | .procname = "bridge-nf-filter-vlan-tagged", | 970 | .procname = "bridge-nf-filter-vlan-tagged", |
972 | .data = &brnf_filter_vlan_tagged, | 971 | .data = &brnf_filter_vlan_tagged, |
973 | .maxlen = sizeof(int), | 972 | .maxlen = sizeof(int), |
974 | .mode = 0644, | 973 | .mode = 0644, |
975 | .proc_handler = &brnf_sysctl_call_tables, | 974 | .proc_handler = brnf_sysctl_call_tables, |
976 | }, | 975 | }, |
977 | { | 976 | { |
978 | .procname = "bridge-nf-filter-pppoe-tagged", | 977 | .procname = "bridge-nf-filter-pppoe-tagged", |
979 | .data = &brnf_filter_pppoe_tagged, | 978 | .data = &brnf_filter_pppoe_tagged, |
980 | .maxlen = sizeof(int), | 979 | .maxlen = sizeof(int), |
981 | .mode = 0644, | 980 | .mode = 0644, |
982 | .proc_handler = &brnf_sysctl_call_tables, | 981 | .proc_handler = brnf_sysctl_call_tables, |
983 | }, | 982 | }, |
984 | { .ctl_name = 0 } | 983 | { .ctl_name = 0 } |
985 | }; | 984 | }; |
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. |
diff --git a/net/bridge/netfilter/ebt_log.c b/net/bridge/netfilter/ebt_log.c index 3d33c608906a..d44cbf8c374a 100644 --- a/net/bridge/netfilter/ebt_log.c +++ b/net/bridge/netfilter/ebt_log.c | |||
@@ -79,7 +79,6 @@ print_ports(const struct sk_buff *skb, uint8_t protocol, int offset) | |||
79 | } | 79 | } |
80 | } | 80 | } |
81 | 81 | ||
82 | #define myNIPQUAD(a) a[0], a[1], a[2], a[3] | ||
83 | static void | 82 | static void |
84 | ebt_log_packet(u_int8_t pf, unsigned int hooknum, | 83 | ebt_log_packet(u_int8_t pf, unsigned int hooknum, |
85 | const struct sk_buff *skb, const struct net_device *in, | 84 | const struct sk_buff *skb, const struct net_device *in, |
@@ -113,9 +112,8 @@ ebt_log_packet(u_int8_t pf, unsigned int hooknum, | |||
113 | printk(" INCOMPLETE IP header"); | 112 | printk(" INCOMPLETE IP header"); |
114 | goto out; | 113 | goto out; |
115 | } | 114 | } |
116 | printk(" IP SRC=%u.%u.%u.%u IP DST=%u.%u.%u.%u, IP " | 115 | printk(" IP SRC=%pI4 IP DST=%pI4, IP tos=0x%02X, IP proto=%d", |
117 | "tos=0x%02X, IP proto=%d", NIPQUAD(ih->saddr), | 116 | &ih->saddr, &ih->daddr, ih->tos, ih->protocol); |
118 | NIPQUAD(ih->daddr), ih->tos, ih->protocol); | ||
119 | print_ports(skb, ih->protocol, ih->ihl*4); | 117 | print_ports(skb, ih->protocol, ih->ihl*4); |
120 | goto out; | 118 | goto out; |
121 | } | 119 | } |
@@ -133,10 +131,8 @@ ebt_log_packet(u_int8_t pf, unsigned int hooknum, | |||
133 | printk(" INCOMPLETE IPv6 header"); | 131 | printk(" INCOMPLETE IPv6 header"); |
134 | goto out; | 132 | goto out; |
135 | } | 133 | } |
136 | printk(" IPv6 SRC=%x:%x:%x:%x:%x:%x:%x:%x " | 134 | printk(" IPv6 SRC=%pI6 IPv6 DST=%pI6, IPv6 priority=0x%01X, Next Header=%d", |
137 | "IPv6 DST=%x:%x:%x:%x:%x:%x:%x:%x, IPv6 " | 135 | &ih->saddr, &ih->daddr, ih->priority, ih->nexthdr); |
138 | "priority=0x%01X, Next Header=%d", NIP6(ih->saddr), | ||
139 | NIP6(ih->daddr), ih->priority, ih->nexthdr); | ||
140 | nexthdr = ih->nexthdr; | 136 | nexthdr = ih->nexthdr; |
141 | offset_ph = ipv6_skip_exthdr(skb, sizeof(_iph), &nexthdr); | 137 | offset_ph = ipv6_skip_exthdr(skb, sizeof(_iph), &nexthdr); |
142 | if (offset_ph == -1) | 138 | if (offset_ph == -1) |
@@ -177,12 +173,10 @@ ebt_log_packet(u_int8_t pf, unsigned int hooknum, | |||
177 | } | 173 | } |
178 | printk(" ARP MAC SRC="); | 174 | printk(" ARP MAC SRC="); |
179 | print_MAC(ap->mac_src); | 175 | print_MAC(ap->mac_src); |
180 | printk(" ARP IP SRC=%u.%u.%u.%u", | 176 | printk(" ARP IP SRC=%pI4", ap->ip_src); |
181 | myNIPQUAD(ap->ip_src)); | ||
182 | printk(" ARP MAC DST="); | 177 | printk(" ARP MAC DST="); |
183 | print_MAC(ap->mac_dst); | 178 | print_MAC(ap->mac_dst); |
184 | printk(" ARP IP DST=%u.%u.%u.%u", | 179 | printk(" ARP IP DST=%pI4", ap->ip_dst); |
185 | myNIPQUAD(ap->ip_dst)); | ||
186 | } | 180 | } |
187 | } | 181 | } |
188 | out: | 182 | out: |