1
0
mirror of https://github.com/CumulusNetworks/ifupdown2.git synced 2024-05-06 15:54:50 +00:00
Commit Graph

1549 Commits

Author SHA1 Message Date
Adrien Banlin
21a7bd2d91 address: check interface exists before settling dad 2022-04-08 16:00:25 +02:00
Adrien Banlin
eb6ad1f78a addons: address: update modinfo for dad attributes
Help infos came from the ifupdown (original) manual.
2022-04-08 16:00:25 +02:00
Adrien Banlin
d594fb86ca addons: address: up: wait on dad when needed 2022-04-08 16:00:25 +02:00
Adrien Banlin
b99c724a89 addons: address: add a settle dad method
_settle_dad will allow ifupdown2 to wait on ipv6 dad tentative.
2022-04-08 16:00:25 +02:00
Adrien Banlin
beaffab603 addons: address: disable dad on no attempts 2022-04-05 14:46:13 +02:00
Adrien Banlin
f4764e0f96 addons: address: add dad handling module global
Upon ipv6_dad_handling_enabled module global parameter set to true, the
address addon will handle ipv6 dad tentatives by either
* set nodad when adding an ipv6 address
* waiting for dad to finish or warn of a timeout

This handling should be quick close to the ifupdown process.
2022-04-05 14:46:13 +02:00
Adrien Banlin
24be632e93 nlcache: add nodad parameter to addr_add 2022-04-05 14:46:13 +02:00
Adrien Banlin
033683bb81 nlpacket: change IFA_FLAGS to a FourByte attribute
AttributeGeneric cannot be used unless having it's length defined.

This change allow address flags such as optimistic, nodad or others
to be set with the add_attribute packet method.
2022-04-05 14:46:13 +02:00
Julien Fortin
ac32bec0e2 Merge pull request #231 from CumulusNetworks/revert-230-dad_handling
Revert "Dad handling"
2022-03-25 14:30:10 +01:00
Julien Fortin
3fd6c20143 Revert "Dad handling" 2022-03-25 14:29:51 +01:00
Julien Fortin
238787a55f Merge pull request #230 from sohorx/dad_handling
addons: address: add support for DAD
2022-03-25 14:24:54 +01:00
Adrien Banlin
cccdaa46a8 addons: address: update modinfo for dad attributes
Help infos came from the ifupdown (original) manual.
2022-03-25 13:12:51 +01:00
Adrien Banlin
06a49cda4f addons: address: up: wait on dad when needed 2022-03-25 13:12:51 +01:00
Adrien Banlin
aa121e105e addons: address: add a settle dad method
_settle_dad will allow ifupdown2 to wait on ipv6 dad tentative.
2022-03-25 13:12:51 +01:00
Adrien Banlin
33c30d13b1 addons: address: disable dad on no attempts 2022-03-25 12:36:41 +01:00
Adrien Banlin
12d4bd8f7e networkinterfaces: dad attrs placement behavior
Fix the dad-attempts and dad-interval placement behavior to be linked
against it's related address.
2022-03-25 12:34:02 +01:00
Adrien Banlin
98743cb1ff addons: address: get new dad attributes
dad-attempts and dad-interval can now be taken from the interfaces
file.

Those attributes names came from ifupdown (original).
2022-03-25 12:30:27 +01:00
Adrien Banlin
d7e9168692 nlcache: add nodad parameter to addr_add 2022-03-25 12:23:43 +01:00
Adrien Banlin
57e246438d nlpacket: change IFA_FLAGS to a FourByte attribute
AttributeGeneric cannot be used unless having it's length defined.

