Граф коммитов

34 Коммитов

Автор SHA1 Сообщение Дата
Alexander cc1ba097c7
ci: add delay after link creation for test add remove static arp (#2968)
fix by adding delay after link creation
2024-09-15 20:17:34 +00:00
Jaeryn 4168c62faa
test: validate secondary endpoint client failure (#2345)
test: validate secondary endpoint client failure will prevent endpoint creation

Co-authored-by: Jaeryn <tsch@microsoft.com>
2023-11-03 23:32:40 +00:00
tamilmani1989 0062d048af
fix: Remove NLM_F_EXCL flag from Netlink Delete call (#2150)
* fix: Remove unix.NLM_F_EXCL from Netlink Delete Route api call

unix.NLM_F_EXCL is not expected to set in netlink delete route calls. It's no-op in older kernel and didnt return error. From kernel 5.19+, new flag NLM_F_BULK was defined with same value and serves a purpose in delete route call. This changes breaks azure cni and netlink calls fails in 5.19 kernel and onwards.

The fix is to remove setting unix.NLM_F_EXCL in netlink delete route request.

* fix: Remove unix.NLM_F_EXCL from Netlink Delete Route api call

unix.NLM_F_EXCL is not expected to set in netlink delete route calls. It's no-op in older kernel and didnt return error. From kernel 5.19+, new flag NLM_F_BULK was defined with same value and serves a purpose in delete route call. This changes breaks azure cni and netlink calls fails in 5.19 kernel and onwards.

The fix is to remove setting unix.NLM_F_EXCL in netlink delete route request.

* Add unit tests for netlink add/delete address and add/delete routes
2023-08-18 09:14:20 -07:00
tamilmani1989 a82b312995
Set constant mac for host veth interface in transparent vlan mode (#1906)
* set constant mac for host veth interface

* fixed a race issue in transparent-vlan where delete can happen after add and removes route add by ADD call

* moved log to place where its executed

* enable proxy arp on bridge to allow public connectivity from apipa interface

* validate newly created namespace is not same as host namespace

* addressed comments and added UTs

* fixed cni delete call for linux multitenancy

* lint fixes

* windows lint fixes

* lint fixes

* fix issues with network namespace creation and vlan interface creation

* Removed deletehostveth flag and delete host veth on delete endpoint trigger

* lint fix

* address comment
2023-04-17 14:26:00 -07:00
Vipul Singh afcb977aa8
fix: Adding a constant hardware address to the veth (#1524)
* Adding constant hardware address to the veth

* update the variable and error log message

* Removing the shadow variable

* Removing the shadow variable

* Adding the hardware ad address while endpoint creation

* Refactoring based on the comments

* Updated based on comments

* removing merge conflicts

* update the function parameter

* Addressing comments

* go lint errors

* updating the IPAddr variable

* updating the state to NUD PROBE for transparent endpoint

Co-authored-by: root <root@DESKTOP-IS3TR2T.redmond.corp.microsoft.com>
2022-08-17 10:53:57 -07:00
tamilmani1989 279911c94a
Support for Dualstack transparent (#1046)
* ipv6 dualstack support transparent mode

* golint fixes

* fixed linter errors

* enable ipv6 setting

* dualstack transparent changes

* abstracted platform execute command

* lint fixes
fix compilation issues

* addressed comments

* fixed a bug
2021-10-15 14:28:37 -07:00
tamilmani1989 f9c4b8549a
Set MTU for veths based on VM interface (#1031)
* Set MTU for veths based on VM interface

* ignore setmtu error
2021-09-22 17:28:50 -07:00
tamilmani1989 2bd3c74811
Netlink package interfacing and adding a fake (#996) (#1025)
* Initial pass at Netlink interface

* changing some netlink and epc

* Resolcing all dependencies on netlink package

* first pass at adding a netlinkinterface

* windows working now

* feat: update cns client (#992)

* fix debug commands

Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>

* fix: update cns client

Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>

* add ctx to debug calls

Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>

* repackage cns client

Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>

* add ctx to all methods and preinit all route urls

Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>

* down-scope cns client interface and move to consumer packages

Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>

* no unkeyed struct literals

Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>

* trace updated client method signatures out through windows paths

* delint

Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>

* fix windows build

Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>

* delint

Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>

* windows working now

* Some golints checks

* commenting a flaky NPM UT and adding some golint checks

* renaming fakenetlink to mocknetlink

* removing a mock netlink usage

* fixing more golints and a test fix

* fixing more go lints

* Adding in netlink from higher level as input

* adding netlinkinterface to windows endpoint impl

* removing netlink name confusion

Co-authored-by: Evan Baker <rbtr@users.noreply.github.com>

Co-authored-by: Vamsi Kalapala <vakr@microsoft.com>
Co-authored-by: Evan Baker <rbtr@users.noreply.github.com>
2021-09-20 13:57:12 -05:00
Evan Baker 96bec09d41
chore: appease the linter (3/?), the big gofumpt (#987)
* gofumpt -w -s .

* small addtl cleanups after gofumpt

* rerun after rebase
2021-09-02 16:33:18 -05:00
Evan Baker 1087201b28
chore: appease the linter, pt 2 of ? (#925) 2021-09-01 18:28:17 -05:00
tamilmani1989 6ac5e8c9f0
CNI Ipv6 Dualstack Support (#538)
* added cniv6 plugin

* cni ipv6 base framework

* removed unwanted changes

* added ipv6 change

* added cni ipv6 changes

* drop neighbor discovery messages to other VMs

* fixed issues

* fixed unit tests

* fix nil dereference

* addressed comments

* ipv6 fixes and changes

* addressed comments
2020-04-15 22:30:48 -07:00
tamilmani1989 b7f6742b7f CNI to support transparent mode (#279)
* added changes in azure cni to support transparent mode

* cni for calico policy controller

* removed unused parameter

* minor fix

* addressed review comments

* addressed review comments

* modified vethname generation and the hostbveth prefix

* removed setting arp for default gw

* minor fix
2019-01-04 16:19:36 -08:00
tamilmani1989 a1b4da1b90 Adding/Remove static arp entry for pod IP in VM (#273)
* add static arp entry in vm (for bridge mode and singletenancy) whenever pod created and remove when its deleted
2018-12-11 11:18:11 -08:00
John Howard a386846345 Store fixes; Windows compile
Signed-off-by: John Howard <jhoward@microsoft.com>

- First, the store timeout is woefully low. Bumped to 20 seconds from 2 seconds.
  This may fix https://github.com/Azure/azure-container-networking/issues/242#issuecomment-422701838
  IMO, as only test code calls it non-blocked, why even have a block parameter to Lock()?
  IMO also, why a timeout at all? They're always fraught with error and machine timing.

- Presence of a key should be checked using `raw, ok := hvs.data[key]`, not the current nil checked

- ErrKeyNotFound should be returned if the store file does not exist. It shouldn't ignore that error.

- Actually now reports if a timeout occurred correctly, along with non-block lock attempt when already locked.

- Serial pattern abuse in not always closing the lock file.

- Some golang correctness (errors should be lower case)

- go build ./... actually passes on Windows now - various compile errors previously.

- golang pattern conformance `if err:=<test>; err!=nil {....`

- Simplified timeout duration (no need for time.Duration(...))
2018-09-19 15:30:36 -07:00
jaer-tsun 431ac08469 Enable Circleci (#220)
Enable CircleCi
2018-08-14 12:08:48 -07:00
Tamilmani Manoharan 5ba70f9092 Made changes in netlink code to ignore interface not found error 2017-10-18 17:15:53 -07:00
Onur Filiz 3755884713 Enabled hairpin mode for bridged external interface 2017-03-31 06:45:28 -07:00
Onur Filiz 2473ccba2e Added support for creating links in up state 2017-03-01 13:13:27 -08:00
Onur Filiz 903ff36e69 Added IPVLAN link support 2017-02-28 01:27:20 -08:00
Onur Filiz db1901b6c6 Refactored netlink API into link and IP modules 2017-02-28 00:54:17 -08:00
Onur Filiz 02e9bde40a Refactored netlink API into link and IP modules 2017-02-28 00:34:27 -08:00
Onur Filiz 5c8ffd0f16 Improved link tests 2017-02-27 23:59:10 -08:00
Onur Filiz 437f7876d7 Added license notice to all source files 2017-02-12 02:03:39 -08:00
Onur Filiz 9b63cd3635 Exposed GetIpAddressFamily and updated comments for godoc 2016-12-12 15:58:15 -08:00
Onur Filiz 99e37e8a8f Reset netlink sockets when changing network namespaces 2016-11-22 15:24:28 -08:00
Onur Filiz 5d24b3f411 Added APIs to set interface names and namespaces 2016-11-18 15:01:48 -08:00
Onur Filiz deb2a6d291 Updated package references with new repo name 2016-10-06 14:40:29 -07:00
Onur Filiz 9b13aa09f6 Updated netlink socket calls to log at debug level 2016-06-05 20:58:47 -07:00
Onur Filiz 5492e7279c Fixed code formatting, go fmt 2016-06-05 13:45:12 -07:00
Onur Filiz 1d5ecba14b Implemented netlink route functionality 2016-06-05 06:42:14 -07:00
Onur Filiz 40af7bbc66 Added netlink interface management APIs 2016-04-18 18:17:49 -07:00
Onur Filiz edb88661b1 Removed old netlink package 2016-04-18 18:11:39 -07:00
Onur Filiz 60bbd4b52f Added netlink package 2016-04-18 18:09:24 -07:00
Sushant Sharma 5dec368fde Support in Penguin for Multi CA enabled NICs. Logging to be fixed. 2016-03-07 21:17:08 -08:00