Bug 271168 - [carp] Packets send to carp gateway are forwarded to all ECMP routes
Summary: [carp] Packets send to carp gateway are forwarded to all ECMP routes
Status: Closed Not A Bug
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-net (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-05-01 13:57 UTC by Arnaud HOUDELETTE
Modified: 2023-05-01 15:57 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Arnaud HOUDELETTE 2023-05-01 13:57:39 UTC

    
Comment 1 Arnaud HOUDELETTE 2023-05-01 14:05:51 UTC
Considering this scenario : 

              +--------------------------+
              |                          |
+--------+    |        FreeBSD           |
| Host 1 +----+ifAdm   router box        |
+--------+    |carp                      |
              |                          |
              |   vl10             vl11  |
              +-----+---------------+----+
                    |               |
                 +--+---+        +--+---+
                 | RT-A |        | RT-B |
                 +--+---+        +---+--+
                    |                |
                  --+---------+------+----
                              |
                          +---+----+
                          | Host 2 |
                          +--------+


Carp ifAdm IP is default gateway for Host 1
The router box as two routes to Host 2 network (ECMP), via RT-A and RT-B

Packets send by Host 1 to Host 2 are received twice (via RT-A and RT-B).

carp if is configured as follow : 

ifconfig_ifAdm="169.254.1.1/24"
ifconfig_ifAdm_alias0="inet vhid 1 pass testpass alias 195.220.135.193/26"

removing carp on interface does not show the issue :
ifconfig_ifAdm_alias0="inet alias 195.220.135.193/26"
Comment 2 Alexander V. Chernikov freebsd_committer freebsd_triage 2023-05-01 15:05:12 UTC
Could you share ifconfig, netstat -4rnW and, most importantly, the tcpdump -lnvvs0 output from both vl10 and vl11 interfaces?
Comment 3 Arnaud HOUDELETTE 2023-05-01 15:57:46 UTC
After more investigation on the issue, it appears that the culprit was the second carp router which deconfigured carp interface continued to process packets to the carp MAC address.

Will submit another PR if (and only if) I manage to reproduce on a virtual environment.