Okay... I worked upstream, and here's the upstream patch. If accepted this also closes out bug#30714. I've done this as two separate patches (one with my original patch and then one with the suggested update from upstream) because the patch doesn't apply automatically pre- 6.12 anyway, so it makes sense to patch with the minimalist patch, and then with the full fix.