Sketch:  Rotate so cylinder axis is || Z axis.

Intersect X/Y projection of line with projected cylinder (similar to,
but easier than, sphere intersection).  Result: no intersection, one
intersection, or two intersections, parameterized along line by t0 and
t1.  Now look at Z, and compute intersections of line with top and
bottom planes of cylinder.  This gives t0' and t1'.  The interval of
intersection is then the bit of the line from [t0,t1] INTERSECT [t0',t1'].

Details left as an exercise for the reader.

=S