when client is in INIT-REBOOT state DHCP4_LEASE_ADVERT packets and log falls into infinite loop and flooding network.
Describe the bug I'm using kea 2.2.0 with postgresql as lease database. Both postgresql and kea running on same server. When a client in INIT-REBOOT state, it starts to flood network. logs and tcpdump output is below. I also checked the timezones on both operating system and postgresql db. Both of them is same. But there is no problem on kea 1.6.x. thanks
To Reproduce Steps to reproduce the behavior:
- Start dhcp4 daemon
- Client request new lease
- Client got the lease
- Disable client network interface and then enable.
- Problem reproduced
Environment:
-
Kea version: 2.2.0 tarball linked with: log4cplus 1.1.2 OpenSSL 1.1.1q-freebsd 5 Jul 2022
-
OS: FreeBSD stable/13 amd64
-
Which features were compiled in (in particular which backends) database: PostgreSQL backend 13.0, library 140005 Memfile backend 2.1
-
If/which hooks where loaded in: NONE
Additional Information
{
"Dhcp4": {
"interfaces-config": {
"interfaces": [
"em4"
]
},
"lease-database": {
"type": "postgresql",
"name": "dhcp",
"user": "postgres",
"password": ""
},
"expired-leases-processing": {
"reclaim-timer-wait-time": 10,
"flush-reclaimed-timer-wait-time": 25,
"hold-reclaimed-time": 3600,
"max-reclaim-leases": 100,
"max-reclaim-time": 250,
"unwarned-reclaim-cycles": 5
},
"valid-lifetime": 86400,
"option-def": [],
"option-data": [
{
"name": "domain-name-servers",
"data": "8.8.8.8"
}
],
"subnet4": [
{
"subnet": "192.168.60.0/24",
"id": 11,
"reservations": [],
"option-data": [
{
"name": "routers",
"data": "192.168.60.1"
}
],
"pools": [
{
"pool": "192.168.60.10 - 192.168.60.250"
}
]
}
],
"loggers": [
{
"name": "kea-dhcp4.leases",
"output_options": [
{
"output": "/var/log/dhcp/kea-dhcp4-leases.log",
"flush": true
}
],
"severity": "INFO"
}
]
}
}
2022-11-22 09:41:05.051 INFO [kea-dhcp4.leases/36918.0x836713000] DHCP4_INIT_REBOOT [hwtype=1 00:0c:29:74:25:16], cid=[01:00:0c:29:74:25:16], tid=0xe792cb55: client is in INIT-REBOOT state and requests address 192.168.60.11
2022-11-22 09:41:06.083 INFO [kea-dhcp4.leases/36918.0x836713000] DHCP4_LEASE_ADVERT [hwtype=1 00:0c:29:74:25:16], cid=[01:00:0c:29:74:25:16], tid=0xb23c29aa: lease 192.168.60.11 will be advertised
2022-11-22 09:41:06.088 INFO [kea-dhcp4.leases/36918.0x836713000] DHCP4_LEASE_ADVERT [hwtype=1 00:0c:29:74:25:16], cid=[01:00:0c:29:74:25:16], tid=0xf7e75ffc: lease 192.168.60.11 will be advertised
2022-11-22 09:41:06.094 INFO [kea-dhcp4.leases/36918.0x836713000] DHCP4_LEASE_ADVERT [hwtype=1 00:0c:29:74:25:16], cid=[01:00:0c:29:74:25:16], tid=0x478f22c7: lease 192.168.60.11 will be advertised
2022-11-22 09:41:06.099 INFO [kea-dhcp4.leases/36918.0x836713000] DHCP4_LEASE_ADVERT [hwtype=1 00:0c:29:74:25:16], cid=[01:00:0c:29:74:25:16], tid=0x227a6337: lease 192.168.60.11 will be advertised
2022-11-22 09:41:06.106 INFO [kea-dhcp4.leases/36918.0x836713000] DHCP4_LEASE_ADVERT [hwtype=1 00:0c:29:74:25:16], cid=[01:00:0c:29:74:25:16], tid=0x1a30b34f: lease 192.168.60.11 will be advertised
2022-11-22 09:41:06.111 INFO [kea-dhcp4.leases/36918.0x836713000] DHCP4_LEASE_ADVERT [hwtype=1 00:0c:29:74:25:16], cid=[01:00:0c:29:74:25:16], tid=0x58535b6a: lease 192.168.60.11 will be advertised
2022-11-22 09:41:06.116 INFO [kea-dhcp4.leases/36918.0x836713000] DHCP4_LEASE_ADVERT [hwtype=1 00:0c:29:74:25:16], cid=[01:00:0c:29:74:25:16], tid=0xc16e275a: lease 192.168.60.11 will be advertised
2022-11-22 09:41:06.125 INFO [kea-dhcp4.leases/36918.0x836713000] DHCP4_LEASE_ADVERT [hwtype=1 00:0c:29:74:25:16], cid=[01:00:0c:29:74:25:16], tid=0xb65b6927: lease 192.168.60.11 will be advertised
2022-11-22 09:41:06.134 INFO [kea-dhcp4.leases/36918.0x836713000] DHCP4_LEASE_ADVERT [hwtype=1 00:0c:29:74:25:16], cid=[01:00:0c:29:74:25:16], tid=0x7be635aa: lease 192.168.60.11 will be advertised
2022-11-22 09:41:06.146 INFO [kea-dhcp4.leases/36918.0x836713000] DHCP4_LEASE_ADVERT [hwtype=1 00:0c:29:74:25:16], cid=[01:00:0c:29:74:25:16], tid=0xaf4b5c5b: lease 192.168.60.11 will be advertised
2022-11-22 09:41:06.152 INFO [kea-dhcp4.leases/36918.0x836713000] DHCP4_LEASE_ADVERT [hwtype=1 00:0c:29:74:25:16], cid=[01:00:0c:29:74:25:16], tid=0x4cc774cb: lease 192.168.60.11 will be advertised
2022-11-22 09:41:06.158 INFO [kea-dhcp4.leases/36918.0x836713000] DHCP4_LEASE_ADVERT [hwtype=1 00:0c:29:74:25:16], cid=[01:00:0c:29:74:25:16], tid=0xe837858e: lease 192.168.60.11 will be advertised
2022-11-22 09:41:06.166 INFO [kea-dhcp4.leases/36918.0x836713000] DHCP4_LEASE_ADVERT [hwtype=1 00:0c:29:74:25:16], cid=[01:00:0c:29:74:25:16], tid=0xdb492582: lease 192.168.60.11 will be advertised
2022-11-22 09:41:06.171 INFO [kea-dhcp4.leases/36918.0x836713000] DHCP4_LEASE_ADVERT [hwtype=1 00:0c:29:74:25:16], cid=[01:00:0c:29:74:25:16], tid=0x98bbe059: lease 192.168.60.11 will be advertised
2022-11-22 09:41:06.175 INFO [kea-dhcp4.leases/36918.0x836713000] DHCP4_LEASE_ADVERT [hwtype=1 00:0c:29:74:25:16], cid=[01:00:0c:29:74:25:16], tid=0x90248fe0: lease 192.168.60.11 will be advertised
2022-11-22 09:41:06.182 INFO [kea-dhcp4.leases/36918.0x836713000] DHCP4_LEASE_ADVERT [hwtype=1 00:0c:29:74:25:16], cid=[01:00:0c:29:74:25:16], tid=0xf73ad98c: lease 192.168.60.11 will be advertised
2022-11-22 09:41:06.187 INFO [kea-dhcp4.leases/36918.0x836713000] DHCP4_LEASE_ADVERT [hwtype=1 00:0c:29:74:25:16], cid=[01:00:0c:29:74:25:16], tid=0x1d102c80: lease 192.168.60.11 will be advertised
tcpdump -vvvni em4 port 67
10:02:14.321641 IP (tos 0x0, ttl 128, id 23694, offset 0, flags [none], proto UDP (17), length 353)
0.0.0.0.68 > 255.255.255.255.67: [udp sum ok] BOOTP/DHCP, Request from 00:0c:29:74:25:16, length 325, xid 0x5e34cacf, Flags [none] (0x0000)
Client-Ethernet-Address 00:0c:29:74:25:16
Vendor-rfc1048 Extensions
Magic Cookie 0x63825363
DHCP-Message Option 53, length 1: Request
Client-ID Option 61, length 7: ether 00:0c:29:74:25:16
Requested-IP Option 50, length 4: 192.168.60.11
Server-ID Option 54, length 4: 192.168.60.1
Hostname Option 12, length 8: "MRS-SVR1"
FQDN Option 81, length 23: "MRS-SVR1.etest.local"
Vendor-Class Option 60, length 8: "MSFT 5.0"
Parameter-Request Option 55, length 13:
Subnet-Mask, Default-Gateway, Domain-Name-Server, Domain-Name
Router-Discovery, Static-Route, Vendor-Option, Netbios-Name-Server
Netbios-Node, Netbios-Scope, Classless-Static-Route, Classless-Static-Route-Microsoft
Option 252
END Option 255, length 0
10:02:14.322783 IP (tos 0x10, ttl 128, id 0, offset 0, flags [DF], proto UDP (17), length 287)
192.168.60.1.67 > 255.255.255.255.68: [udp sum ok] BOOTP/DHCP, Reply, length 259, xid 0x5e34cacf, Flags [none] (0x0000)
Client-Ethernet-Address 00:0c:29:74:25:16
Vendor-rfc1048 Extensions
Magic Cookie 0x63825363
DHCP-Message Option 53, length 1: NACK
Server-ID Option 54, length 4: 192.168.60.1
Client-ID Option 61, length 7: ether 00:0c:29:74:25:16
END Option 255, length 0
10:02:14.323964 IP (tos 0x0, ttl 128, id 23695, offset 0, flags [none], proto UDP (17), length 328)
0.0.0.0.68 > 255.255.255.255.67: [udp sum ok] BOOTP/DHCP, Request from 00:0c:29:74:25:16, length 300, xid 0xccf3faec, Flags [none] (0x0000)
Client-Ethernet-Address 00:0c:29:74:25:16
Vendor-rfc1048 Extensions
Magic Cookie 0x63825363
DHCP-Message Option 53, length 1: Discover
Client-ID Option 61, length 7: ether 00:0c:29:74:25:16
Hostname Option 12, length 8: "MRS-SVR1"
Vendor-Class Option 60, length 8: "MSFT 5.0"
Parameter-Request Option 55, length 13:
Subnet-Mask, Default-Gateway, Domain-Name-Server, Domain-Name
Router-Discovery, Static-Route, Vendor-Option, Netbios-Name-Server
Netbios-Node, Netbios-Scope, Classless-Static-Route, Classless-Static-Route-Microsoft
Option 252
END Option 255, length 0
PAD Option 0, length 0, occurs 12
10:02:14.325014 IP (tos 0x10, ttl 128, id 0, offset 0, flags [DF], proto UDP (17), length 321)
192.168.60.1.67 > 192.168.60.11.68: [udp sum ok] BOOTP/DHCP, Reply, length 293, xid 0xccf3faec, Flags [none] (0x0000)
Your-IP 192.168.60.11
Client-Ethernet-Address 00:0c:29:74:25:16
Vendor-rfc1048 Extensions
Magic Cookie 0x63825363
DHCP-Message Option 53, length 1: Offer
Subnet-Mask Option 1, length 4: 255.255.255.0
Default-Gateway Option 3, length 4: 192.168.60.1
Domain-Name-Server Option 6, length 4: 8.8.8.8
Hostname Option 12, length 8: "mrs-svr1"
Lease-Time Option 51, length 4: 86400
Server-ID Option 54, length 4: 192.168.60.1
Client-ID Option 61, length 7: ether 00:0c:29:74:25:16
END Option 255, length 0
10:02:14.326155 IP (tos 0x0, ttl 128, id 23696, offset 0, flags [none], proto UDP (17), length 353)
0.0.0.0.68 > 255.255.255.255.67: [udp sum ok] BOOTP/DHCP, Request from 00:0c:29:74:25:16, length 325, xid 0xccf3faec, Flags [none] (0x0000)
Client-Ethernet-Address 00:0c:29:74:25:16
Vendor-rfc1048 Extensions
Magic Cookie 0x63825363
DHCP-Message Option 53, length 1: Request
Client-ID Option 61, length 7: ether 00:0c:29:74:25:16
Requested-IP Option 50, length 4: 192.168.60.11
Server-ID Option 54, length 4: 192.168.60.1
Hostname Option 12, length 8: "MRS-SVR1"
FQDN Option 81, length 23: "MRS-SVR1.etest.local"
Vendor-Class Option 60, length 8: "MSFT 5.0"
Parameter-Request Option 55, length 13:
Subnet-Mask, Default-Gateway, Domain-Name-Server, Domain-Name
Router-Discovery, Static-Route, Vendor-Option, Netbios-Name-Server
Netbios-Node, Netbios-Scope, Classless-Static-Route, Classless-Static-Route-Microsoft
Option 252
END Option 255, length 0
10:02:14.327744 IP (tos 0x10, ttl 128, id 0, offset 0, flags [DF], proto UDP (17), length 287)
192.168.60.1.67 > 255.255.255.255.68: [udp sum ok] BOOTP/DHCP, Reply, length 259, xid 0xccf3faec, Flags [none] (0x0000)
Client-Ethernet-Address 00:0c:29:74:25:16
Vendor-rfc1048 Extensions
Magic Cookie 0x63825363
DHCP-Message Option 53, length 1: NACK
Server-ID Option 54, length 4: 192.168.60.1
Client-ID Option 61, length 7: ether 00:0c:29:74:25:16
END Option 255, length 0
10:02:14.330192 IP (tos 0x0, ttl 128, id 23697, offset 0, flags [none], proto UDP (17), length 328)
0.0.0.0.68 > 255.255.255.255.67: [udp sum ok] BOOTP/DHCP, Request from 00:0c:29:74:25:16, length 300, xid 0x7ff14c60, Flags [none] (0x0000)
Client-Ethernet-Address 00:0c:29:74:25:16
Vendor-rfc1048 Extensions
Magic Cookie 0x63825363
DHCP-Message Option 53, length 1: Discover
Client-ID Option 61, length 7: ether 00:0c:29:74:25:16
Hostname Option 12, length 8: "MRS-SVR1"
Vendor-Class Option 60, length 8: "MSFT 5.0"
Parameter-Request Option 55, length 13:
Subnet-Mask, Default-Gateway, Domain-Name-Server, Domain-Name
Router-Discovery, Static-Route, Vendor-Option, Netbios-Name-Server
Netbios-Node, Netbios-Scope, Classless-Static-Route, Classless-Static-Route-Microsoft
Option 252
END Option 255, length 0
PAD Option 0, length 0, occurs 12
10:02:14.331138 IP (tos 0x10, ttl 128, id 0, offset 0, flags [DF], proto UDP (17), length 321)
192.168.60.1.67 > 192.168.60.11.68: [udp sum ok] BOOTP/DHCP, Reply, length 293, xid 0x7ff14c60, Flags [none] (0x0000)
Your-IP 192.168.60.11
Client-Ethernet-Address 00:0c:29:74:25:16
Vendor-rfc1048 Extensions
Magic Cookie 0x63825363
DHCP-Message Option 53, length 1: Offer
Subnet-Mask Option 1, length 4: 255.255.255.0
Default-Gateway Option 3, length 4: 192.168.60.1
Domain-Name-Server Option 6, length 4: 8.8.8.8
Hostname Option 12, length 8: "mrs-svr1"
Lease-Time Option 51, length 4: 86400
Server-ID Option 54, length 4: 192.168.60.1
Client-ID Option 61, length 7: ether 00:0c:29:74:25:16
END Option 255, length 0
10:02:14.347081 IP (tos 0x0, ttl 128, id 23698, offset 0, flags [none], proto UDP (17), length 353)
0.0.0.0.68 > 255.255.255.255.67: [udp sum ok] BOOTP/DHCP, Request from 00:0c:29:74:25:16, length 325, xid 0x7ff14c60, Flags [none] (0x0000)
Client-Ethernet-Address 00:0c:29:74:25:16
Vendor-rfc1048 Extensions
Magic Cookie 0x63825363
DHCP-Message Option 53, length 1: Request
Client-ID Option 61, length 7: ether 00:0c:29:74:25:16
Requested-IP Option 50, length 4: 192.168.60.11
Server-ID Option 54, length 4: 192.168.60.1
Hostname Option 12, length 8: "MRS-SVR1"
FQDN Option 81, length 23: "MRS-SVR1.etest.local"
Vendor-Class Option 60, length 8: "MSFT 5.0"
Parameter-Request Option 55, length 13:
Subnet-Mask, Default-Gateway, Domain-Name-Server, Domain-Name
Router-Discovery, Static-Route, Vendor-Option, Netbios-Name-Server
Netbios-Node, Netbios-Scope, Classless-Static-Route, Classless-Static-Route-Microsoft
Option 252
END Option 255, length 0
10:02:14.348861 IP (tos 0x10, ttl 128, id 0, offset 0, flags [DF], proto UDP (17), length 287)
192.168.60.1.67 > 255.255.255.255.68: [udp sum ok] BOOTP/DHCP, Reply, length 259, xid 0x7ff14c60, Flags [none] (0x0000)
Client-Ethernet-Address 00:0c:29:74:25:16
Vendor-rfc1048 Extensions
Magic Cookie 0x63825363
DHCP-Message Option 53, length 1: NACK
Server-ID Option 54, length 4: 192.168.60.1
Client-ID Option 61, length 7: ether 00:0c:29:74:25:16
END Option 255, length 0
10:02:14.350250 IP (tos 0x0, ttl 128, id 23699, offset 0, flags [none], proto UDP (17), length 328)
0.0.0.0.68 > 255.255.255.255.67: [udp sum ok] BOOTP/DHCP, Request from 00:0c:29:74:25:16, length 300, xid 0x9e3fedfe, Flags [none] (0x0000)
Client-Ethernet-Address 00:0c:29:74:25:16
Vendor-rfc1048 Extensions
Magic Cookie 0x63825363
DHCP-Message Option 53, length 1: Discover
Client-ID Option 61, length 7: ether 00:0c:29:74:25:16
Hostname Option 12, length 8: "MRS-SVR1"
Vendor-Class Option 60, length 8: "MSFT 5.0"
Parameter-Request Option 55, length 13:
Subnet-Mask, Default-Gateway, Domain-Name-Server, Domain-Name
Router-Discovery, Static-Route, Vendor-Option, Netbios-Name-Server
Netbios-Node, Netbios-Scope, Classless-Static-Route, Classless-Static-Route-Microsoft
Option 252
END Option 255, length 0
PAD Option 0, length 0, occurs 12
10:02:14.351287 IP (tos 0x10, ttl 128, id 0, offset 0, flags [DF], proto UDP (17), length 321)
192.168.60.1.67 > 192.168.60.11.68: [udp sum ok] BOOTP/DHCP, Reply, length 293, xid 0x9e3fedfe, Flags [none] (0x0000)
Your-IP 192.168.60.11
Client-Ethernet-Address 00:0c:29:74:25:16
Vendor-rfc1048 Extensions
Magic Cookie 0x63825363
DHCP-Message Option 53, length 1: Offer
Subnet-Mask Option 1, length 4: 255.255.255.0
Default-Gateway Option 3, length 4: 192.168.60.1
Domain-Name-Server Option 6, length 4: 8.8.8.8
Hostname Option 12, length 8: "mrs-svr1"
Lease-Time Option 51, length 4: 86400
Server-ID Option 54, length 4: 192.168.60.1
Client-ID Option 61, length 7: ether 00:0c:29:74:25:16
END Option 255, length 0
10:02:14.352015 IP (tos 0x0, ttl 128, id 23700, offset 0, flags [none], proto UDP (17), length 353)
0.0.0.0.68 > 255.255.255.255.67: [udp sum ok] BOOTP/DHCP, Request from 00:0c:29:74:25:16, length 325, xid 0x9e3fedfe, Flags [none] (0x0000)
Client-Ethernet-Address 00:0c:29:74:25:16
Vendor-rfc1048 Extensions
Magic Cookie 0x63825363
DHCP-Message Option 53, length 1: Request
Client-ID Option 61, length 7: ether 00:0c:29:74:25:16
Requested-IP Option 50, length 4: 192.168.60.11
Server-ID Option 54, length 4: 192.168.60.1
Hostname Option 12, length 8: "MRS-SVR1"
FQDN Option 81, length 23: "MRS-SVR1.etest.local"
Vendor-Class Option 60, length 8: "MSFT 5.0"
Parameter-Request Option 55, length 13:
Subnet-Mask, Default-Gateway, Domain-Name-Server, Domain-Name
Router-Discovery, Static-Route, Vendor-Option, Netbios-Name-Server
Netbios-Node, Netbios-Scope, Classless-Static-Route, Classless-Static-Route-Microsoft
Option 252
END Option 255, length 0
10:02:14.353246 IP (tos 0x10, ttl 128, id 0, offset 0, flags [DF], proto UDP (17), length 287)
192.168.60.1.67 > 255.255.255.255.68: [udp sum ok] BOOTP/DHCP, Reply, length 259, xid 0x9e3fedfe, Flags [none] (0x0000)
Client-Ethernet-Address 00:0c:29:74:25:16
Vendor-rfc1048 Extensions
Magic Cookie 0x63825363
DHCP-Message Option 53, length 1: NACK
Server-ID Option 54, length 4: 192.168.60.1
Client-ID Option 61, length 7: ether 00:0c:29:74:25:16
END Option 255, length 0