Rin's real father is a foreigner. There seem to be hints pointing to this throughout the manga. Rin is portrayed as having light brown / blonde hair. Also, Daikichi once remarks on how fine Rin's hair is. Not to get into racial stereotyping, but Daikichi is remarking on how Rin's hair is very unlike typical Japanese hair. Masako probably had a fling with a visiting foreigner, got pregnant, and was taken in by Daikichi's grandfather because he wanted to care for her.