aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/benet/be_cmds.c53
-rw-r--r--drivers/net/bonding/bond_3ad.c29
-rw-r--r--drivers/net/bonding/bond_3ad.h4
-rw-r--r--drivers/net/bonding/bond_alb.c46
-rw-r--r--drivers/net/bonding/bond_alb.h1
-rw-r--r--drivers/net/bonding/bond_main.c121
-rw-r--r--drivers/net/bonding/bond_sysfs.c6
-rw-r--r--drivers/net/bonding/bonding.h4
-rw-r--r--include/net/addrconf.h3
-rw-r--r--include/net/af_rxrpc.h3
-rw-r--r--include/net/af_unix.h2
-rw-r--r--include/net/atmclip.h2
-rw-r--r--include/net/bluetooth/hci.h2
-rw-r--r--include/net/dst.h3
-rw-r--r--include/net/if_inet6.h3
-rw-r--r--include/net/ip6_fib.h3
-rw-r--r--include/net/ip6_route.h3
-rw-r--r--include/net/ip_vs.h5
-rw-r--r--include/net/ipv6.h7
-rw-r--r--include/net/ipx.h2
-rw-r--r--include/net/ndisc.h6
-rw-r--r--include/net/netevent.h2
-rw-r--r--include/net/netfilter/nf_conntrack.h2
-rw-r--r--include/net/netfilter/nf_conntrack_tuple.h4
-rw-r--r--include/net/netfilter/nf_nat.h4
-rw-r--r--include/net/rawv6.h4
-rw-r--r--include/net/route.h4
-rw-r--r--include/net/transp_v6.h4
-rw-r--r--include/net/wimax.h5
-rw-r--r--net/core/dev.c24
30 files changed, 73 insertions, 288 deletions
diff --git a/drivers/net/benet/be_cmds.c b/drivers/net/benet/be_cmds.c
index af8cf3d7c1e3..0fc06d363806 100644
--- a/drivers/net/benet/be_cmds.c
+++ b/drivers/net/benet/be_cmds.c
@@ -1214,8 +1214,8 @@ int be_cmd_get_reg_len(struct be_adapter *adapter, u32 *log_size)
1214 if (!status) { 1214 if (!status) {
1215 struct be_cmd_resp_get_fat *resp = embedded_payload(wrb); 1215 struct be_cmd_resp_get_fat *resp = embedded_payload(wrb);
1216 if (log_size && resp->log_size) 1216 if (log_size && resp->log_size)
1217 *log_size = le32_to_cpu(resp->log_size - 1217 *log_size = le32_to_cpu(resp->log_size) -
1218 sizeof(u32)); 1218 sizeof(u32);
1219 } 1219 }
1220err: 1220err:
1221 spin_unlock_bh(&adapter->mcc_lock); 1221 spin_unlock_bh(&adapter->mcc_lock);
@@ -1228,7 +1228,8 @@ void be_cmd_get_regs(struct be_adapter *adapter, u32 buf_len, void *buf)
1228 struct be_mcc_wrb *wrb; 1228 struct be_mcc_wrb *wrb;
1229 struct be_cmd_req_get_fat *req; 1229 struct be_cmd_req_get_fat *req;
1230 struct be_sge *sge; 1230 struct be_sge *sge;
1231 u32 offset = 0, total_size, buf_size, log_offset = sizeof(u32); 1231 u32 offset = 0, total_size, buf_size,
1232 log_offset = sizeof(u32), payload_len;
1232 int status; 1233 int status;
1233 1234
1234 if (buf_len == 0) 1235 if (buf_len == 0)
@@ -1236,37 +1237,39 @@ void be_cmd_get_regs(struct be_adapter *adapter, u32 buf_len, void *buf)
1236 1237
1237 total_size = buf_len; 1238 total_size = buf_len;
1238 1239
1240 get_fat_cmd.size = sizeof(struct be_cmd_req_get_fat) + 60*1024;
1241 get_fat_cmd.va = pci_alloc_consistent(adapter->pdev,
1242 get_fat_cmd.size,
1243 &get_fat_cmd.dma);
1244 if (!get_fat_cmd.va) {
1245 status = -ENOMEM;
1246 dev_err(&adapter->pdev->dev,
1247 "Memory allocation failure while retrieving FAT data\n");
1248 return;
1249 }
1250
1239 spin_lock_bh(&adapter->mcc_lock); 1251 spin_lock_bh(&adapter->mcc_lock);
1240 1252
1241 wrb = wrb_from_mccq(adapter);
1242 if (!wrb) {
1243 status = -EBUSY;
1244 goto err;
1245 }
1246 while (total_size) { 1253 while (total_size) {
1247 buf_size = min(total_size, (u32)60*1024); 1254 buf_size = min(total_size, (u32)60*1024);
1248 total_size -= buf_size; 1255 total_size -= buf_size;
1249 1256
1250 get_fat_cmd.size = sizeof(struct be_cmd_req_get_fat) + buf_size; 1257 wrb = wrb_from_mccq(adapter);
1251 get_fat_cmd.va = pci_alloc_consistent(adapter->pdev, 1258 if (!wrb) {
1252 get_fat_cmd.size, 1259 status = -EBUSY;
1253 &get_fat_cmd.dma);
1254 if (!get_fat_cmd.va) {
1255 status = -ENOMEM;
1256 dev_err(&adapter->pdev->dev,
1257 "Memory allocation failure while retrieving FAT data\n");
1258 goto err; 1260 goto err;
1259 } 1261 }
1260 req = get_fat_cmd.va; 1262 req = get_fat_cmd.va;
1261 sge = nonembedded_sgl(wrb); 1263 sge = nonembedded_sgl(wrb);
1262 1264
1263 be_wrb_hdr_prepare(wrb, get_fat_cmd.size, false, 1, 1265 payload_len = sizeof(struct be_cmd_req_get_fat) + buf_size;
1266 be_wrb_hdr_prepare(wrb, payload_len, false, 1,
1264 OPCODE_COMMON_MANAGE_FAT); 1267 OPCODE_COMMON_MANAGE_FAT);
1265 1268
1266 be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON, 1269 be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON,
1267 OPCODE_COMMON_MANAGE_FAT, get_fat_cmd.size); 1270 OPCODE_COMMON_MANAGE_FAT, payload_len);
1268 1271
1269 sge->pa_hi = cpu_to_le32(upper_32_bits(get_fat_cmd.size)); 1272 sge->pa_hi = cpu_to_le32(upper_32_bits(get_fat_cmd.dma));
1270 sge->pa_lo = cpu_to_le32(get_fat_cmd.dma & 0xFFFFFFFF); 1273 sge->pa_lo = cpu_to_le32(get_fat_cmd.dma & 0xFFFFFFFF);
1271 sge->len = cpu_to_le32(get_fat_cmd.size); 1274 sge->len = cpu_to_le32(get_fat_cmd.size);
1272 1275
@@ -1281,17 +1284,17 @@ void be_cmd_get_regs(struct be_adapter *adapter, u32 buf_len, void *buf)
1281 memcpy(buf + offset, 1284 memcpy(buf + offset,
1282 resp->data_buffer, 1285 resp->data_buffer,
1283 resp->read_log_length); 1286 resp->read_log_length);
1284 } 1287 } else {
1285 pci_free_consistent(adapter->pdev, get_fat_cmd.size,
1286 get_fat_cmd.va,
1287 get_fat_cmd.dma);
1288 if (status)
1289 dev_err(&adapter->pdev->dev, "FAT Table Retrieve error\n"); 1288 dev_err(&adapter->pdev->dev, "FAT Table Retrieve error\n");
1290 1289 goto err;
1290 }
1291 offset += buf_size; 1291 offset += buf_size;
1292 log_offset += buf_size; 1292 log_offset += buf_size;
1293 } 1293 }
1294err: 1294err:
1295 pci_free_consistent(adapter->pdev, get_fat_cmd.size,
1296 get_fat_cmd.va,
1297 get_fat_cmd.dma);
1295 spin_unlock_bh(&adapter->mcc_lock); 1298 spin_unlock_bh(&adapter->mcc_lock);
1296} 1299}
1297 1300
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
index 123dd602261f..d0981c2ffbda 100644
--- a/drivers/net/bonding/bond_3ad.c
+++ b/drivers/net/bonding/bond_3ad.c
@@ -2465,35 +2465,16 @@ out:
2465 return NETDEV_TX_OK; 2465 return NETDEV_TX_OK;
2466} 2466}
2467 2467
2468int bond_3ad_lacpdu_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type* ptype, struct net_device *orig_dev) 2468void bond_3ad_lacpdu_recv(struct sk_buff *skb, struct bonding *bond,
2469 struct slave *slave)
2469{ 2470{
2470 struct bonding *bond = netdev_priv(dev); 2471 if (skb->protocol != PKT_TYPE_LACPDU)
2471 struct slave *slave = NULL; 2472 return;
2472 int ret = NET_RX_DROP;
2473
2474 if (!(dev->flags & IFF_MASTER))
2475 goto out;
2476
2477 skb = skb_share_check(skb, GFP_ATOMIC);
2478 if (!skb)
2479 goto out;
2480 2473
2481 if (!pskb_may_pull(skb, sizeof(struct lacpdu))) 2474 if (!pskb_may_pull(skb, sizeof(struct lacpdu)))
2482 goto out; 2475 return;
2483 2476
2484 read_lock(&bond->lock); 2477 read_lock(&bond->lock);
2485 slave = bond_get_slave_by_dev(netdev_priv(dev), orig_dev);
2486 if (!slave)
2487 goto out_unlock;
2488
2489 bond_3ad_rx_indication((struct lacpdu *) skb->data, slave, skb->len); 2478 bond_3ad_rx_indication((struct lacpdu *) skb->data, slave, skb->len);
2490
2491 ret = NET_RX_SUCCESS;
2492
2493out_unlock:
2494 read_unlock(&bond->lock); 2479 read_unlock(&bond->lock);
2495out:
2496 dev_kfree_skb(skb);
2497
2498 return ret;
2499} 2480}
diff --git a/drivers/net/bonding/bond_3ad.h b/drivers/net/bonding/bond_3ad.h
index b28baff70864..291dbd4d1f3d 100644
--- a/drivers/net/bonding/bond_3ad.h
+++ b/drivers/net/bonding/bond_3ad.h
@@ -258,7 +258,6 @@ struct ad_bond_info {
258 * requested 258 * requested
259 */ 259 */
260 struct timer_list ad_timer; 260 struct timer_list ad_timer;
261 struct packet_type ad_pkt_type;
262}; 261};
263 262
264struct ad_slave_info { 263struct ad_slave_info {
@@ -280,7 +279,8 @@ void bond_3ad_adapter_duplex_changed(struct slave *slave);
280void bond_3ad_handle_link_change(struct slave *slave, char link); 279void bond_3ad_handle_link_change(struct slave *slave, char link);
281int bond_3ad_get_active_agg_info(struct bonding *bond, struct ad_info *ad_info); 280int bond_3ad_get_active_agg_info(struct bonding *bond, struct ad_info *ad_info);
282int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev); 281int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev);
283int bond_3ad_lacpdu_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type* ptype, struct net_device *orig_dev); 282void bond_3ad_lacpdu_recv(struct sk_buff *skb, struct bonding *bond,
283 struct slave *slave);
284int bond_3ad_set_carrier(struct bonding *bond); 284int bond_3ad_set_carrier(struct bonding *bond);
285#endif //__BOND_3AD_H__ 285#endif //__BOND_3AD_H__
286 286
diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
index ba715826e2a8..3b7b0409406f 100644
--- a/drivers/net/bonding/bond_alb.c
+++ b/drivers/net/bonding/bond_alb.c
@@ -308,49 +308,33 @@ static void rlb_update_entry_from_arp(struct bonding *bond, struct arp_pkt *arp)
308 _unlock_rx_hashtbl(bond); 308 _unlock_rx_hashtbl(bond);
309} 309}
310 310
311static int rlb_arp_recv(struct sk_buff *skb, struct net_device *bond_dev, struct packet_type *ptype, struct net_device *orig_dev) 311static void rlb_arp_recv(struct sk_buff *skb, struct bonding *bond,
312 struct slave *slave)
312{ 313{
313 struct bonding *bond; 314 struct arp_pkt *arp;
314 struct arp_pkt *arp = (struct arp_pkt *)skb->data;
315 int res = NET_RX_DROP;
316 315
317 while (bond_dev->priv_flags & IFF_802_1Q_VLAN) 316 if (skb->protocol != cpu_to_be16(ETH_P_ARP))
318 bond_dev = vlan_dev_real_dev(bond_dev); 317 return;
319
320 if (!(bond_dev->priv_flags & IFF_BONDING) ||
321 !(bond_dev->flags & IFF_MASTER))
322 goto out;
323 318
319 arp = (struct arp_pkt *) skb->data;
324 if (!arp) { 320 if (!arp) {
325 pr_debug("Packet has no ARP data\n"); 321 pr_debug("Packet has no ARP data\n");
326 goto out; 322 return;
327 } 323 }
328 324
329 skb = skb_share_check(skb, GFP_ATOMIC); 325 if (!pskb_may_pull(skb, arp_hdr_len(bond->dev)))
330 if (!skb) 326 return;
331 goto out;
332
333 if (!pskb_may_pull(skb, arp_hdr_len(bond_dev)))
334 goto out;
335 327
336 if (skb->len < sizeof(struct arp_pkt)) { 328 if (skb->len < sizeof(struct arp_pkt)) {
337 pr_debug("Packet is too small to be an ARP\n"); 329 pr_debug("Packet is too small to be an ARP\n");
338 goto out; 330 return;
339 } 331 }
340 332
341 if (arp->op_code == htons(ARPOP_REPLY)) { 333 if (arp->op_code == htons(ARPOP_REPLY)) {
342 /* update rx hash table for this ARP */ 334 /* update rx hash table for this ARP */
343 bond = netdev_priv(bond_dev);
344 rlb_update_entry_from_arp(bond, arp); 335 rlb_update_entry_from_arp(bond, arp);
345 pr_debug("Server received an ARP Reply from client\n"); 336 pr_debug("Server received an ARP Reply from client\n");
346 } 337 }
347
348 res = NET_RX_SUCCESS;
349
350out:
351 dev_kfree_skb(skb);
352
353 return res;
354} 338}
355 339
356/* Caller must hold bond lock for read */ 340/* Caller must hold bond lock for read */
@@ -759,7 +743,6 @@ static void rlb_init_table_entry(struct rlb_client_info *entry)
759static int rlb_initialize(struct bonding *bond) 743static int rlb_initialize(struct bonding *bond)
760{ 744{
761 struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond)); 745 struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond));
762 struct packet_type *pk_type = &(BOND_ALB_INFO(bond).rlb_pkt_type);
763 struct rlb_client_info *new_hashtbl; 746 struct rlb_client_info *new_hashtbl;
764 int size = RLB_HASH_TABLE_SIZE * sizeof(struct rlb_client_info); 747 int size = RLB_HASH_TABLE_SIZE * sizeof(struct rlb_client_info);
765 int i; 748 int i;
@@ -784,13 +767,8 @@ static int rlb_initialize(struct bonding *bond)
784 767
785 _unlock_rx_hashtbl(bond); 768 _unlock_rx_hashtbl(bond);
786 769
787 /*initialize packet type*/
788 pk_type->type = cpu_to_be16(ETH_P_ARP);
789 pk_type->dev = bond->dev;
790 pk_type->func = rlb_arp_recv;
791
792 /* register to receive ARPs */ 770 /* register to receive ARPs */
793 dev_add_pack(pk_type); 771 bond->recv_probe = rlb_arp_recv;
794 772
795 return 0; 773 return 0;
796} 774}
@@ -799,8 +777,6 @@ static void rlb_deinitialize(struct bonding *bond)
799{ 777{
800 struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond)); 778 struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond));
801 779
802 dev_remove_pack(&(bond_info->rlb_pkt_type));
803
804 _lock_rx_hashtbl(bond); 780 _lock_rx_hashtbl(bond);
805 781
806 kfree(bond_info->rx_hashtbl); 782 kfree(bond_info->rx_hashtbl);
diff --git a/drivers/net/bonding/bond_alb.h b/drivers/net/bonding/bond_alb.h
index 8ca7158b2dda..90f140a2d197 100644
--- a/drivers/net/bonding/bond_alb.h
+++ b/drivers/net/bonding/bond_alb.h
@@ -129,7 +129,6 @@ struct alb_bond_info {
129 int lp_counter; 129 int lp_counter;
130 /* -------- rlb parameters -------- */ 130 /* -------- rlb parameters -------- */
131 int rlb_enabled; 131 int rlb_enabled;
132 struct packet_type rlb_pkt_type;
133 struct rlb_client_info *rx_hashtbl; /* Receive hash table */ 132 struct rlb_client_info *rx_hashtbl; /* Receive hash table */
134 spinlock_t rx_hashtbl_lock; 133 spinlock_t rx_hashtbl_lock;
135 u32 rx_hashtbl_head; 134 u32 rx_hashtbl_head;
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 4ce14bdf96dd..66d9dc6e5cac 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1439,27 +1439,17 @@ static void bond_setup_by_slave(struct net_device *bond_dev,
1439} 1439}
1440 1440
1441/* On bonding slaves other than the currently active slave, suppress 1441/* On bonding slaves other than the currently active slave, suppress
1442 * duplicates except for 802.3ad ETH_P_SLOW, alb non-mcast/bcast, and 1442 * duplicates except for alb non-mcast/bcast.
1443 * ARP on active-backup slaves with arp_validate enabled.
1444 */ 1443 */
1445static bool bond_should_deliver_exact_match(struct sk_buff *skb, 1444static bool bond_should_deliver_exact_match(struct sk_buff *skb,
1446 struct slave *slave, 1445 struct slave *slave,
1447 struct bonding *bond) 1446 struct bonding *bond)
1448{ 1447{
1449 if (bond_is_slave_inactive(slave)) { 1448 if (bond_is_slave_inactive(slave)) {
1450 if (slave_do_arp_validate(bond, slave) &&
1451 skb->protocol == __cpu_to_be16(ETH_P_ARP))
1452 return false;
1453
1454 if (bond->params.mode == BOND_MODE_ALB && 1449 if (bond->params.mode == BOND_MODE_ALB &&
1455 skb->pkt_type != PACKET_BROADCAST && 1450 skb->pkt_type != PACKET_BROADCAST &&
1456 skb->pkt_type != PACKET_MULTICAST) 1451 skb->pkt_type != PACKET_MULTICAST)
1457 return false;
1458
1459 if (bond->params.mode == BOND_MODE_8023AD &&
1460 skb->protocol == __cpu_to_be16(ETH_P_SLOW))
1461 return false; 1452 return false;
1462
1463 return true; 1453 return true;
1464 } 1454 }
1465 return false; 1455 return false;
@@ -1483,6 +1473,15 @@ static rx_handler_result_t bond_handle_frame(struct sk_buff **pskb)
1483 if (bond->params.arp_interval) 1473 if (bond->params.arp_interval)
1484 slave->dev->last_rx = jiffies; 1474 slave->dev->last_rx = jiffies;
1485 1475
1476 if (bond->recv_probe) {
1477 struct sk_buff *nskb = skb_clone(skb, GFP_ATOMIC);
1478
1479 if (likely(nskb)) {
1480 bond->recv_probe(nskb, bond, slave);
1481 dev_kfree_skb(nskb);
1482 }
1483 }
1484
1486 if (bond_should_deliver_exact_match(skb, slave, bond)) { 1485 if (bond_should_deliver_exact_match(skb, slave, bond)) {
1487 return RX_HANDLER_EXACT; 1486 return RX_HANDLER_EXACT;
1488 } 1487 }
@@ -2743,48 +2742,26 @@ static void bond_validate_arp(struct bonding *bond, struct slave *slave, __be32
2743 } 2742 }
2744} 2743}
2745 2744
2746static int bond_arp_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev) 2745static void bond_arp_rcv(struct sk_buff *skb, struct bonding *bond,
2746 struct slave *slave)
2747{ 2747{
2748 struct arphdr *arp; 2748 struct arphdr *arp;
2749 struct slave *slave;
2750 struct bonding *bond;
2751 unsigned char *arp_ptr; 2749 unsigned char *arp_ptr;
2752 __be32 sip, tip; 2750 __be32 sip, tip;
2753 2751
2754 if (dev->priv_flags & IFF_802_1Q_VLAN) { 2752 if (skb->protocol != __cpu_to_be16(ETH_P_ARP))
2755 /* 2753 return;
2756 * When using VLANS and bonding, dev and oriv_dev may be
2757 * incorrect if the physical interface supports VLAN
2758 * acceleration. With this change ARP validation now
2759 * works for hosts only reachable on the VLAN interface.
2760 */
2761 dev = vlan_dev_real_dev(dev);
2762 orig_dev = dev_get_by_index_rcu(dev_net(skb->dev),skb->skb_iif);
2763 }
2764
2765 if (!(dev->priv_flags & IFF_BONDING) || !(dev->flags & IFF_MASTER))
2766 goto out;
2767 2754
2768 bond = netdev_priv(dev);
2769 read_lock(&bond->lock); 2755 read_lock(&bond->lock);
2770 2756
2771 pr_debug("bond_arp_rcv: bond %s skb->dev %s orig_dev %s\n", 2757 pr_debug("bond_arp_rcv: bond %s skb->dev %s\n",
2772 bond->dev->name, skb->dev ? skb->dev->name : "NULL", 2758 bond->dev->name, skb->dev->name);
2773 orig_dev ? orig_dev->name : "NULL");
2774 2759
2775 slave = bond_get_slave_by_dev(bond, orig_dev); 2760 if (!pskb_may_pull(skb, arp_hdr_len(bond->dev)))
2776 if (!slave || !slave_do_arp_validate(bond, slave))
2777 goto out_unlock;
2778
2779 skb = skb_share_check(skb, GFP_ATOMIC);
2780 if (!skb)
2781 goto out_unlock;
2782
2783 if (!pskb_may_pull(skb, arp_hdr_len(dev)))
2784 goto out_unlock; 2761 goto out_unlock;
2785 2762
2786 arp = arp_hdr(skb); 2763 arp = arp_hdr(skb);
2787 if (arp->ar_hln != dev->addr_len || 2764 if (arp->ar_hln != bond->dev->addr_len ||
2788 skb->pkt_type == PACKET_OTHERHOST || 2765 skb->pkt_type == PACKET_OTHERHOST ||
2789 skb->pkt_type == PACKET_LOOPBACK || 2766 skb->pkt_type == PACKET_LOOPBACK ||
2790 arp->ar_hrd != htons(ARPHRD_ETHER) || 2767 arp->ar_hrd != htons(ARPHRD_ETHER) ||
@@ -2793,9 +2770,9 @@ static int bond_arp_rcv(struct sk_buff *skb, struct net_device *dev, struct pack
2793 goto out_unlock; 2770 goto out_unlock;
2794 2771
2795 arp_ptr = (unsigned char *)(arp + 1); 2772 arp_ptr = (unsigned char *)(arp + 1);
2796 arp_ptr += dev->addr_len; 2773 arp_ptr += bond->dev->addr_len;
2797 memcpy(&sip, arp_ptr, 4); 2774 memcpy(&sip, arp_ptr, 4);
2798 arp_ptr += 4 + dev->addr_len; 2775 arp_ptr += 4 + bond->dev->addr_len;
2799 memcpy(&tip, arp_ptr, 4); 2776 memcpy(&tip, arp_ptr, 4);
2800 2777
2801 pr_debug("bond_arp_rcv: %s %s/%d av %d sv %d sip %pI4 tip %pI4\n", 2778 pr_debug("bond_arp_rcv: %s %s/%d av %d sv %d sip %pI4 tip %pI4\n",
@@ -2818,9 +2795,6 @@ static int bond_arp_rcv(struct sk_buff *skb, struct net_device *dev, struct pack
2818 2795
2819out_unlock: 2796out_unlock:
2820 read_unlock(&bond->lock); 2797 read_unlock(&bond->lock);
2821out:
2822 dev_kfree_skb(skb);
2823 return NET_RX_SUCCESS;
2824} 2798}
2825 2799
2826/* 2800/*
@@ -3407,48 +3381,6 @@ static struct notifier_block bond_inetaddr_notifier = {
3407 .notifier_call = bond_inetaddr_event, 3381 .notifier_call = bond_inetaddr_event,
3408}; 3382};
3409 3383
3410/*-------------------------- Packet type handling ---------------------------*/
3411
3412/* register to receive lacpdus on a bond */
3413static void bond_register_lacpdu(struct bonding *bond)
3414{
3415 struct packet_type *pk_type = &(BOND_AD_INFO(bond).ad_pkt_type);
3416
3417 /* initialize packet type */
3418 pk_type->type = PKT_TYPE_LACPDU;
3419 pk_type->dev = bond->dev;
3420 pk_type->func = bond_3ad_lacpdu_recv;
3421
3422 dev_add_pack(pk_type);
3423}
3424
3425/* unregister to receive lacpdus on a bond */
3426static void bond_unregister_lacpdu(struct bonding *bond)
3427{
3428 dev_remove_pack(&(BOND_AD_INFO(bond).ad_pkt_type));
3429}
3430
3431void bond_register_arp(struct bonding *bond)
3432{
3433 struct packet_type *pt = &bond->arp_mon_pt;
3434
3435 if (pt->type)
3436 return;
3437
3438 pt->type = htons(ETH_P_ARP);
3439 pt->dev = bond->dev;
3440 pt->func = bond_arp_rcv;
3441 dev_add_pack(pt);
3442}
3443
3444void bond_unregister_arp(struct bonding *bond)
3445{
3446 struct packet_type *pt = &bond->arp_mon_pt;
3447
3448 dev_remove_pack(pt);
3449 pt->type = 0;
3450}
3451
3452/*---------------------------- Hashing Policies -----------------------------*/ 3384/*---------------------------- Hashing Policies -----------------------------*/
3453 3385
3454/* 3386/*
@@ -3542,14 +3474,14 @@ static int bond_open(struct net_device *bond_dev)
3542 3474
3543 queue_delayed_work(bond->wq, &bond->arp_work, 0); 3475 queue_delayed_work(bond->wq, &bond->arp_work, 0);
3544 if (bond->params.arp_validate) 3476 if (bond->params.arp_validate)
3545 bond_register_arp(bond); 3477 bond->recv_probe = bond_arp_rcv;
3546 } 3478 }
3547 3479
3548 if (bond->params.mode == BOND_MODE_8023AD) { 3480 if (bond->params.mode == BOND_MODE_8023AD) {
3549 INIT_DELAYED_WORK(&bond->ad_work, bond_3ad_state_machine_handler); 3481 INIT_DELAYED_WORK(&bond->ad_work, bond_3ad_state_machine_handler);
3550 queue_delayed_work(bond->wq, &bond->ad_work, 0); 3482 queue_delayed_work(bond->wq, &bond->ad_work, 0);
3551 /* register to receive LACPDUs */ 3483 /* register to receive LACPDUs */
3552 bond_register_lacpdu(bond); 3484 bond->recv_probe = bond_3ad_lacpdu_recv;
3553 bond_3ad_initiate_agg_selection(bond, 1); 3485 bond_3ad_initiate_agg_selection(bond, 1);
3554 } 3486 }
3555 3487
@@ -3560,14 +3492,6 @@ static int bond_close(struct net_device *bond_dev)
3560{ 3492{
3561 struct bonding *bond = netdev_priv(bond_dev); 3493 struct bonding *bond = netdev_priv(bond_dev);
3562 3494
3563 if (bond->params.mode == BOND_MODE_8023AD) {
3564 /* Unregister the receive of LACPDUs */
3565 bond_unregister_lacpdu(bond);
3566 }
3567
3568 if (bond->params.arp_validate)
3569 bond_unregister_arp(bond);
3570
3571 write_lock_bh(&bond->lock); 3495 write_lock_bh(&bond->lock);
3572 3496
3573 /* signal timers not to re-arm */ 3497 /* signal timers not to re-arm */
@@ -3604,6 +3528,7 @@ static int bond_close(struct net_device *bond_dev)
3604 */ 3528 */
3605 bond_alb_deinitialize(bond); 3529 bond_alb_deinitialize(bond);
3606 } 3530 }
3531 bond->recv_probe = NULL;
3607 3532
3608 return 0; 3533 return 0;
3609} 3534}
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
index 259ff32cd573..935406aa5f0c 100644
--- a/drivers/net/bonding/bond_sysfs.c
+++ b/drivers/net/bonding/bond_sysfs.c
@@ -422,11 +422,6 @@ static ssize_t bonding_store_arp_validate(struct device *d,
422 bond->dev->name, arp_validate_tbl[new_value].modename, 422 bond->dev->name, arp_validate_tbl[new_value].modename,
423 new_value); 423 new_value);
424 424
425 if (!bond->params.arp_validate && new_value)
426 bond_register_arp(bond);
427 else if (bond->params.arp_validate && !new_value)
428 bond_unregister_arp(bond);
429
430 bond->params.arp_validate = new_value; 425 bond->params.arp_validate = new_value;
431 426
432 return count; 427 return count;
@@ -923,7 +918,6 @@ static ssize_t bonding_store_miimon(struct device *d,
923 bond->dev->name); 918 bond->dev->name);
924 bond->params.arp_interval = 0; 919 bond->params.arp_interval = 0;
925 if (bond->params.arp_validate) { 920 if (bond->params.arp_validate) {
926 bond_unregister_arp(bond);
927 bond->params.arp_validate = 921 bond->params.arp_validate =
928 BOND_ARP_VALIDATE_NONE; 922 BOND_ARP_VALIDATE_NONE;
929 } 923 }
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h
index 6126c6a13a74..85fb8220e283 100644
--- a/drivers/net/bonding/bonding.h
+++ b/drivers/net/bonding/bonding.h
@@ -226,6 +226,8 @@ struct bonding {
226 struct slave *primary_slave; 226 struct slave *primary_slave;
227 bool force_primary; 227 bool force_primary;
228 s32 slave_cnt; /* never change this value outside the attach/detach wrappers */ 228 s32 slave_cnt; /* never change this value outside the attach/detach wrappers */
229 void (*recv_probe)(struct sk_buff *, struct bonding *,
230 struct slave *);
229 rwlock_t lock; 231 rwlock_t lock;
230 rwlock_t curr_slave_lock; 232 rwlock_t curr_slave_lock;
231 s8 kill_timers; 233 s8 kill_timers;
@@ -399,8 +401,6 @@ void bond_set_mode_ops(struct bonding *bond, int mode);
399int bond_parse_parm(const char *mode_arg, const struct bond_parm_tbl *tbl); 401int bond_parse_parm(const char *mode_arg, const struct bond_parm_tbl *tbl);
400void bond_select_active_slave(struct bonding *bond); 402void bond_select_active_slave(struct bonding *bond);
401void bond_change_active_slave(struct bonding *bond, struct slave *new_active); 403void bond_change_active_slave(struct bonding *bond, struct slave *new_active);
402void bond_register_arp(struct bonding *);
403void bond_unregister_arp(struct bonding *);
404void bond_create_debugfs(void); 404void bond_create_debugfs(void);
405void bond_destroy_debugfs(void); 405void bond_destroy_debugfs(void);
406void bond_debug_register(struct bonding *bond); 406void bond_debug_register(struct bonding *bond);
diff --git a/include/net/addrconf.h b/include/net/addrconf.h
index 7c4d92c0dd1d..582e4ae70753 100644
--- a/include/net/addrconf.h
+++ b/include/net/addrconf.h
@@ -42,8 +42,6 @@ struct prefix_info {
42}; 42};
43 43
44 44
45#ifdef __KERNEL__
46
47#include <linux/netdevice.h> 45#include <linux/netdevice.h>
48#include <net/if_inet6.h> 46#include <net/if_inet6.h>
49#include <net/ipv6.h> 47#include <net/ipv6.h>
@@ -285,4 +283,3 @@ extern void if6_proc_exit(void);
285#endif 283#endif
286 284
287#endif 285#endif
288#endif
diff --git a/include/net/af_rxrpc.h b/include/net/af_rxrpc.h
index 00c2eaa07c25..03e6e9453623 100644
--- a/include/net/af_rxrpc.h
+++ b/include/net/af_rxrpc.h
@@ -12,8 +12,6 @@
12#ifndef _NET_RXRPC_H 12#ifndef _NET_RXRPC_H
13#define _NET_RXRPC_H 13#define _NET_RXRPC_H
14 14
15#ifdef __KERNEL__
16
17#include <linux/rxrpc.h> 15#include <linux/rxrpc.h>
18 16
19struct rxrpc_call; 17struct rxrpc_call;
@@ -53,5 +51,4 @@ extern struct rxrpc_call *rxrpc_kernel_accept_call(struct socket *,
53 unsigned long); 51 unsigned long);
54extern int rxrpc_kernel_reject_call(struct socket *); 52extern int rxrpc_kernel_reject_call(struct socket *);
55 53
56#endif /* __KERNEL__ */
57#endif /* _NET_RXRPC_H */ 54#endif /* _NET_RXRPC_H */
diff --git a/include/net/af_unix.h b/include/net/af_unix.h
index 18e5c3f67580..91ab5b01678a 100644
--- a/include/net/af_unix.h
+++ b/include/net/af_unix.h
@@ -41,7 +41,6 @@ struct unix_skb_parms {
41 spin_lock_nested(&unix_sk(s)->lock, \ 41 spin_lock_nested(&unix_sk(s)->lock, \
42 SINGLE_DEPTH_NESTING) 42 SINGLE_DEPTH_NESTING)
43 43
44#ifdef __KERNEL__
45/* The AF_UNIX socket */ 44/* The AF_UNIX socket */
46struct unix_sock { 45struct unix_sock {
47 /* WARNING: sk has to be the first member */ 46 /* WARNING: sk has to be the first member */
@@ -72,4 +71,3 @@ static inline int unix_sysctl_register(struct net *net) { return 0; }
72static inline void unix_sysctl_unregister(struct net *net) {} 71static inline void unix_sysctl_unregister(struct net *net) {}
73#endif 72#endif
74#endif 73#endif
75#endif
diff --git a/include/net/atmclip.h b/include/net/atmclip.h
index 467c531b8a7e..497ef6444a7a 100644
--- a/include/net/atmclip.h
+++ b/include/net/atmclip.h
@@ -54,8 +54,6 @@ struct clip_priv {
54}; 54};
55 55
56 56
57#ifdef __KERNEL__
58extern struct neigh_table *clip_tbl_hook; 57extern struct neigh_table *clip_tbl_hook;
59#endif
60 58
61#endif 59#endif
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index 6138e313d175..499b7b7c7c9a 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -1067,7 +1067,6 @@ struct hci_sco_hdr {
1067 __u8 dlen; 1067 __u8 dlen;
1068} __packed; 1068} __packed;
1069 1069
1070#ifdef __KERNEL__
1071#include <linux/skbuff.h> 1070#include <linux/skbuff.h>
1072static inline struct hci_event_hdr *hci_event_hdr(const struct sk_buff *skb) 1071static inline struct hci_event_hdr *hci_event_hdr(const struct sk_buff *skb)
1073{ 1072{
@@ -1083,7 +1082,6 @@ static inline struct hci_sco_hdr *hci_sco_hdr(const struct sk_buff *skb)
1083{ 1082{
1084 return (struct hci_sco_hdr *) skb->data; 1083 return (struct hci_sco_hdr *) skb->data;
1085} 1084}
1086#endif
1087 1085
1088/* Command opcode pack/unpack */ 1086/* Command opcode pack/unpack */
1089#define hci_opcode_pack(ogf, ocf) (__u16) ((ocf & 0x03ff)|(ogf << 10)) 1087#define hci_opcode_pack(ogf, ocf) (__u16) ((ocf & 0x03ff)|(ogf << 10))
diff --git a/include/net/dst.h b/include/net/dst.h
index 75b95df4afe7..d7bb74062df1 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -92,8 +92,6 @@ struct dst_entry {
92 }; 92 };
93}; 93};
94 94
95#ifdef __KERNEL__
96
97extern u32 *dst_cow_metrics_generic(struct dst_entry *dst, unsigned long old); 95extern u32 *dst_cow_metrics_generic(struct dst_entry *dst, unsigned long old);
98extern const u32 dst_default_metrics[RTAX_MAX]; 96extern const u32 dst_default_metrics[RTAX_MAX];
99 97
@@ -438,6 +436,5 @@ extern struct dst_entry *xfrm_lookup(struct net *net, struct dst_entry *dst_orig
438 const struct flowi *fl, struct sock *sk, 436 const struct flowi *fl, struct sock *sk,
439 int flags); 437 int flags);
440#endif 438#endif
441#endif
442 439
443#endif /* _NET_DST_H */ 440#endif /* _NET_DST_H */
diff --git a/include/net/if_inet6.h b/include/net/if_inet6.h
index 3d982f72d48e..0c603fe65377 100644
--- a/include/net/if_inet6.h
+++ b/include/net/if_inet6.h
@@ -30,8 +30,6 @@
30#define IF_PREFIX_ONLINK 0x01 30#define IF_PREFIX_ONLINK 0x01
31#define IF_PREFIX_AUTOCONF 0x02 31#define IF_PREFIX_AUTOCONF 0x02
32 32
33#ifdef __KERNEL__
34
35enum { 33enum {
36 INET6_IFADDR_STATE_DAD, 34 INET6_IFADDR_STATE_DAD,
37 INET6_IFADDR_STATE_POSTDAD, 35 INET6_IFADDR_STATE_POSTDAD,
@@ -303,4 +301,3 @@ static inline int ipv6_ipgre_mc_map(const struct in6_addr *addr,
303} 301}
304 302
305#endif 303#endif
306#endif
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h
index aca8ef4dd67c..477ef75f3873 100644
--- a/include/net/ip6_fib.h
+++ b/include/net/ip6_fib.h
@@ -13,8 +13,6 @@
13#ifndef _IP6_FIB_H 13#ifndef _IP6_FIB_H
14#define _IP6_FIB_H 14#define _IP6_FIB_H
15 15
16#ifdef __KERNEL__
17
18#include <linux/ipv6_route.h> 16#include <linux/ipv6_route.h>
19#include <linux/rtnetlink.h> 17#include <linux/rtnetlink.h>
20#include <linux/spinlock.h> 18#include <linux/spinlock.h>
@@ -240,4 +238,3 @@ static inline void fib6_rules_cleanup(void)
240} 238}
241#endif 239#endif
242#endif 240#endif
243#endif
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h
index d5c21d4d9e7e..5e91b72fc718 100644
--- a/include/net/ip6_route.h
+++ b/include/net/ip6_route.h
@@ -21,8 +21,6 @@ struct route_info {
21 __u8 prefix[0]; /* 0,8 or 16 */ 21 __u8 prefix[0]; /* 0,8 or 16 */
22}; 22};
23 23
24#ifdef __KERNEL__
25
26#include <net/flow.h> 24#include <net/flow.h>
27#include <net/ip6_fib.h> 25#include <net/ip6_fib.h>
28#include <net/sock.h> 26#include <net/sock.h>
@@ -193,4 +191,3 @@ static inline int ip6_skb_dst_mtu(struct sk_buff *skb)
193} 191}
194 192
195#endif 193#endif
196#endif
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index d516f00c8e0f..e0b7f139aa88 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -8,9 +8,6 @@
8 8
9#include <linux/ip_vs.h> /* definitions shared with userland */ 9#include <linux/ip_vs.h> /* definitions shared with userland */
10 10
11/* old ipvsadm versions still include this file directly */
12#ifdef __KERNEL__
13
14#include <asm/types.h> /* for __uXX types */ 11#include <asm/types.h> /* for __uXX types */
15 12
16#include <linux/sysctl.h> /* for ctl_path */ 13#include <linux/sysctl.h> /* for ctl_path */
@@ -1415,6 +1412,4 @@ ip_vs_dest_conn_overhead(struct ip_vs_dest *dest)
1415 atomic_read(&dest->inactconns); 1412 atomic_read(&dest->inactconns);
1416} 1413}
1417 1414
1418#endif /* __KERNEL__ */
1419
1420#endif /* _NET_IP_VS_H */ 1415#endif /* _NET_IP_VS_H */
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index 5da192653153..e1c60b43e73b 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -77,11 +77,9 @@
77/* 77/*
78 * Addr scopes 78 * Addr scopes
79 */ 79 */
80#ifdef __KERNEL__
81#define IPV6_ADDR_MC_SCOPE(a) \ 80#define IPV6_ADDR_MC_SCOPE(a) \
82 ((a)->s6_addr[1] & 0x0f) /* nonstandard */ 81 ((a)->s6_addr[1] & 0x0f) /* nonstandard */
83#define __IPV6_ADDR_SCOPE_INVALID -1 82#define __IPV6_ADDR_SCOPE_INVALID -1
84#endif
85#define IPV6_ADDR_SCOPE_NODELOCAL 0x01 83#define IPV6_ADDR_SCOPE_NODELOCAL 0x01
86#define IPV6_ADDR_SCOPE_LINKLOCAL 0x02 84#define IPV6_ADDR_SCOPE_LINKLOCAL 0x02
87#define IPV6_ADDR_SCOPE_SITELOCAL 0x05 85#define IPV6_ADDR_SCOPE_SITELOCAL 0x05
@@ -91,14 +89,12 @@
91/* 89/*
92 * Addr flags 90 * Addr flags
93 */ 91 */
94#ifdef __KERNEL__
95#define IPV6_ADDR_MC_FLAG_TRANSIENT(a) \ 92#define IPV6_ADDR_MC_FLAG_TRANSIENT(a) \
96 ((a)->s6_addr[1] & 0x10) 93 ((a)->s6_addr[1] & 0x10)
97#define IPV6_ADDR_MC_FLAG_PREFIX(a) \ 94#define IPV6_ADDR_MC_FLAG_PREFIX(a) \
98 ((a)->s6_addr[1] & 0x20) 95 ((a)->s6_addr[1] & 0x20)
99#define IPV6_ADDR_MC_FLAG_RENDEZVOUS(a) \ 96#define IPV6_ADDR_MC_FLAG_RENDEZVOUS(a) \
100 ((a)->s6_addr[1] & 0x40) 97 ((a)->s6_addr[1] & 0x40)
101#endif
102 98
103/* 99/*
104 * fragmentation header 100 * fragmentation header
@@ -113,8 +109,6 @@ struct frag_hdr {
113 109
114#define IP6_MF 0x0001 110#define IP6_MF 0x0001
115 111
116#ifdef __KERNEL__
117
118#include <net/sock.h> 112#include <net/sock.h>
119 113
120/* sysctls */ 114/* sysctls */
@@ -667,5 +661,4 @@ extern int ipv6_static_sysctl_register(void);
667extern void ipv6_static_sysctl_unregister(void); 661extern void ipv6_static_sysctl_unregister(void);
668#endif 662#endif
669 663
670#endif /* __KERNEL__ */
671#endif /* _NET_IPV6_H */ 664#endif /* _NET_IPV6_H */
diff --git a/include/net/ipx.h b/include/net/ipx.h
index 05d7e4a88b49..c1fec6b464cc 100644
--- a/include/net/ipx.h
+++ b/include/net/ipx.h
@@ -80,7 +80,6 @@ struct ipx_route {
80 atomic_t refcnt; 80 atomic_t refcnt;
81}; 81};
82 82
83#ifdef __KERNEL__
84struct ipx_cb { 83struct ipx_cb {
85 u8 ipx_tctrl; 84 u8 ipx_tctrl;
86 __be32 ipx_dest_net; 85 __be32 ipx_dest_net;
@@ -116,7 +115,6 @@ static inline struct ipx_sock *ipx_sk(struct sock *sk)
116} 115}
117 116
118#define IPX_SKB_CB(__skb) ((struct ipx_cb *)&((__skb)->cb[0])) 117#define IPX_SKB_CB(__skb) ((struct ipx_cb *)&((__skb)->cb[0]))
119#endif
120 118
121#define IPX_MIN_EPHEMERAL_SOCKET 0x4000 119#define IPX_MIN_EPHEMERAL_SOCKET 0x4000
122#define IPX_MAX_EPHEMERAL_SOCKET 0x7fff 120#define IPX_MAX_EPHEMERAL_SOCKET 0x7fff
diff --git a/include/net/ndisc.h b/include/net/ndisc.h
index 6144685d601b..62beeb97c4b1 100644
--- a/include/net/ndisc.h
+++ b/include/net/ndisc.h
@@ -42,8 +42,6 @@ enum {
42#define ND_REACHABLE_TIME (30*HZ) 42#define ND_REACHABLE_TIME (30*HZ)
43#define ND_RETRANS_TIMER HZ 43#define ND_RETRANS_TIMER HZ
44 44
45#ifdef __KERNEL__
46
47#include <linux/compiler.h> 45#include <linux/compiler.h>
48#include <linux/icmpv6.h> 46#include <linux/icmpv6.h>
49#include <linux/in6.h> 47#include <linux/in6.h>
@@ -156,8 +154,4 @@ static inline struct neighbour * ndisc_get_neigh(struct net_device *dev, const s
156 return ERR_PTR(-ENODEV); 154 return ERR_PTR(-ENODEV);
157} 155}
158 156
159
160#endif /* __KERNEL__ */
161
162
163#endif 157#endif
diff --git a/include/net/netevent.h b/include/net/netevent.h
index 22b239c17eaa..086f8a5b59dc 100644
--- a/include/net/netevent.h
+++ b/include/net/netevent.h
@@ -10,7 +10,6 @@
10 * 10 *
11 * Changes: 11 * Changes:
12 */ 12 */
13#ifdef __KERNEL__
14 13
15struct dst_entry; 14struct dst_entry;
16 15
@@ -29,4 +28,3 @@ extern int unregister_netevent_notifier(struct notifier_block *nb);
29extern int call_netevent_notifiers(unsigned long val, void *v); 28extern int call_netevent_notifiers(unsigned long val, void *v);
30 29
31#endif 30#endif
32#endif
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h
index d0d13378991e..c7c42e7acc31 100644
--- a/include/net/netfilter/nf_conntrack.h
+++ b/include/net/netfilter/nf_conntrack.h
@@ -14,7 +14,6 @@
14 14
15#include <linux/netfilter/nf_conntrack_common.h> 15#include <linux/netfilter/nf_conntrack_common.h>
16 16
17#ifdef __KERNEL__
18#include <linux/bitops.h> 17#include <linux/bitops.h>
19#include <linux/compiler.h> 18#include <linux/compiler.h>
20#include <asm/atomic.h> 19#include <asm/atomic.h>
@@ -326,5 +325,4 @@ do { \
326#define MODULE_ALIAS_NFCT_HELPER(helper) \ 325#define MODULE_ALIAS_NFCT_HELPER(helper) \
327 MODULE_ALIAS("nfct-helper-" helper) 326 MODULE_ALIAS("nfct-helper-" helper)
328 327
329#endif /* __KERNEL__ */
330#endif /* _NF_CONNTRACK_H */ 328#endif /* _NF_CONNTRACK_H */
diff --git a/include/net/netfilter/nf_conntrack_tuple.h b/include/net/netfilter/nf_conntrack_tuple.h
index 4ee44c84a304..7ca6bdd5bae6 100644
--- a/include/net/netfilter/nf_conntrack_tuple.h
+++ b/include/net/netfilter/nf_conntrack_tuple.h
@@ -104,8 +104,6 @@ struct nf_conntrack_tuple_mask {
104 } src; 104 } src;
105}; 105};
106 106
107#ifdef __KERNEL__
108
109static inline void nf_ct_dump_tuple_ip(const struct nf_conntrack_tuple *t) 107static inline void nf_ct_dump_tuple_ip(const struct nf_conntrack_tuple *t)
110{ 108{
111#ifdef DEBUG 109#ifdef DEBUG
@@ -148,8 +146,6 @@ struct nf_conntrack_tuple_hash {
148 struct nf_conntrack_tuple tuple; 146 struct nf_conntrack_tuple tuple;
149}; 147};
150 148
151#endif /* __KERNEL__ */
152
153static inline bool __nf_ct_tuple_src_equal(const struct nf_conntrack_tuple *t1, 149static inline bool __nf_ct_tuple_src_equal(const struct nf_conntrack_tuple *t1,
154 const struct nf_conntrack_tuple *t2) 150 const struct nf_conntrack_tuple *t2)
155{ 151{
diff --git a/include/net/netfilter/nf_nat.h b/include/net/netfilter/nf_nat.h
index aff80b190c12..0346b0070864 100644
--- a/include/net/netfilter/nf_nat.h
+++ b/include/net/netfilter/nf_nat.h
@@ -48,7 +48,6 @@ struct nf_nat_multi_range_compat {
48 struct nf_nat_range range[1]; 48 struct nf_nat_range range[1];
49}; 49};
50 50
51#ifdef __KERNEL__
52#include <linux/list.h> 51#include <linux/list.h>
53#include <linux/netfilter/nf_conntrack_pptp.h> 52#include <linux/netfilter/nf_conntrack_pptp.h>
54#include <net/netfilter/nf_conntrack_extend.h> 53#include <net/netfilter/nf_conntrack_extend.h>
@@ -93,7 +92,4 @@ static inline struct nf_conn_nat *nfct_nat(const struct nf_conn *ct)
93#endif 92#endif
94} 93}
95 94
96#else /* !__KERNEL__: iptables wants this to compile. */
97#define nf_nat_multi_range nf_nat_multi_range_compat
98#endif /*__KERNEL__*/
99#endif 95#endif
diff --git a/include/net/rawv6.h b/include/net/rawv6.h
index f6b9b830df8c..cf7577234457 100644
--- a/include/net/rawv6.h
+++ b/include/net/rawv6.h
@@ -1,8 +1,6 @@
1#ifndef _NET_RAWV6_H 1#ifndef _NET_RAWV6_H
2#define _NET_RAWV6_H 2#define _NET_RAWV6_H
3 3
4#ifdef __KERNEL__
5
6#include <net/protocol.h> 4#include <net/protocol.h>
7 5
8void raw6_icmp_error(struct sk_buff *, int nexthdr, 6void raw6_icmp_error(struct sk_buff *, int nexthdr,
@@ -20,5 +18,3 @@ int rawv6_mh_filter_unregister(int (*filter)(struct sock *sock,
20#endif 18#endif
21 19
22#endif 20#endif
23
24#endif
diff --git a/include/net/route.h b/include/net/route.h
index b3962e249e14..3684c3edbae4 100644
--- a/include/net/route.h
+++ b/include/net/route.h
@@ -35,10 +35,6 @@
35#include <linux/cache.h> 35#include <linux/cache.h>
36#include <linux/security.h> 36#include <linux/security.h>
37 37
38#ifndef __KERNEL__
39#warning This file is not supposed to be used outside of kernel.
40#endif
41
42#define RTO_ONLINK 0x01 38#define RTO_ONLINK 0x01
43 39
44#define RTO_CONN 0 40#define RTO_CONN 0
diff --git a/include/net/transp_v6.h b/include/net/transp_v6.h
index a8122dc56410..5271a741c3a3 100644
--- a/include/net/transp_v6.h
+++ b/include/net/transp_v6.h
@@ -7,8 +7,6 @@
7 * IPv6 transport protocols 7 * IPv6 transport protocols
8 */ 8 */
9 9
10#ifdef __KERNEL__
11
12extern struct proto rawv6_prot; 10extern struct proto rawv6_prot;
13extern struct proto udpv6_prot; 11extern struct proto udpv6_prot;
14extern struct proto udplitev6_prot; 12extern struct proto udplitev6_prot;
@@ -57,5 +55,3 @@ extern const struct inet_connection_sock_af_ops ipv4_specific;
57extern void inet6_destroy_sock(struct sock *sk); 55extern void inet6_destroy_sock(struct sock *sk);
58 56
59#endif 57#endif
60
61#endif
diff --git a/include/net/wimax.h b/include/net/wimax.h
index c799ba7b708b..7328d5019d88 100644
--- a/include/net/wimax.h
+++ b/include/net/wimax.h
@@ -250,7 +250,6 @@
250 250
251#ifndef __NET__WIMAX_H__ 251#ifndef __NET__WIMAX_H__
252#define __NET__WIMAX_H__ 252#define __NET__WIMAX_H__
253#ifdef __KERNEL__
254 253
255#include <linux/wimax.h> 254#include <linux/wimax.h>
256#include <net/genetlink.h> 255#include <net/genetlink.h>
@@ -518,8 +517,4 @@ extern ssize_t wimax_msg_len(struct sk_buff *);
518extern int wimax_rfkill(struct wimax_dev *, enum wimax_rf_state); 517extern int wimax_rfkill(struct wimax_dev *, enum wimax_rf_state);
519extern int wimax_reset(struct wimax_dev *); 518extern int wimax_reset(struct wimax_dev *);
520 519
521#else
522/* You might be looking for linux/wimax.h */
523#error This file should not be included from user space.
524#endif /* #ifdef __KERNEL__ */
525#endif /* #ifndef __NET__WIMAX_H__ */ 520#endif /* #ifndef __NET__WIMAX_H__ */
diff --git a/net/core/dev.c b/net/core/dev.c
index 379c993ff421..3bbb4c2ce92e 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1315,7 +1315,8 @@ void dev_disable_lro(struct net_device *dev)
1315 return; 1315 return;
1316 1316
1317 __ethtool_set_flags(dev, flags & ~ETH_FLAG_LRO); 1317 __ethtool_set_flags(dev, flags & ~ETH_FLAG_LRO);
1318 WARN_ON(dev->features & NETIF_F_LRO); 1318 if (unlikely(dev->features & NETIF_F_LRO))
1319 netdev_WARN(dev, "failed to disable LRO!\n");
1319} 1320}
1320EXPORT_SYMBOL(dev_disable_lro); 1321EXPORT_SYMBOL(dev_disable_lro);
1321 1322
@@ -3076,25 +3077,6 @@ void netdev_rx_handler_unregister(struct net_device *dev)
3076} 3077}
3077EXPORT_SYMBOL_GPL(netdev_rx_handler_unregister); 3078EXPORT_SYMBOL_GPL(netdev_rx_handler_unregister);
3078 3079
3079static void vlan_on_bond_hook(struct sk_buff *skb)
3080{
3081 /*
3082 * Make sure ARP frames received on VLAN interfaces stacked on
3083 * bonding interfaces still make their way to any base bonding
3084 * device that may have registered for a specific ptype.
3085 */
3086 if (skb->dev->priv_flags & IFF_802_1Q_VLAN &&
3087 vlan_dev_real_dev(skb->dev)->priv_flags & IFF_BONDING &&
3088 skb->protocol == htons(ETH_P_ARP)) {
3089 struct sk_buff *skb2 = skb_clone(skb, GFP_ATOMIC);
3090
3091 if (!skb2)
3092 return;
3093 skb2->dev = vlan_dev_real_dev(skb->dev);
3094 netif_rx(skb2);
3095 }
3096}
3097
3098static int __netif_receive_skb(struct sk_buff *skb) 3080static int __netif_receive_skb(struct sk_buff *skb)
3099{ 3081{
3100 struct packet_type *ptype, *pt_prev; 3082 struct packet_type *ptype, *pt_prev;
@@ -3190,8 +3172,6 @@ ncls:
3190 goto out; 3172 goto out;
3191 } 3173 }
3192 3174
3193 vlan_on_bond_hook(skb);
3194
3195 /* deliver only exact match when indicated */ 3175 /* deliver only exact match when indicated */
3196 null_or_dev = deliver_exact ? skb->dev : NULL; 3176 null_or_dev = deliver_exact ? skb->dev : NULL;
3197 3177