  Let F be a totally real field, v an unramified place of F dividing p and rho
a continuous irreducible two-dimensional mod p representation of G_F such that
the restriction of rho to G_{F_v} is reducible and sufficiently generic. If rho
is modular (and satisfies some weak technical assumptions), we show how to
recover the corresponding extension between the two characters of G_{F_v} in
terms of the action of GL_2(F_v) on the cohomology mod p.
