Bug 271308 - [FIB] File exists while adding IPv4
Summary: [FIB] File exists while adding IPv4
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 13.2-STABLE
Hardware: Any Any
: --- Affects Some People
Assignee: Alexander V. Chernikov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-05-08 07:42 UTC by Konrad
Modified: 2023-11-25 11:18 UTC (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Konrad 2023-05-08 07:42:15 UTC
Hello,
I have jail with vlans and bird with full feed.
After upgrade from 13.1/Stable to 13.2/Stable I can't add subnet do interface when it exists in the routing table, e.g.:

route -nv get 10.8.3.1
RTA_DST: inet 10.8.3.1; RTA_IFP: link ; RTM_GET: Report Metrics: len 224, pid: 0, seq 1, errno 0, flags:<UP,GATEWAY,HOST,STATIC>
locks:  inits:
sockaddrs: <DST,IFP>
 10.8.3.1 link#0
   route to: 10.8.3.1
destination: 10.8.3.0
       mask: 255.255.255.0
    gateway: xx.xx.92.217
        fib: 0
  interface: vlan4007
      flags: <UP,GATEWAY,DONE,PROTO1>
 recvpipe  sendpipe  ssthresh  rtt,msec    mtu        weight    expire
       0         0         0         0      1500         1         0

locks:  inits:
sockaddrs: <DST,GATEWAY,NETMASK,IFP,IFA>
 10.8.3.0 xx.xx.92.217 255.255.255.0 vlan4007:0.7.43.6c.f3.d0 xx.xx.92.218

# birdc show route for 10.8.3.1
BIRD 2.13 ready.
Table master4:
10.8.3.0/24          unicast [CORE_OSPF 09:31:03.342] * E1 (150/31) [xx.xx.58.18]
        via xx.xx.92.217 on vlan4007


# ifconfig vlan40 10.8.3.1/24 alias
ifconfig: ioctl (SIOCAIFADDR): File exists

Problem is with the same size len of prefixes. If I try to add more specific

# ifconfig vlan40 10.8.3.1/25 alias

not errors, IPv4 has been added
Comment 1 Konrad 2023-05-10 11:39:45 UTC
for clarification 
I move vlans from host to jail (vnet)
Comment 2 Janak Trivedi 2023-07-12 11:58:27 UTC
I am facing exactly the same issue when adding new interface on both firewalls in cluster, it won't allow to create interface on secondary firewall. It gives the same error as mentioned above

# /etc/rc.d/netif start vlan113
Created clone interfaces: vlan113.
ifconfig: ioctl (SIOCAIFADDR): File exists
Starting Network: vlan113.
vlan113: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
        description: DEV-PF-AR-IC
        options=1c680703<RXCSUM,TXCSUM,TSO4,TSO6,LRO,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6,NOMAP,TXTLS4,TXTLS6>
        ether b8:3f:d2:9f:09:ca
        inet 10.59.255.65 netmask 0xffffffff broadcast 10.59.255.65 vhid 31
        groups: vlan
        carp: BACKUP vhid 31 advbase 1 advskew 150
        vlan: 113 vlanproto: 802.1q vlanpcp: 0 parent interface: lagg0
        media: Ethernet autoselect
        status: active
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>


Any help would be much appreciated.


I am using 13.2-RELEASE-p1 currently and this issue started immediately after upgrade from 13.1 to 13.2.
Comment 3 Graham Perrin freebsd_committer freebsd_triage 2023-07-14 16:34:13 UTC
^Triage: 

- make the former assignee a cc recipient

- status, severity.
Comment 4 Janak Trivedi 2023-08-03 09:08:23 UTC
Any help/inputs around it would be much appreciated.
Comment 5 Konrad 2023-09-25 10:32:09 UTC
simpler reproduction:


FreeBSD 13.1-STABLE #24 stable/13-56caa9e82b-dirty: Wed Sep  7 20:17:15 CEST 2022:
without options NETLINK, works corretly:


root@:~ # ifconfig bge1 10.20.20.254/24
root@:~ # route add 192.168.100.0/24 10.20.20.254
add net 192.168.100.0: gateway 10.20.20.254
root@:~ # ifconfig bge3 192.168.100.254/24

root@:~ # netstat -rn
Routing tables

Internet:
Destination        Gateway            Flags     Netif Expire
10.20.20.0/24      link#4             U          bge1
10.20.20.254       link#4             UHS         lo0
127.0.0.1          link#9             UH          lo0
192.168.100.0/24   link#6             U          bge3
192.168.100.254    link#6             UHS         lo0



FreeBSD 13.2-STABLE #6 stable/13-651e037e2-dirty: Mon May  8 00:55:17 CEST 2023:
with options NETLINK

root@:~ # ifconfig bge1 10.20.20.254/24
root@:~ # route add 192.168.100.0/24 10.20.20.254
add net 192.168.100.0: gateway 10.20.20.254
root@:~ # ifconfig bge3 192.168.100.254/24
ifconfig: ioctl (SIOCAIFADDR): File exists



Freebsd 14.0-STABLE #0 stable/14-n265212-84266fb897e6: Sat Sep 23 21:40:58 CEST 2023:
with options NETLINK

root@:~ # ifconfig bge1 10.20.20.254/24
root@:~ # route add 192.168.100.0/24 10.20.20.254
add net 192.168.100.0: gateway 10.20.20.254
root@:~ # ifconfig bge3 192.168.100.254/24
ifconfig: ioctl (SIOCAIFADDR): File exists

root@b:~ # netstat -rn
Routing tables

Internet:
Destination        Gateway            Flags     Netif Expire
10.20.20.0/24      link#2             U          bge1
10.20.20.254       link#5             UHS         lo0
127.0.0.1          link#5             UH          lo0
192.168.100.0/24   10.20.20.254       UGS        bge1
Comment 6 Konrad 2023-11-25 11:18:36 UTC
The problem mainly bothersome during CARP configuration:

R1 nad R2 see their routes through OSPF

R1:
#ifconfig vlan5 100.64.0.253/24
#ifconfig vlan5 100.64.0.254/32 vhid 1 advskew 50 alias
#

R2:
#ifconfig vlan5 100.64.0.252/24 alias
ifconfig: ioctl (SIOCAIFADDR): File exists
#