]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - net/netfilter/ipvs/ip_vs_conn.c
ipvs: extend connection flags to 32 bits
[net-next-2.6.git] / net / netfilter / ipvs / ip_vs_conn.c
index b71c69a2db138ac30aadb13e02a697322d54ac90..9fe1da7bcf16a9d9a05579b175f632a35aefd1d0 100644 (file)
@@ -505,6 +505,8 @@ static inline int ip_vs_dest_totalconns(struct ip_vs_dest *dest)
 static inline void
 ip_vs_bind_dest(struct ip_vs_conn *cp, struct ip_vs_dest *dest)
 {
+       unsigned int conn_flags;
+
        /* if dest is NULL, then return directly */
        if (!dest)
                return;
@@ -512,16 +514,18 @@ ip_vs_bind_dest(struct ip_vs_conn *cp, struct ip_vs_dest *dest)
        /* Increase the refcnt counter of the dest */
        atomic_inc(&dest->refcnt);
 
+       conn_flags = atomic_read(&dest->conn_flags);
+       if (cp->protocol != IPPROTO_UDP)
+               conn_flags &= ~IP_VS_CONN_F_ONE_PACKET;
        /* Bind with the destination and its corresponding transmitter */
-       if ((cp->flags & IP_VS_CONN_F_SYNC) &&
-           (!(cp->flags & IP_VS_CONN_F_TEMPLATE)))
+       if (cp->flags & IP_VS_CONN_F_SYNC) {
                /* if the connection is not template and is created
                 * by sync, preserve the activity flag.
                 */
-               cp->flags |= atomic_read(&dest->conn_flags) &
-                            (~IP_VS_CONN_F_INACTIVE);
-       else
-               cp->flags |= atomic_read(&dest->conn_flags);
+               if (!(cp->flags & IP_VS_CONN_F_TEMPLATE))
+                       conn_flags &= ~IP_VS_CONN_F_INACTIVE;
+       }
+       cp->flags |= conn_flags;
        cp->dest = dest;
 
        IP_VS_DBG_BUF(7, "Bind-dest %s c:%s:%d v:%s:%d "