Glasgow had the consolation of a losing bonus point on a chill evening at the Royal Dublin Showground, but they would have had more but for a brilliant solo performance by Ian Madigan.

The Leinster fly-half, cruelly overlooked for most of the Six Nations, showed Ireland what they had been missing by scoring all his side's points, including a critical solo try a few minutes from the end.

Until then, Glasgow had controlled the game and the scoreboard, their powerful forwards bossing the breakdowns and generally giving Leinster a dose of their own physical medicine. It was a setback for Gregor Townsend's side, but far from being a killer blow in their bid to make the RaboDirect PRO12 play-offs.

For Glasgow, Peter Horne and Peter Murchie put in excellent shifts behind the scrum, causing alarm in the Leinster defence with some of their runs. In adverse conditions, Duncan Weir didn't do much wrong at fly-half either, varying his game nicely on an evening when niceties must have been devilishly difficult to summon.

As bitter as the wind was, it was firmly behind Glasgow in the first half. Not that you would have known it from the opening passages of play, as Leinster ran purposefully into the Scots' territory. Glasgow coughed up a few penalties in that period, but as the clock approached 10 minutes they struck back.

It began with a line-out on the left side, won improbably, by a grubber kick from hooker Dougie Hall. Rob Harley regained possession to set up a series of forward bashes, the most effective of them delivered by Josh Strauss, the No 8. Strauss carried the ball almost to the line, then off-loaded superbly for Ed Kalman to finish off the try, which Weir converted.

The home crowd fell silent, although they were roused three minutes later when Madigan nudged over a penalty for Leinster's first points. However, Weir soon matched that kick to keep the margin at seven points at the end of the first quarter.

Madigan kicked a second penalty in the 23rd minute, but Glasgow probably found more cause for alarm in the fact that Strauss appeared to be struggling with a leg injury by that point. The South African soldiered on, but his effectiveness was clearly diminished for a significant amount of time.

Leinster struggled to make headway against a gale that blew every high ball back in their faces. But it was the force of nature called DTH Van der Merwe who caused them an even greater problem in the 31st minute. From an apparently unthreatening position, Van der Merwe broke down the left touchline, beat three defenders then slipped an inside pass for Horne to collect the second Glasgow try.

All things considered, Leinster may well have been satisfied with the 12-17 interval scoreline – brought up after Madigan had added another two penalties – knowing as they did that they would have the wind at their backs in the second half. Yet it would be pushing it to say that Glasgow's tactics had really exploited the conditions to the full, doing most of the damage with the excellence of their ground-level attacks.

Glasgow looked by far the more effective side in the early minutes of the second period, feeding richly on a stream of Leinster mistakes and pinning their hosts in their own half.

Ryan Wilson replaced Harley in the 49th minute, taking the No 8 slot, with Strauss moving to blindside, and the new Scotland cap soon made his presence felt with a couple of trademark charges.

And still, Leinster dished up easy possession for Glasgow with elementary mistakes. By his own standards, Niko Matawalu had played conservatively in the first half, but he began to probe and dart around the fringes, although he was still happier to off-load to hard-charging forwards than take the ball on himself.

Glasgow's half-time lead survived the third quarter, although Leinster finally began to put some phases together as the game clicked past the hour mark. Matawalu made way for Henry Pyrgos around the same time, while the introduction of Jon Welsh and Pat MacArthur beefed up the Glasgow front row, presumably in the expectation that Leinster would start to crank up the pressure as well.

However, the Leinster breakthrough actually came from a superb piece of solo skill by Madigan, who cut inside the Glasgow cover to score near the posts with eight minutes left.

The fly-half's own conversion put Leinster ahead for the first time and he rubbed salt in Glasgow wounds a few minutes later when he clipped over another penalty.

Leinster: I Nacewa; D Kearney, E O'Malley, G D'Arcy, A Conway; I Madigan, I Boss; H Van der Merwe (J McGrath, 61); S Cronin, M Bent (J Hagan, 46), L Cullen (captain), Q Roux (D Toner, 49), K McLaughlin (D Ryan, 61), S Jennings, J Murphy.

Glasgow: P Murchie; T Seymour (S Lamont, 55), A Dunbar, P Horne, DTH Van der Merwe, D Weir, N Matawalu (H Pyrgos, 63); M Low (G Reid, 63), D Hall (P MacArthur, 63), E Kalman (J Welsh, 49), A Kellock (captain), R Harley (R Wilson 49), J Barclay, J Strauss (J Eddie, 74).

Referee: N Owens (Wales)