Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

conn_flags definition in ip_vs.h is in contradiction with that in conn.h #711

Closed
worldpeace365 opened this issue Feb 3, 2021 · 1 comment
Labels
issue/reproduced the bug report in the issue is reproduced, need to solve

Comments

@worldpeace365
Copy link

conn_flags definition in ip_vs.h is in contradiction with that in conn.h. It will cause the usr.conn_flags was overwrited by conn->flags.
see follow:
for example,
DPVS_CONN_F_IN_TIMER = 0x0200,
#define IP_VS_CONN_F_OUT_SEQ 0x0200 /* must do output seq adjust */

DPVS_CONN_F_NOFASTXMIT = 0x2000,
#define IP_VS_CONN_F_ONE_PACKET 0x2000 /* forward only one packet */

ip_vs.h
/*

  • IPVS Connection Flags
  • Only flags 0..15 are sent to backup server
    /
    #define IP_VS_CONN_F_FWD_MASK 0x0007 /
    mask for the fwd methods /
    #define IP_VS_CONN_F_MASQ 0x0000 /
    masquerading/NAT /
    #define IP_VS_CONN_F_LOCALNODE 0x0001 /
    local node /
    #define IP_VS_CONN_F_TUNNEL 0x0002 /
    tunneling /
    #define IP_VS_CONN_F_DROUTE 0x0003 /
    direct routing /
    #define IP_VS_CONN_F_BYPASS 0x0004 /
    cache bypass /
    #define IP_VS_CONN_F_FULLNAT 0x0005 /
    full nat mode /
    #define IP_VS_CONN_F_SNAT 0x0006 /
    SNAT mode /
    #define IP_VS_CONN_F_SYNC 0x0020 /
    entry created by sync /
    #define IP_VS_CONN_F_HASHED 0x0040 /
    hashed entry /
    #define IP_VS_CONN_F_NOOUTPUT 0x0080 /
    no output packets /
    #define IP_VS_CONN_F_INACTIVE 0x0100 /
    not established /
    #define IP_VS_CONN_F_OUT_SEQ 0x0200 /
    must do output seq adjust /
    #define IP_VS_CONN_F_IN_SEQ 0x0400 /
    must do input seq adjust /
    #define IP_VS_CONN_F_SEQ_MASK 0x0600 /
    in/out sequence mask /
    #define IP_VS_CONN_F_NO_CPORT 0x0800 /
    no client port set yet /
    #define IP_VS_CONN_F_TEMPLATE 0x1000 /
    template, not connection /
    #define IP_VS_CONN_F_ONE_PACKET 0x2000 /
    forward only one packet */

conn.h
enum {
DPVS_CONN_F_HASHED = 0x0040,
DPVS_CONN_F_REDIRECT_HASHED = 0x0080,
DPVS_CONN_F_INACTIVE = 0x0100,
DPVS_CONN_F_IN_TIMER = 0x0200,
DPVS_CONN_F_SYNPROXY = 0x8000,
DPVS_CONN_F_TEMPLATE = 0x1000,
DPVS_CONN_F_NOFASTXMIT = 0x2000,
};

usr conn_flags set
case 'i':
set_option(options, OPT_FORWARD);
ce->dest.user.conn_flags = IP_VS_CONN_F_TUNNEL;
break;
case 'g':
set_option(options, OPT_FORWARD);
ce->dest.user.conn_flags = IP_VS_CONN_F_DROUTE;
break;
case 'b':
set_option(options, OPT_FORWARD);
ce->dest.user.conn_flags = IP_VS_CONN_F_FULLNAT;
break;
case 'J':
set_option(options, OPT_FORWARD);
ce->dest.user.conn_flags = IP_VS_CONN_F_SNAT;
break;
case 'm':
set_option(options, OPT_FORWARD);
ce->dest.user.conn_flags = IP_VS_CONN_F_MASQ;

copy to conn->flags
static int dp_vs_conn_bind_dest(struct dp_vs_conn *conn,
struct dp_vs_dest dest)
{
/
ATTENTION:
* Initial state of conn should be INACTIVE, with conn->inactconns=1 and
* conn->actconns=0. We should not increase conn->actconns except in session
* sync.Generally, the INACTIVE and SYN_PROXY flags are passed down from
* the dest here. */
conn->flags |= rte_atomic16_read(&dest->conn_flags);

@ywc689 ywc689 added the issue/reproduced the bug report in the issue is reproduced, need to solve label Feb 4, 2021
ywc689 added a commit to ywc689/dpvs that referenced this issue Feb 5, 2021
ywc689 added a commit that referenced this issue Feb 11, 2021
@ywc689
Copy link
Collaborator

ywc689 commented Feb 11, 2021

fix by pr #714

@ywc689 ywc689 closed this as completed Feb 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue/reproduced the bug report in the issue is reproduced, need to solve
Projects
None yet
Development

No branches or pull requests

2 participants