Commit:     77d8e1efea0e313edc710160c232a6fd2dc9f907
Parent:     d04d01b113be5b88418eb30087753c3de0a39fd8
Author:     Michael S. Tsirkin <[EMAIL PROTECTED]>
AuthorDate: Wed Mar 21 15:45:05 2007 +0200
Committer:  Roland Dreier <[EMAIL PROTECTED]>
CommitDate: Thu Mar 22 14:40:16 2007 -0700

    IB/ipoib: Fix thinko in packet length checks
    The packet length checks in ipoib are broken: we add 4 bytes (IPoIB
    encapsulation header) when sending a packet, not 20 bytes (hardware
    address length) to each packet.  Therefore, if connected mode is
    enabled so that the interface MTU is larger than the multicast MTU,
    IPoIB may end up trying to send too-long multicast packets.  For
    example, multicast is broken if a message of size 2048 bytes is sent
    on an interface with UD MTU 2048, because 2048 is bigger than the real
    limit of 2044 but the code tests against the wrong limit of 2060.
    This patch fixes <>,
    submitted by Scott Weitzenkamp <[EMAIL PROTECTED]>.
    Signed-off-by: Michael S. Tsirkin <[EMAIL PROTECTED]>
    Signed-off-by: Roland Dreier <[EMAIL PROTECTED]>
 drivers/infiniband/ulp/ipoib/ipoib_cm.c |    2 +-
 drivers/infiniband/ulp/ipoib/ipoib_ib.c |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c 
index 4675640..e70492d 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
@@ -452,7 +452,7 @@ void ipoib_cm_send(struct net_device *dev, struct sk_buff 
*skb, struct ipoib_cm_
                           skb->len, tx->mtu);
-               ipoib_cm_skb_too_long(dev, skb, tx->mtu - INFINIBAND_ALEN);
+               ipoib_cm_skb_too_long(dev, skb, tx->mtu - IPOIB_ENCAP_LEN);
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ib.c 
index f2aa923..ba0ee5c 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c
@@ -328,9 +328,9 @@ void ipoib_send(struct net_device *dev, struct sk_buff *skb,
        struct ipoib_tx_buf *tx_req;
        u64 addr;
-       if (unlikely(skb->len > priv->mcast_mtu + INFINIBAND_ALEN)) {
+       if (unlikely(skb->len > priv->mcast_mtu + IPOIB_ENCAP_LEN)) {
                ipoib_warn(priv, "packet len %d (> %d) too long to send, 
-                          skb->len, priv->mcast_mtu + INFINIBAND_ALEN);
+                          skb->len, priv->mcast_mtu + IPOIB_ENCAP_LEN);
                ipoib_cm_skb_too_long(dev, skb, priv->mcast_mtu);
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to