This change allow address flags such as optimistic, nodad or others
to be set with the add_attribute packet method.
2022-03-25 12:18:20 +01:00
Julien Fortin
ad1c11eeb7 Merge pull request #228 from dverbroekkenexnl/patch-1
Update iface.py : Corrected a typo when the interface is set to KEEP_LINK_DOWN
2022-02-11 17:06:29 +01:00
dverbroekkenexnl
87b8907951 Update iface.py
Corrected a typo then the interface is set to KEEP_LINK_DOWN
2022-02-11 16:43:41 +01:00
Julien Fortin
24d5192df2 addons: vlan: retry vlan creation if bridge_binding capability is missing
On older ubuntu version bridge_binding is not supported, we can't rely
on `ip link help` to detect this. We have manually check if the first
netlink request is rejected then retry with iproute2.

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2022-02-11 12:33:49 +01:00
Julien Fortin
03cd34767b Merge pull request #220 from Manawyrm/wait-for-udev
debian: Run ifupdown2 after udev has settled
2022-01-28 16:37:15 +01:00
Julien Fortin
f89c3bd9e2 Merge pull request #219 from Carbenium/source-directory
networkinterfaces: support source-directory statement
2022-01-06 14:53:26 +01:00
Peter Keresztes Schmidt
0b48d2cf7c implement code review 2022-01-06 12:52:27 +01:00
Peter Keresztes Schmidt
9a810db109 networkinterfaces: support relative paths in source/source-directory statements
According to interfaces(5) [1]:
When sourcing files or directories, if a path doesn't have a leading slash, it's considered relative to the directory containing the file in which the keyword is placed. In the example above, if the file is located at /etc/network/interfaces, paths to the included files are understood to be under /etc/network.

Adapt the implementation to adhere to the documented behaviour.

[1] https://manpages.debian.org/buster/ifupdown/interfaces.5.en.html
2022-01-06 12:27:38 +01:00
Peter Keresztes Schmidt
0845cc57b2 networkinterfaces: support source-directory statement
ifupdown supports the "source-directory" statement that include the content of the specified directory.
See [1] for details.
Implement the statement to improve compatibility with ifupdown.

Fixes #191

[1] https://manpages.debian.org/buster/ifupdown/interfaces.5.en.html
2022-01-06 12:09:07 +01:00
Julien Fortin
b5bed16cbe Merge pull request #225 from devicenull/master
Sort filenames in interfaces.d so they're parsed in a consistent order
2022-01-05 18:12:19 +01:00
Brian Rak
bb23b2f274 Sort filenames in interface.d so they're parsed in a consistent order 2022-01-05 11:28:19 -05:00
Julien Fortin
e495ed1740 Merge pull request #224 from polz113/polz113-xmit-hash-policy-vlan-srcmac
Update bond.py - add xmit-hash-policy vlan+srcmac
2022-01-05 16:24:01 +01:00
polz113
9a26f48f99 Add support for xmit-hash-policy vlan+srcmac
Add support for xmit-hash-policy 5 - vlan+srcmac, added in Linux 5.12.
2022-01-05 13:51:15 +01:00
Julien Fortin
5a3a162880 Merge pull request #223 from kvadrage/tunnel_tos_ttl_fix
addons: tunnel: add tunnel-tos attribute and "inherit" support
2021-12-06 15:59:33 +01:00
Alexander Petrovskiy
d290cfe8e7 addons: tunnel: new attribute: tunnel-tos
'tunnel-tos': {
    'help': 'TOS for tunnel packets (range 0..255), 1=inherit',
    "validrange": ["0", "255"],
    'validvals': ['<number>', 'inherit'],
    'required': False,
    'example': ['tunnel-tos inherit'],
    "aliases": ["tos"]
}

Signed-off-by: Alexander Petrovskiy <alexpe@nvidia.com>
2021-12-01 18:36:44 +03:00
Alexander Petrovskiy
4efd36fab0 addons: tunnel: add 'inherit' value to 'tunnel-ttl' attribute
Signed-off-by: Alexander Petrovskiy <alexpe@nvidia.com>
2021-12-01 17:43:29 +03:00
Julien Fortin
7d14f4d4e9 Merge pull request #170 from Jasperswaagman/master
Add none as valid value for bridge-ports on a bridge interface
2021-11-10 18:12:17 +01:00
Julien Fortin
1c1f8d4b12 Merge pull request #221 from li-kunkun/fix-default-route-add
Fix adding a static IPv6 default route failed on RA networks
2021-10-28 17:35:51 +02:00
Kunkun Li
cfc34b5b21 Fix adding a static IPv6 default route failed on RA networks
There may be adding a static IPv6 default route failed on networks where
router advertisements are also present.

