Print this page
OS-4018 lxbrand support TCP SO_REUSEPORT
Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Reviewed by: Cody Mello <cody.mello@joyent.com>
        
*** 19,28 ****
--- 19,29 ----
   * CDDL HEADER END
   */
  
  /*
   * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+  * Copyright 2015 Joyent, Inc.
   */
  
  /* This file contains all TCP kernel socket related functions. */
  
  #include <sys/types.h>
*** 1019,1028 ****
--- 1020,1039 ----
                  freeb(stropt_mp);
                  freeb(ordrel_mp);
                  return (ENOMEM);
          }
  
+         /*
+          * Do not allow fallback on connections making use of SO_REUSEPORT.
+          */
+         if (tcp->tcp_rg_bind != NULL) {
+                 freeb(stropt_mp);
+                 freeb(ordrel_mp);
+                 squeue_synch_exit(connp);
+                 return (EINVAL);
+         }
+ 
          /*
           * Both endpoints must be of the same type (either STREAMS or
           * non-STREAMS) for fusion to be enabled. So if we are fused,
           * we have to unfuse.
           */