Author: np
Date: Mon Oct 27 22:22:46 2014
New Revision: 273750
URL: https://svnweb.freebsd.org/changeset/base/273750

Log:
  Some cxgbe/iw_cxgbe fixes:
  - Free rt in c4iw_connect only if it is allocated.
  - Call soclose instead of so_shutdown if there is an abort from the peer.
  - Close socket and return failure if TOE is not enabled.
  
  Submitted by: Hariprasad at Chelsio dot com
  Sponsored by: Chelsio Communications

Modified:
  head/sys/dev/cxgbe/iw_cxgbe/cm.c

Modified: head/sys/dev/cxgbe/iw_cxgbe/cm.c
==============================================================================
--- head/sys/dev/cxgbe/iw_cxgbe/cm.c    Mon Oct 27 22:20:51 2014        
(r273749)
+++ head/sys/dev/cxgbe/iw_cxgbe/cm.c    Mon Oct 27 22:22:46 2014        
(r273750)
@@ -474,7 +474,7 @@ process_conn_error(struct c4iw_ep *ep)
        if (state != ABORTING) {
 
                CTR2(KTR_IW_CXGBE, "%s:pce1 %p", __func__, ep);
-               close_socket(&ep->com, 0);
+               close_socket(&ep->com, 1);
                state_set(&ep->com, DEAD);
                c4iw_put_ep(&ep->com);
        }
@@ -2084,14 +2084,15 @@ int c4iw_connect(struct iw_cm_id *cm_id,
                CTR2(KTR_IW_CXGBE, "%s:cc7 %p", __func__, ep);
                printk(KERN_ERR MOD "%s - cannot find route.\n", __func__);
                err = -EHOSTUNREACH;
-               goto fail3;
+               goto fail2;
        }
 
-
-       if (!(rt->rt_ifp->if_flags & IFCAP_TOE)) {
+       if (!(rt->rt_ifp->if_capenable & IFCAP_TOE)) {
 
                CTR2(KTR_IW_CXGBE, "%s:cc8 %p", __func__, ep);
                printf("%s - interface not TOE capable.\n", __func__);
+               close_socket(&ep->com, 0);
+               err = -ENOPROTOOPT;
                goto fail3;
        }
        tdev = TOEDEV(rt->rt_ifp);
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to