The flow of up an interface is this:
1. ip link set dev $interface up
2. set sysctl config
3. config ip addr
4. config default ip route

After setting the link up, the kernel might learning an address and a
default route from RA before the default route config. The default route
will fail to be added. If the RA route is expired, and not be refreshed
for some reasons,the system looses IPv6 network connectivity.

Proposed fix is to use "route replace" instead of "route add". When the
RA learned route is still present it gets replaced, when it is not present
the route gets added.

Signed-off-by: Kunkun Li <likunkun@bytedance.com>
2021-10-25 17:08:31 +08:00
Tobias Mädel
bcd450241f debian: Run ifupdown2 after udev has settled 2021-09-27 16:58:28 +02:00
Julien Fortin
970c72e437 addons: vxlan: fix lib.addon.Vxlan import (fixes: #217)
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-08-26 13:44:05 +02:00
Julien Fortin
1bb6e6f0fb nlcache: fix TypeError: argument of type 'IPNetwork' is not iterable
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-30 11:58:54 +02:00
Julien Fortin
c2b847f7af addons: introduces old_ifaceobjs to get_dependent_ifacenames
Other addon modules need to access the list of old ifaceobjs

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-06 12:46:02 +02:00
Julien Fortin
15666526bf usercmd: fix TypeError: unsupported operand type(s) for |: '_Environ' and 'dict'
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-06 12:38:44 +02:00
Julien Fortin
a1d6115e35 debian: changelog: new 3.1.0-1 entry
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-05 19:35:41 +02:00
Julien Fortin
acfdbff891 nlcache: clean duplicated code (link_add)
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-05 17:00:44 +02:00
Julien Fortin
b334df6e88 nlcache: update link_set_bridge_info_data_dry_run
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-05 16:59:28 +02:00
Julien Fortin
9a6a305084 cleanups - upstream sync
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-02 18:20:42 +02:00
Julien Fortin
ba5437b9ec nlcache: addr_add: convert pointtopoint and broadcast attribute to ipaddress obj
the following config was broken:

auto swp1
iface swp1
      address 10.128.141.37/26
      broadcast 10.128.141.63

error: netlink: swp1: cannot add address 10.128.141.37/26 dev swp1: 'str' object has no attribute 'packed'

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-02 18:15:00 +02:00
Julien Fortin
f8ed376891 lib: nlcache: new netlink API "link_add" (waits for link creation)
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-02 18:11:09 +02:00
Julien Fortin
790a55e93e addons: link: ifquery-check now validates admin state
[12:57:29] root:~ # ifquery -a
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

auto swp1
iface swp1
        post-up ip link set dev swp1 down

auto swp2
iface swp2
        link-down yes

auto swp3
iface swp3
        link-down no

auto swp4
iface swp4

[12:57:29] root:~ #
[12:57:29] root:~ #
[12:57:30] root:~ #
[12:57:30] root:~ # ifquery -ac
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp                                                [pass]

auto swp1
iface swp1 (link is down)                                           [fail]
        post-up ip link set dev swp1 down                               []

auto swp2
iface swp2                                                          [pass]
        link-down yes                                               [pass]

auto swp3
iface swp3                                                          [pass]
        link-down no                                                [pass]

auto swp4
iface swp4

[12:57:31] root:~ #

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-02 18:07:34 +02:00
Julien Fortin
859b8643b6 nlcache: link_set_address: override cache after mac address change is aacked
after a successful mac change we should override our cache so that we don't
keep stale values in cache (in case the cache is queried before the kernel
notification arrives)

Signed-off-by: Julien Fortin <jfortin@nvidia.com>
2021-07-02 15:24:00 +02:00