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

change argument alters other defined rules #79

Closed
dastergon opened this issue Aug 6, 2017 · 4 comments
Closed

change argument alters other defined rules #79

dastergon opened this issue Aug 6, 2017 · 4 comments
Assignees
Labels

Comments

@dastergon
Copy link
Contributor

dastergon commented Aug 6, 2017

According to the help page of tcset:

 --change               change existing traffic shaping rules to new one. this
                        option reduce the shaping rule switching side effect
                        (such as traffic spike) compared to --overwrite
                        option. note: the tcset command will fail when there
                        is no existing shaping rules.

How to reproduce

Set multiple rules:

$ sudo tcset --device eth0 --delay 100 --rate 50k --network 192.168.1.2 --add
$ sudo tcset --device eth0 --delay 100 --rate 50k --network 192.168.1.3 --add

Show the existing rules:

$ sudo tcshow --device eth0
{
    "eth0": {
        "outgoing": {
            "dst-network=192.168.1.2/32, protocol=ip": {
                "delay": "100.0",
                "rate": "50K"
            },
            "dst-network=192.168.1.3/32, protocol=ip": {
                "delay": "100.0",
                "rate": "50K"
            }
        },
        "incoming": {}
    }
}

If I want to change the delay and rate in the dst-network 192.168.1.3 to 200 and 60k respectively:

$ sudo tcset --device eth0 --delay 200 --rate 60k --network 192.168.1.3 --change

However the command changes the rule for the dst-network 192.168.1.2:

$ sudo tcshow --device eth0
{                                              
    "eth0": {                               
        "outgoing": {                          
            "dst-network=192.168.1.2/32, protocol=ip": {                                       
                "delay": "100.0",              
                "rate": "60K"                  
            },                                 
            "dst-network=192.168.1.3/32, protocol=ip": {                                       
                "delay": "100.0",              
                "rate": "50K"                  
            }                                  
        },                                     
        "incoming": {}                         
    }                                          
}

The command replaced only the rate attribute in the wrong network and the delay attribute was not changed at all.

Thanks in advance.

@thombashi thombashi self-assigned this Aug 8, 2017
@thombashi thombashi added the bug label Aug 8, 2017
@thombashi
Copy link
Owner

Thank you for your report.

I can reproduce the problem.
That would be a great help for me.
I will fix the problem in this weekend.

@dastergon
Copy link
Contributor Author

@thombashi is there an ETA regarding the fix of this issue?

@thombashi
Copy link
Owner

@dastergon
Sorry to have kept you waiting.
I've fixed the problem at tcconfig 13.2.

+ tcset --device ens33 --delay 100 --rate 50k --network 192.168.1.2 --overwrite
+ tcset --device ens33 --delay 100 --rate 50k --network 192.168.1.3 --add
+ tcshow -d ens33
{
    "ens33": {
        "outgoing": {
            "dst-network=192.168.1.2/32, protocol=ip": {
                "delay": 100,
                "rate": "50K"
            },
            "dst-network=192.168.1.3/32, protocol=ip": {
                "delay": 100,
                "rate": "50K"
            }
        },
        "incoming": {}
    }
}
+ tcset --device ens33 --delay 200 --rate 60k --network 192.168.1.3 --change
+ tcshow -d ens33
{
    "ens33": {
        "outgoing": {
            "dst-network=192.168.1.2/32, protocol=ip": {
                "delay": 100,
                "rate": "50K"
            },
            "dst-network=192.168.1.3/32, protocol=ip": {
                "delay": 200,
                "rate": "60K"
            }
        },
        "incoming": {}
    }
}

@dastergon
Copy link
Contributor Author

Thanks for the update!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants