diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-03-30 21:46:43 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-03-30 21:46:43 -0400 |
commit | 15f7176eb1cccec0a332541285ee752b935c1c85 (patch) | |
tree | 9d33689be7415388ed57f437faaae883a4978a85 | |
parent | d3d52d687a770973b459d8a92ec1adbba3f60c4b (diff) | |
parent | 321dee6e8b235c496f0a068a72d8df9a4e13ceb9 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6:
wireless: remove duplicated .ndo_set_mac_address
netfilter: xtables: fix IPv6 dependency in the cluster match
tg3: Add GRO support.
niu: Add GRO support.
ucc_geth: Fix use-after-of_node_put() in ucc_geth_probe().
gianfar: Fix use-after-of_node_put() in gfar_of_init().
kernel: remove HIPQUAD()
netpoll: store local and remote ip in net-endian
netfilter: fix endian bug in conntrack printks
dmascc: fix incomplete conversion to network_device_ops
gso: Fix support for linear packets
skbuff.h: fix missing kernel-doc
ni5010: convert to net_device_ops
-rw-r--r-- | drivers/net/gianfar.c | 2 | ||||
-rw-r--r-- | drivers/net/hamradio/dmascc.c | 2 | ||||
-rw-r--r-- | drivers/net/netconsole.c | 10 | ||||
-rw-r--r-- | drivers/net/ni5010.c | 18 | ||||
-rw-r--r-- | drivers/net/niu.c | 12 | ||||
-rw-r--r-- | drivers/net/tg3.c | 4 | ||||
-rw-r--r-- | drivers/net/ucc_geth.c | 11 | ||||
-rw-r--r-- | drivers/net/wireless/airo.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ipw2x00/ipw2200.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/prism54/islpci_dev.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/zd1201.c | 1 | ||||
-rw-r--r-- | include/linux/kernel.h | 12 | ||||
-rw-r--r-- | include/linux/netpoll.h | 2 | ||||
-rw-r--r-- | include/linux/skbuff.h | 1 | ||||
-rw-r--r-- | net/core/netpoll.c | 31 | ||||
-rw-r--r-- | net/core/skbuff.c | 2 | ||||
-rw-r--r-- | net/netfilter/nf_conntrack_irc.c | 15 | ||||
-rw-r--r-- | net/netfilter/xt_cluster.c | 11 |
18 files changed, 68 insertions, 70 deletions
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c index 6a38800be3f1..65f55877be95 100644 --- a/drivers/net/gianfar.c +++ b/drivers/net/gianfar.c | |||
@@ -289,9 +289,9 @@ static int gfar_of_init(struct net_device *dev) | |||
289 | id = of_get_property(phy, "reg", NULL); | 289 | id = of_get_property(phy, "reg", NULL); |
290 | 290 | ||
291 | of_node_put(phy); | 291 | of_node_put(phy); |
292 | of_node_put(mdio); | ||
293 | 292 | ||
294 | fsl_pq_mdio_bus_name(bus_name, mdio); | 293 | fsl_pq_mdio_bus_name(bus_name, mdio); |
294 | of_node_put(mdio); | ||
295 | snprintf(priv->phy_bus_id, sizeof(priv->phy_bus_id), "%s:%02x", | 295 | snprintf(priv->phy_bus_id, sizeof(priv->phy_bus_id), "%s:%02x", |
296 | bus_name, *id); | 296 | bus_name, *id); |
297 | } | 297 | } |
diff --git a/drivers/net/hamradio/dmascc.c b/drivers/net/hamradio/dmascc.c index 881bf818bb48..7459b3ac77a9 100644 --- a/drivers/net/hamradio/dmascc.c +++ b/drivers/net/hamradio/dmascc.c | |||
@@ -445,6 +445,7 @@ static const struct net_device_ops scc_netdev_ops = { | |||
445 | .ndo_stop = scc_close, | 445 | .ndo_stop = scc_close, |
446 | .ndo_start_xmit = scc_send_packet, | 446 | .ndo_start_xmit = scc_send_packet, |
447 | .ndo_do_ioctl = scc_ioctl, | 447 | .ndo_do_ioctl = scc_ioctl, |
448 | .ndo_set_mac_address = scc_set_mac_address, | ||
448 | }; | 449 | }; |
449 | 450 | ||
450 | static int __init setup_adapter(int card_base, int type, int n) | 451 | static int __init setup_adapter(int card_base, int type, int n) |
@@ -584,7 +585,6 @@ static int __init setup_adapter(int card_base, int type, int n) | |||
584 | dev->irq = irq; | 585 | dev->irq = irq; |
585 | dev->netdev_ops = &scc_netdev_ops; | 586 | dev->netdev_ops = &scc_netdev_ops; |
586 | dev->header_ops = &ax25_header_ops; | 587 | dev->header_ops = &ax25_header_ops; |
587 | dev->set_mac_address = scc_set_mac_address; | ||
588 | } | 588 | } |
589 | if (register_netdev(info->dev[0])) { | 589 | if (register_netdev(info->dev[0])) { |
590 | printk(KERN_ERR "dmascc: could not register %s\n", | 590 | printk(KERN_ERR "dmascc: could not register %s\n", |
diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c index d304d38cd5d1..eceadf787a67 100644 --- a/drivers/net/netconsole.c +++ b/drivers/net/netconsole.c | |||
@@ -294,14 +294,12 @@ static ssize_t show_remote_port(struct netconsole_target *nt, char *buf) | |||
294 | 294 | ||
295 | static ssize_t show_local_ip(struct netconsole_target *nt, char *buf) | 295 | static ssize_t show_local_ip(struct netconsole_target *nt, char *buf) |
296 | { | 296 | { |
297 | return snprintf(buf, PAGE_SIZE, "%d.%d.%d.%d\n", | 297 | return snprintf(buf, PAGE_SIZE, "%pI4\n", &nt->np.local_ip); |
298 | HIPQUAD(nt->np.local_ip)); | ||
299 | } | 298 | } |
300 | 299 | ||
301 | static ssize_t show_remote_ip(struct netconsole_target *nt, char *buf) | 300 | static ssize_t show_remote_ip(struct netconsole_target *nt, char *buf) |
302 | { | 301 | { |
303 | return snprintf(buf, PAGE_SIZE, "%d.%d.%d.%d\n", | 302 | return snprintf(buf, PAGE_SIZE, "%pI4\n", &nt->np.remote_ip); |
304 | HIPQUAD(nt->np.remote_ip)); | ||
305 | } | 303 | } |
306 | 304 | ||
307 | static ssize_t show_local_mac(struct netconsole_target *nt, char *buf) | 305 | static ssize_t show_local_mac(struct netconsole_target *nt, char *buf) |
@@ -438,7 +436,7 @@ static ssize_t store_local_ip(struct netconsole_target *nt, | |||
438 | return -EINVAL; | 436 | return -EINVAL; |
439 | } | 437 | } |
440 | 438 | ||
441 | nt->np.local_ip = ntohl(in_aton(buf)); | 439 | nt->np.local_ip = in_aton(buf); |
442 | 440 | ||
443 | return strnlen(buf, count); | 441 | return strnlen(buf, count); |
444 | } | 442 | } |
@@ -454,7 +452,7 @@ static ssize_t store_remote_ip(struct netconsole_target *nt, | |||
454 | return -EINVAL; | 452 | return -EINVAL; |
455 | } | 453 | } |
456 | 454 | ||
457 | nt->np.remote_ip = ntohl(in_aton(buf)); | 455 | nt->np.remote_ip = in_aton(buf); |
458 | 456 | ||
459 | return strnlen(buf, count); | 457 | return strnlen(buf, count); |
460 | } | 458 | } |
diff --git a/drivers/net/ni5010.c b/drivers/net/ni5010.c index 539e18ab485c..2a8da476ab3d 100644 --- a/drivers/net/ni5010.c +++ b/drivers/net/ni5010.c | |||
@@ -189,6 +189,17 @@ static void __init trigger_irq(int ioaddr) | |||
189 | outb(MM_EN_XMT|MM_MUX, IE_MMODE); /* Start transmission */ | 189 | outb(MM_EN_XMT|MM_MUX, IE_MMODE); /* Start transmission */ |
190 | } | 190 | } |
191 | 191 | ||
192 | static const struct net_device_ops ni5010_netdev_ops = { | ||
193 | .ndo_open = ni5010_open, | ||
194 | .ndo_stop = ni5010_close, | ||
195 | .ndo_start_xmit = ni5010_send_packet, | ||
196 | .ndo_set_multicast_list = ni5010_set_multicast_list, | ||
197 | .ndo_tx_timeout = ni5010_timeout, | ||
198 | .ndo_validate_addr = eth_validate_addr, | ||
199 | .ndo_set_mac_address = eth_mac_addr, | ||
200 | .ndo_change_mtu = eth_change_mtu, | ||
201 | }; | ||
202 | |||
192 | /* | 203 | /* |
193 | * This is the real probe routine. Linux has a history of friendly device | 204 | * This is the real probe routine. Linux has a history of friendly device |
194 | * probes on the ISA bus. A good device probes avoids doing writes, and | 205 | * probes on the ISA bus. A good device probes avoids doing writes, and |
@@ -328,13 +339,8 @@ static int __init ni5010_probe1(struct net_device *dev, int ioaddr) | |||
328 | outb(0, IE_RBUF); /* set buffer byte 0 to 0 again */ | 339 | outb(0, IE_RBUF); /* set buffer byte 0 to 0 again */ |
329 | } | 340 | } |
330 | printk("-> bufsize rcv/xmt=%d/%d\n", bufsize_rcv, NI5010_BUFSIZE); | 341 | printk("-> bufsize rcv/xmt=%d/%d\n", bufsize_rcv, NI5010_BUFSIZE); |
331 | memset(netdev_priv(dev), 0, sizeof(struct ni5010_local)); | ||
332 | 342 | ||
333 | dev->open = ni5010_open; | 343 | dev->netdev_ops = &ni5010_netdev_ops; |
334 | dev->stop = ni5010_close; | ||
335 | dev->hard_start_xmit = ni5010_send_packet; | ||
336 | dev->set_multicast_list = ni5010_set_multicast_list; | ||
337 | dev->tx_timeout = ni5010_timeout; | ||
338 | dev->watchdog_timeo = HZ/20; | 344 | dev->watchdog_timeo = HZ/20; |
339 | 345 | ||
340 | dev->flags &= ~IFF_MULTICAST; /* Multicast doesn't work */ | 346 | dev->flags &= ~IFF_MULTICAST; /* Multicast doesn't work */ |
diff --git a/drivers/net/niu.c b/drivers/net/niu.c index 50c11126a3db..02c37e2f08a9 100644 --- a/drivers/net/niu.c +++ b/drivers/net/niu.c | |||
@@ -3441,7 +3441,8 @@ static int niu_rx_pkt_ignore(struct niu *np, struct rx_ring_info *rp) | |||
3441 | return num_rcr; | 3441 | return num_rcr; |
3442 | } | 3442 | } |
3443 | 3443 | ||
3444 | static int niu_process_rx_pkt(struct niu *np, struct rx_ring_info *rp) | 3444 | static int niu_process_rx_pkt(struct napi_struct *napi, struct niu *np, |
3445 | struct rx_ring_info *rp) | ||
3445 | { | 3446 | { |
3446 | unsigned int index = rp->rcr_index; | 3447 | unsigned int index = rp->rcr_index; |
3447 | struct sk_buff *skb; | 3448 | struct sk_buff *skb; |
@@ -3518,7 +3519,7 @@ static int niu_process_rx_pkt(struct niu *np, struct rx_ring_info *rp) | |||
3518 | 3519 | ||
3519 | skb->protocol = eth_type_trans(skb, np->dev); | 3520 | skb->protocol = eth_type_trans(skb, np->dev); |
3520 | skb_record_rx_queue(skb, rp->rx_channel); | 3521 | skb_record_rx_queue(skb, rp->rx_channel); |
3521 | netif_receive_skb(skb); | 3522 | napi_gro_receive(napi, skb); |
3522 | 3523 | ||
3523 | return num_rcr; | 3524 | return num_rcr; |
3524 | } | 3525 | } |
@@ -3706,7 +3707,8 @@ static inline void niu_sync_rx_discard_stats(struct niu *np, | |||
3706 | } | 3707 | } |
3707 | } | 3708 | } |
3708 | 3709 | ||
3709 | static int niu_rx_work(struct niu *np, struct rx_ring_info *rp, int budget) | 3710 | static int niu_rx_work(struct napi_struct *napi, struct niu *np, |
3711 | struct rx_ring_info *rp, int budget) | ||
3710 | { | 3712 | { |
3711 | int qlen, rcr_done = 0, work_done = 0; | 3713 | int qlen, rcr_done = 0, work_done = 0; |
3712 | struct rxdma_mailbox *mbox = rp->mbox; | 3714 | struct rxdma_mailbox *mbox = rp->mbox; |
@@ -3728,7 +3730,7 @@ static int niu_rx_work(struct niu *np, struct rx_ring_info *rp, int budget) | |||
3728 | rcr_done = work_done = 0; | 3730 | rcr_done = work_done = 0; |
3729 | qlen = min(qlen, budget); | 3731 | qlen = min(qlen, budget); |
3730 | while (work_done < qlen) { | 3732 | while (work_done < qlen) { |
3731 | rcr_done += niu_process_rx_pkt(np, rp); | 3733 | rcr_done += niu_process_rx_pkt(napi, np, rp); |
3732 | work_done++; | 3734 | work_done++; |
3733 | } | 3735 | } |
3734 | 3736 | ||
@@ -3776,7 +3778,7 @@ static int niu_poll_core(struct niu *np, struct niu_ldg *lp, int budget) | |||
3776 | if (rx_vec & (1 << rp->rx_channel)) { | 3778 | if (rx_vec & (1 << rp->rx_channel)) { |
3777 | int this_work_done; | 3779 | int this_work_done; |
3778 | 3780 | ||
3779 | this_work_done = niu_rx_work(np, rp, | 3781 | this_work_done = niu_rx_work(&lp->napi, np, rp, |
3780 | budget); | 3782 | budget); |
3781 | 3783 | ||
3782 | budget -= this_work_done; | 3784 | budget -= this_work_done; |
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index f7efcecc4108..1205c2a22657 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
@@ -4392,7 +4392,7 @@ static void tg3_recycle_rx(struct tg3 *tp, u32 opaque_key, | |||
4392 | #if TG3_VLAN_TAG_USED | 4392 | #if TG3_VLAN_TAG_USED |
4393 | static int tg3_vlan_rx(struct tg3 *tp, struct sk_buff *skb, u16 vlan_tag) | 4393 | static int tg3_vlan_rx(struct tg3 *tp, struct sk_buff *skb, u16 vlan_tag) |
4394 | { | 4394 | { |
4395 | return vlan_hwaccel_receive_skb(skb, tp->vlgrp, vlan_tag); | 4395 | return vlan_gro_receive(&tp->napi, tp->vlgrp, vlan_tag, skb); |
4396 | } | 4396 | } |
4397 | #endif | 4397 | #endif |
4398 | 4398 | ||
@@ -4539,7 +4539,7 @@ static int tg3_rx(struct tg3 *tp, int budget) | |||
4539 | desc->err_vlan & RXD_VLAN_MASK); | 4539 | desc->err_vlan & RXD_VLAN_MASK); |
4540 | } else | 4540 | } else |
4541 | #endif | 4541 | #endif |
4542 | netif_receive_skb(skb); | 4542 | napi_gro_receive(&tp->napi, skb); |
4543 | 4543 | ||
4544 | received++; | 4544 | received++; |
4545 | budget--; | 4545 | budget--; |
diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c index 86a479f61c0c..933fcfbf35e1 100644 --- a/drivers/net/ucc_geth.c +++ b/drivers/net/ucc_geth.c | |||
@@ -3648,15 +3648,16 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma | |||
3648 | mdio = of_get_parent(phy); | 3648 | mdio = of_get_parent(phy); |
3649 | 3649 | ||
3650 | if (mdio == NULL) | 3650 | if (mdio == NULL) |
3651 | return -1; | 3651 | return -ENODEV; |
3652 | 3652 | ||
3653 | err = of_address_to_resource(mdio, 0, &res); | 3653 | err = of_address_to_resource(mdio, 0, &res); |
3654 | of_node_put(mdio); | ||
3655 | |||
3656 | if (err) | ||
3657 | return -1; | ||
3658 | 3654 | ||
3655 | if (err) { | ||
3656 | of_node_put(mdio); | ||
3657 | return err; | ||
3658 | } | ||
3659 | fsl_pq_mdio_bus_name(bus_name, mdio); | 3659 | fsl_pq_mdio_bus_name(bus_name, mdio); |
3660 | of_node_put(mdio); | ||
3660 | snprintf(ug_info->phy_bus_id, sizeof(ug_info->phy_bus_id), | 3661 | snprintf(ug_info->phy_bus_id, sizeof(ug_info->phy_bus_id), |
3661 | "%s:%02x", bus_name, *prop); | 3662 | "%s:%02x", bus_name, *prop); |
3662 | } | 3663 | } |
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c index 31b1cc2b778a..f21a6171c691 100644 --- a/drivers/net/wireless/airo.c +++ b/drivers/net/wireless/airo.c | |||
@@ -2752,7 +2752,6 @@ static const struct net_device_ops airo_netdev_ops = { | |||
2752 | .ndo_set_mac_address = airo_set_mac_address, | 2752 | .ndo_set_mac_address = airo_set_mac_address, |
2753 | .ndo_do_ioctl = airo_ioctl, | 2753 | .ndo_do_ioctl = airo_ioctl, |
2754 | .ndo_change_mtu = airo_change_mtu, | 2754 | .ndo_change_mtu = airo_change_mtu, |
2755 | .ndo_set_mac_address = eth_mac_addr, | ||
2756 | .ndo_validate_addr = eth_validate_addr, | 2755 | .ndo_validate_addr = eth_validate_addr, |
2757 | }; | 2756 | }; |
2758 | 2757 | ||
@@ -2765,7 +2764,6 @@ static const struct net_device_ops mpi_netdev_ops = { | |||
2765 | .ndo_set_mac_address = airo_set_mac_address, | 2764 | .ndo_set_mac_address = airo_set_mac_address, |
2766 | .ndo_do_ioctl = airo_ioctl, | 2765 | .ndo_do_ioctl = airo_ioctl, |
2767 | .ndo_change_mtu = airo_change_mtu, | 2766 | .ndo_change_mtu = airo_change_mtu, |
2768 | .ndo_set_mac_address = eth_mac_addr, | ||
2769 | .ndo_validate_addr = eth_validate_addr, | 2767 | .ndo_validate_addr = eth_validate_addr, |
2770 | }; | 2768 | }; |
2771 | 2769 | ||
diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c index b3449948a25a..4a92af1d7877 100644 --- a/drivers/net/wireless/ipw2x00/ipw2200.c +++ b/drivers/net/wireless/ipw2x00/ipw2200.c | |||
@@ -11593,7 +11593,6 @@ static const struct net_device_ops ipw_netdev_ops = { | |||
11593 | .ndo_set_mac_address = ipw_net_set_mac_address, | 11593 | .ndo_set_mac_address = ipw_net_set_mac_address, |
11594 | .ndo_start_xmit = ieee80211_xmit, | 11594 | .ndo_start_xmit = ieee80211_xmit, |
11595 | .ndo_change_mtu = ieee80211_change_mtu, | 11595 | .ndo_change_mtu = ieee80211_change_mtu, |
11596 | .ndo_set_mac_address = eth_mac_addr, | ||
11597 | .ndo_validate_addr = eth_validate_addr, | 11596 | .ndo_validate_addr = eth_validate_addr, |
11598 | }; | 11597 | }; |
11599 | 11598 | ||
diff --git a/drivers/net/wireless/prism54/islpci_dev.c b/drivers/net/wireless/prism54/islpci_dev.c index 166ed9584601..e26d7b3ceab5 100644 --- a/drivers/net/wireless/prism54/islpci_dev.c +++ b/drivers/net/wireless/prism54/islpci_dev.c | |||
@@ -803,7 +803,6 @@ static const struct net_device_ops islpci_netdev_ops = { | |||
803 | .ndo_tx_timeout = islpci_eth_tx_timeout, | 803 | .ndo_tx_timeout = islpci_eth_tx_timeout, |
804 | .ndo_set_mac_address = prism54_set_mac_address, | 804 | .ndo_set_mac_address = prism54_set_mac_address, |
805 | .ndo_change_mtu = eth_change_mtu, | 805 | .ndo_change_mtu = eth_change_mtu, |
806 | .ndo_set_mac_address = eth_mac_addr, | ||
807 | .ndo_validate_addr = eth_validate_addr, | 806 | .ndo_validate_addr = eth_validate_addr, |
808 | }; | 807 | }; |
809 | 808 | ||
diff --git a/drivers/net/wireless/zd1201.c b/drivers/net/wireless/zd1201.c index 9b244c96b221..5fabd9c0f07a 100644 --- a/drivers/net/wireless/zd1201.c +++ b/drivers/net/wireless/zd1201.c | |||
@@ -1725,7 +1725,6 @@ static const struct net_device_ops zd1201_netdev_ops = { | |||
1725 | .ndo_set_multicast_list = zd1201_set_multicast, | 1725 | .ndo_set_multicast_list = zd1201_set_multicast, |
1726 | .ndo_set_mac_address = zd1201_set_mac_address, | 1726 | .ndo_set_mac_address = zd1201_set_mac_address, |
1727 | .ndo_change_mtu = eth_change_mtu, | 1727 | .ndo_change_mtu = eth_change_mtu, |
1728 | .ndo_set_mac_address = eth_mac_addr, | ||
1729 | .ndo_validate_addr = eth_validate_addr, | 1728 | .ndo_validate_addr = eth_validate_addr, |
1730 | }; | 1729 | }; |
1731 | 1730 | ||
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 914918abfdd1..f81d80f47dcb 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -379,18 +379,6 @@ static inline char *pack_hex_byte(char *buf, u8 byte) | |||
379 | ((unsigned char *)&addr)[3] | 379 | ((unsigned char *)&addr)[3] |
380 | #define NIPQUAD_FMT "%u.%u.%u.%u" | 380 | #define NIPQUAD_FMT "%u.%u.%u.%u" |
381 | 381 | ||
382 | #if defined(__LITTLE_ENDIAN) | ||
383 | #define HIPQUAD(addr) \ | ||
384 | ((unsigned char *)&addr)[3], \ | ||
385 | ((unsigned char *)&addr)[2], \ | ||
386 | ((unsigned char *)&addr)[1], \ | ||
387 | ((unsigned char *)&addr)[0] | ||
388 | #elif defined(__BIG_ENDIAN) | ||
389 | #define HIPQUAD NIPQUAD | ||
390 | #else | ||
391 | #error "Please fix asm/byteorder.h" | ||
392 | #endif /* __LITTLE_ENDIAN */ | ||
393 | |||
394 | /* | 382 | /* |
395 | * min()/max()/clamp() macros that also do | 383 | * min()/max()/clamp() macros that also do |
396 | * strict type-checking.. See the | 384 | * strict type-checking.. See the |
diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h index de99025f2c5d..2524267210d3 100644 --- a/include/linux/netpoll.h +++ b/include/linux/netpoll.h | |||
@@ -18,7 +18,7 @@ struct netpoll { | |||
18 | const char *name; | 18 | const char *name; |
19 | void (*rx_hook)(struct netpoll *, int, char *, int); | 19 | void (*rx_hook)(struct netpoll *, int, char *, int); |
20 | 20 | ||
21 | u32 local_ip, remote_ip; | 21 | __be32 local_ip, remote_ip; |
22 | u16 local_port, remote_port; | 22 | u16 local_port, remote_port; |
23 | u8 remote_mac[ETH_ALEN]; | 23 | u8 remote_mac[ETH_ALEN]; |
24 | }; | 24 | }; |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 55d67300fa10..5fd389162f01 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -168,6 +168,7 @@ struct skb_shared_hwtstamps { | |||
168 | * @software: generate software time stamp | 168 | * @software: generate software time stamp |
169 | * @in_progress: device driver is going to provide | 169 | * @in_progress: device driver is going to provide |
170 | * hardware time stamp | 170 | * hardware time stamp |
171 | * @flags: all shared_tx flags | ||
171 | * | 172 | * |
172 | * These flags are attached to packets as part of the | 173 | * These flags are attached to packets as part of the |
173 | * &skb_shared_info. Use skb_tx() to get a pointer. | 174 | * &skb_shared_info. Use skb_tx() to get a pointer. |
diff --git a/net/core/netpoll.c b/net/core/netpoll.c index 755414cd49d1..b5873bdff612 100644 --- a/net/core/netpoll.c +++ b/net/core/netpoll.c | |||
@@ -345,8 +345,8 @@ void netpoll_send_udp(struct netpoll *np, const char *msg, int len) | |||
345 | udph->dest = htons(np->remote_port); | 345 | udph->dest = htons(np->remote_port); |
346 | udph->len = htons(udp_len); | 346 | udph->len = htons(udp_len); |
347 | udph->check = 0; | 347 | udph->check = 0; |
348 | udph->check = csum_tcpudp_magic(htonl(np->local_ip), | 348 | udph->check = csum_tcpudp_magic(np->local_ip, |
349 | htonl(np->remote_ip), | 349 | np->remote_ip, |
350 | udp_len, IPPROTO_UDP, | 350 | udp_len, IPPROTO_UDP, |
351 | csum_partial(udph, udp_len, 0)); | 351 | csum_partial(udph, udp_len, 0)); |
352 | if (udph->check == 0) | 352 | if (udph->check == 0) |
@@ -365,8 +365,8 @@ void netpoll_send_udp(struct netpoll *np, const char *msg, int len) | |||
365 | iph->ttl = 64; | 365 | iph->ttl = 64; |
366 | iph->protocol = IPPROTO_UDP; | 366 | iph->protocol = IPPROTO_UDP; |
367 | iph->check = 0; | 367 | iph->check = 0; |
368 | put_unaligned(htonl(np->local_ip), &(iph->saddr)); | 368 | put_unaligned(np->local_ip, &(iph->saddr)); |
369 | put_unaligned(htonl(np->remote_ip), &(iph->daddr)); | 369 | put_unaligned(np->remote_ip, &(iph->daddr)); |
370 | iph->check = ip_fast_csum((unsigned char *)iph, iph->ihl); | 370 | iph->check = ip_fast_csum((unsigned char *)iph, iph->ihl); |
371 | 371 | ||
372 | eth = (struct ethhdr *) skb_push(skb, ETH_HLEN); | 372 | eth = (struct ethhdr *) skb_push(skb, ETH_HLEN); |
@@ -424,7 +424,7 @@ static void arp_reply(struct sk_buff *skb) | |||
424 | memcpy(&tip, arp_ptr, 4); | 424 | memcpy(&tip, arp_ptr, 4); |
425 | 425 | ||
426 | /* Should we ignore arp? */ | 426 | /* Should we ignore arp? */ |
427 | if (tip != htonl(np->local_ip) || | 427 | if (tip != np->local_ip || |
428 | ipv4_is_loopback(tip) || ipv4_is_multicast(tip)) | 428 | ipv4_is_loopback(tip) || ipv4_is_multicast(tip)) |
429 | return; | 429 | return; |
430 | 430 | ||
@@ -533,9 +533,9 @@ int __netpoll_rx(struct sk_buff *skb) | |||
533 | goto out; | 533 | goto out; |
534 | if (checksum_udp(skb, uh, ulen, iph->saddr, iph->daddr)) | 534 | if (checksum_udp(skb, uh, ulen, iph->saddr, iph->daddr)) |
535 | goto out; | 535 | goto out; |
536 | if (np->local_ip && np->local_ip != ntohl(iph->daddr)) | 536 | if (np->local_ip && np->local_ip != iph->daddr) |
537 | goto out; | 537 | goto out; |
538 | if (np->remote_ip && np->remote_ip != ntohl(iph->saddr)) | 538 | if (np->remote_ip && np->remote_ip != iph->saddr) |
539 | goto out; | 539 | goto out; |
540 | if (np->local_port && np->local_port != ntohs(uh->dest)) | 540 | if (np->local_port && np->local_port != ntohs(uh->dest)) |
541 | goto out; | 541 | goto out; |
@@ -560,14 +560,14 @@ void netpoll_print_options(struct netpoll *np) | |||
560 | { | 560 | { |
561 | printk(KERN_INFO "%s: local port %d\n", | 561 | printk(KERN_INFO "%s: local port %d\n", |
562 | np->name, np->local_port); | 562 | np->name, np->local_port); |
563 | printk(KERN_INFO "%s: local IP %d.%d.%d.%d\n", | 563 | printk(KERN_INFO "%s: local IP %pI4\n", |
564 | np->name, HIPQUAD(np->local_ip)); | 564 | np->name, &np->local_ip); |
565 | printk(KERN_INFO "%s: interface %s\n", | 565 | printk(KERN_INFO "%s: interface %s\n", |
566 | np->name, np->dev_name); | 566 | np->name, np->dev_name); |
567 | printk(KERN_INFO "%s: remote port %d\n", | 567 | printk(KERN_INFO "%s: remote port %d\n", |
568 | np->name, np->remote_port); | 568 | np->name, np->remote_port); |
569 | printk(KERN_INFO "%s: remote IP %d.%d.%d.%d\n", | 569 | printk(KERN_INFO "%s: remote IP %pI4\n", |
570 | np->name, HIPQUAD(np->remote_ip)); | 570 | np->name, &np->remote_ip); |
571 | printk(KERN_INFO "%s: remote ethernet address %pM\n", | 571 | printk(KERN_INFO "%s: remote ethernet address %pM\n", |
572 | np->name, np->remote_mac); | 572 | np->name, np->remote_mac); |
573 | } | 573 | } |
@@ -589,7 +589,7 @@ int netpoll_parse_options(struct netpoll *np, char *opt) | |||
589 | if ((delim = strchr(cur, '/')) == NULL) | 589 | if ((delim = strchr(cur, '/')) == NULL) |
590 | goto parse_failed; | 590 | goto parse_failed; |
591 | *delim = 0; | 591 | *delim = 0; |
592 | np->local_ip = ntohl(in_aton(cur)); | 592 | np->local_ip = in_aton(cur); |
593 | cur = delim; | 593 | cur = delim; |
594 | } | 594 | } |
595 | cur++; | 595 | cur++; |
@@ -618,7 +618,7 @@ int netpoll_parse_options(struct netpoll *np, char *opt) | |||
618 | if ((delim = strchr(cur, '/')) == NULL) | 618 | if ((delim = strchr(cur, '/')) == NULL) |
619 | goto parse_failed; | 619 | goto parse_failed; |
620 | *delim = 0; | 620 | *delim = 0; |
621 | np->remote_ip = ntohl(in_aton(cur)); | 621 | np->remote_ip = in_aton(cur); |
622 | cur = delim + 1; | 622 | cur = delim + 1; |
623 | 623 | ||
624 | if (*cur != 0) { | 624 | if (*cur != 0) { |
@@ -759,10 +759,9 @@ int netpoll_setup(struct netpoll *np) | |||
759 | goto release; | 759 | goto release; |
760 | } | 760 | } |
761 | 761 | ||
762 | np->local_ip = ntohl(in_dev->ifa_list->ifa_local); | 762 | np->local_ip = in_dev->ifa_list->ifa_local; |
763 | rcu_read_unlock(); | 763 | rcu_read_unlock(); |
764 | printk(KERN_INFO "%s: local IP %d.%d.%d.%d\n", | 764 | printk(KERN_INFO "%s: local IP %pI4\n", np->name, &np->local_ip); |
765 | np->name, HIPQUAD(np->local_ip)); | ||
766 | } | 765 | } |
767 | 766 | ||
768 | if (np->rx_hook) { | 767 | if (np->rx_hook) { |
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 6acbf9e79eb1..ce6356cd9f71 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
@@ -2579,7 +2579,7 @@ struct sk_buff *skb_segment(struct sk_buff *skb, int features) | |||
2579 | skb_network_header_len(skb)); | 2579 | skb_network_header_len(skb)); |
2580 | skb_copy_from_linear_data(skb, nskb->data, doffset); | 2580 | skb_copy_from_linear_data(skb, nskb->data, doffset); |
2581 | 2581 | ||
2582 | if (pos >= offset + len) | 2582 | if (fskb != skb_shinfo(skb)->frag_list) |
2583 | continue; | 2583 | continue; |
2584 | 2584 | ||
2585 | if (!sg) { | 2585 | if (!sg) { |
diff --git a/net/netfilter/nf_conntrack_irc.c b/net/netfilter/nf_conntrack_irc.c index 409c8be58e7c..8bd98c84f77e 100644 --- a/net/netfilter/nf_conntrack_irc.c +++ b/net/netfilter/nf_conntrack_irc.c | |||
@@ -66,7 +66,7 @@ static const char *const dccprotos[] = { | |||
66 | * ad_beg_p returns pointer to first byte of addr data | 66 | * ad_beg_p returns pointer to first byte of addr data |
67 | * ad_end_p returns pointer to last byte of addr data | 67 | * ad_end_p returns pointer to last byte of addr data |
68 | */ | 68 | */ |
69 | static int parse_dcc(char *data, const char *data_end, u_int32_t *ip, | 69 | static int parse_dcc(char *data, const char *data_end, __be32 *ip, |
70 | u_int16_t *port, char **ad_beg_p, char **ad_end_p) | 70 | u_int16_t *port, char **ad_beg_p, char **ad_end_p) |
71 | { | 71 | { |
72 | char *tmp; | 72 | char *tmp; |
@@ -85,7 +85,7 @@ static int parse_dcc(char *data, const char *data_end, u_int32_t *ip, | |||
85 | return -1; | 85 | return -1; |
86 | 86 | ||
87 | *ad_beg_p = data; | 87 | *ad_beg_p = data; |
88 | *ip = simple_strtoul(data, &data, 10); | 88 | *ip = cpu_to_be32(simple_strtoul(data, &data, 10)); |
89 | 89 | ||
90 | /* skip blanks between ip and port */ | 90 | /* skip blanks between ip and port */ |
91 | while (*data == ' ') { | 91 | while (*data == ' ') { |
@@ -112,7 +112,7 @@ static int help(struct sk_buff *skb, unsigned int protoff, | |||
112 | int dir = CTINFO2DIR(ctinfo); | 112 | int dir = CTINFO2DIR(ctinfo); |
113 | struct nf_conntrack_expect *exp; | 113 | struct nf_conntrack_expect *exp; |
114 | struct nf_conntrack_tuple *tuple; | 114 | struct nf_conntrack_tuple *tuple; |
115 | u_int32_t dcc_ip; | 115 | __be32 dcc_ip; |
116 | u_int16_t dcc_port; | 116 | u_int16_t dcc_port; |
117 | __be16 port; | 117 | __be16 port; |
118 | int i, ret = NF_ACCEPT; | 118 | int i, ret = NF_ACCEPT; |
@@ -177,13 +177,14 @@ static int help(struct sk_buff *skb, unsigned int protoff, | |||
177 | pr_debug("unable to parse dcc command\n"); | 177 | pr_debug("unable to parse dcc command\n"); |
178 | continue; | 178 | continue; |
179 | } | 179 | } |
180 | pr_debug("DCC bound ip/port: %u.%u.%u.%u:%u\n", | 180 | |
181 | HIPQUAD(dcc_ip), dcc_port); | 181 | pr_debug("DCC bound ip/port: %pI4:%u\n", |
182 | &dcc_ip, dcc_port); | ||
182 | 183 | ||
183 | /* dcc_ip can be the internal OR external (NAT'ed) IP */ | 184 | /* dcc_ip can be the internal OR external (NAT'ed) IP */ |
184 | tuple = &ct->tuplehash[dir].tuple; | 185 | tuple = &ct->tuplehash[dir].tuple; |
185 | if (tuple->src.u3.ip != htonl(dcc_ip) && | 186 | if (tuple->src.u3.ip != dcc_ip && |
186 | tuple->dst.u3.ip != htonl(dcc_ip)) { | 187 | tuple->dst.u3.ip != dcc_ip) { |
187 | if (net_ratelimit()) | 188 | if (net_ratelimit()) |
188 | printk(KERN_WARNING | 189 | printk(KERN_WARNING |
189 | "Forged DCC command from %pI4: %pI4:%u\n", | 190 | "Forged DCC command from %pI4: %pI4:%u\n", |
diff --git a/net/netfilter/xt_cluster.c b/net/netfilter/xt_cluster.c index ad5bd890e4e8..6c4847662b85 100644 --- a/net/netfilter/xt_cluster.c +++ b/net/netfilter/xt_cluster.c | |||
@@ -58,6 +58,13 @@ xt_cluster_hash(const struct nf_conn *ct, | |||
58 | } | 58 | } |
59 | 59 | ||
60 | static inline bool | 60 | static inline bool |
61 | xt_cluster_ipv6_is_multicast(const struct in6_addr *addr) | ||
62 | { | ||
63 | __be32 st = addr->s6_addr32[0]; | ||
64 | return ((st & htonl(0xFF000000)) == htonl(0xFF000000)); | ||
65 | } | ||
66 | |||
67 | static inline bool | ||
61 | xt_cluster_is_multicast_addr(const struct sk_buff *skb, u_int8_t family) | 68 | xt_cluster_is_multicast_addr(const struct sk_buff *skb, u_int8_t family) |
62 | { | 69 | { |
63 | bool is_multicast = false; | 70 | bool is_multicast = false; |
@@ -67,8 +74,8 @@ xt_cluster_is_multicast_addr(const struct sk_buff *skb, u_int8_t family) | |||
67 | is_multicast = ipv4_is_multicast(ip_hdr(skb)->daddr); | 74 | is_multicast = ipv4_is_multicast(ip_hdr(skb)->daddr); |
68 | break; | 75 | break; |
69 | case NFPROTO_IPV6: | 76 | case NFPROTO_IPV6: |
70 | is_multicast = ipv6_addr_type(&ipv6_hdr(skb)->daddr) & | 77 | is_multicast = |
71 | IPV6_ADDR_MULTICAST; | 78 | xt_cluster_ipv6_is_multicast(&ipv6_hdr(skb)->daddr); |
72 | break; | 79 | break; |
73 | default: | 80 | default: |
74 | WARN_ON(1); | 81 | WARN_ON(1); |