EC 4389 then IB 1151 at Madrid
Lyon → Madrid → Porto
Timetable, Madrid time
17:00EC 4389 from Lyon at the gate
15:40IB 1151 to Porto leaves the gate
22 h 40 apart on the timetable, overnight
IB 1151 leaves 22 h 40 after EC 4389 arrives on the timetable: more than half a day, so not a connection we count.