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

Duplicate IP addresses in the interface file are not handled well. #284

Open
VigneshSP94 opened this issue Nov 22, 2023 · 0 comments
Open

Comments

@VigneshSP94
Copy link

VigneshSP94 commented Nov 22, 2023

Issue

We happen to have a duplicate IP address in the interface file, when ifreload encounters duplicate IP, it stop processing and silently exits with status code 0.

info: vip: primary ip changed (from 100.0.7.30/32 to 100.0.5.234/32) we need to purge all ip addresses and re-add them #finds ip primary ip changes and deleteing all ips from the interface
info: vip: netlink: ip addr del 100.0.5.234/32 dev vip
info: vip: netlink: ip addr del 100.0.1.120/32 dev vip
..
..
info: vip: netlink: ip addr del 100.0.6.28/32 dev vip
info: vip: netlink: ip addr add 100.0.7.30/32 dev vip scope link #starts adding
info: vip: netlink: ip addr add 100.0.2.0/32 dev vip scope link 
info: vip: netlink: ip addr add 100.0.2.0/32 dev vip scope link # finds this ip second time
info: executing /etc/network/if-pre-up.d/wpasupplicant
info: executing /etc/network/if-up.d/wpasupplicant
info: executing /etc/network/if-up.d/postfix
info: executing /etc/network/if-up.d/nslcd
info: exit status 0 #quits silently with 

def __add_ip_addresses_with_attributes(self, ifaceobj, ifname, user_config_ip_addrs):

We added a print statement in this function to identify the error.

image
info: vip: netlink: ip addr add 100.0.4.0/32 dev vip scope link
info: vip: netlink: ip addr add 100.0.4.0/32 dev vip scope link
netlink: vip: cannot add address 100.0.4.0/32 dev vip: operation failed with 'File exists' (17) <====
info: executing /etc/network/if-pre-up.d/wpasupplicant
info: executing /etc/network/if-up.d/wpasupplicant
info: executing /etc/network/if-up.d/postfix
info: executing /etc/network/if-up.d/nslcd
info: exit status 0

ifreload version

#ifreload --version
ifupdown2:3.0.0-1

Expectation

ifreload should not exit with status code 0 during issue.
skipping duplicate addresses.

@VigneshSP94 VigneshSP94 changed the title test test Duplicate IP addresses in the interface file are not handled well. Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant