Undertaking in and of itself isn't illegal, but you could be landed with a fixed penalty notice for careless driving.