Merge with HEAD, close aly's branch.
[nepi.git] / src / nepi / testbeds / planetlab / scripts / mrouted-3.9.5-pl.patch
1 diff -ur --exclude='*.o' --exclude=cfparse.c --exclude='*~' mrouted-3.9.5/config.c mrouted-3.9.5-pl/config.c
2 --- mrouted-3.9.5/config.c      2011-03-05 21:45:25.000000000 +0100
3 +++ mrouted-3.9.5-pl/config.c   2011-08-29 16:32:43.710565000 +0200
4 @@ -91,11 +91,41 @@
5         v->uv_subnetbcast = subnet | ~mask;
6         strncpy(v->uv_name, ifa->ifa_name, sizeof(v->uv_name));
7  
8 -       if (flags & IFF_POINTOPOINT)
9 +       if (flags & IFF_POINTOPOINT) {
10             v->uv_flags |= VIFF_REXMIT_PRUNES;
11 +           v->uv_ptp_addr = ((struct sockaddr_in *)ifa->ifa_dstaddr)->sin_addr.s_addr;
12 +       } else if (flags & IFF_BROADCAST) {
13 +           /* getifaddr doesn't give us the p2p link in this case */
14 +           /* So use ip, which uses netlink, to query it */
15 +           char buf[1024];
16 +        size_t rode;
17 +        FILE *peer;
18 +        
19 +        logit(LOG_INFO,0,"Getting ptp for %s", ifa->ifa_name);
20 +        
21 +        snprintf(buf,sizeof(buf),"ip addr show %s | grep -o 'peer [0-9.]*' | grep -o '[0-9.]*'", ifa->ifa_name);
22 +        peer = popen(buf, "r");
23 +        rode = fread(buf, 1, sizeof(buf), peer);
24 +        pclose(peer);
25 +        
26 +        if (rode > 0) {
27 +            /* It has a pointopoint address */
28 +            struct in_addr ptp_in;
29 +            
30 +            for (--rode; rode && buf[rode] <= 13;)
31 +                --rode;
32 +            buf[++rode] = 0;
33 +
34 +            logit(LOG_INFO,0,"Got %s", buf);
35 +
36 +               if (inet_aton(buf, &ptp_in))
37 +                   v->uv_ptp_addr = ptp_in.s_addr;
38 +        } 
39 +       }
40  
41 -       logit(LOG_INFO,0,"installing %s (%s on subnet %s) as vif #%u - rate=%d",
42 +       logit(LOG_INFO,0,"installing %s (%s on subnet %s%s%s) as vif #%u - rate=%d",
43             v->uv_name, inet_fmt(addr, s1, sizeof(s1)), inet_fmts(subnet, mask, s2, sizeof(s2)),
44 +           (v->uv_ptp_addr) ? "peer " : "", (v->uv_ptp_addr) ? inet_fmt(v->uv_ptp_addr, s3, sizeof(s3)) : "",
45             numvifs, v->uv_rate_limit);
46  
47         ++numvifs;
48 diff -ur --exclude='*.o' --exclude=cfparse.c --exclude='*~' mrouted-3.9.5/defs.h mrouted-3.9.5-pl/defs.h
49 --- mrouted-3.9.5/defs.h        2011-03-05 21:45:25.000000000 +0100
50 +++ mrouted-3.9.5-pl/defs.h     2011-08-30 15:30:23.691662000 +0200
51 @@ -9,6 +9,8 @@
52  #ifndef __MROUTED_DEFS_H__
53  #define __MROUTED_DEFS_H__
54  
55 +#define PLANETLAB 1
56 +
57  #include <stdio.h>
58  #include <stdlib.h>
59  #include <unistd.h>
60 @@ -28,6 +30,7 @@
61  #include <sys/time.h>
62  #include <sys/uio.h>
63  #include <net/if.h>
64 +#include <arpa/inet.h>
65  #include <netinet/in.h>
66  #include <netinet/in_systm.h>
67  #include <netinet/ip.h>
68 @@ -61,7 +64,7 @@
69  #include <libutil.h>
70  #endif
71  #endif
72 -#ifdef RSRR
73 +#if defined(RSRR) || defined(PLANETLAB)
74  #include <sys/un.h>
75  #endif /* RSRR */
76  
77 @@ -137,6 +140,11 @@
78  extern u_int32         dvmrp_group;
79  extern u_int32         dvmrp_genid;
80  
81 +#ifdef PLANETLAB
82 +extern int      plrt_socket;
83 +extern char     *plrt_socket_path;
84 +#endif
85 +
86  #define        IF_DEBUG(l)     if (debug && debug & (l))
87  
88  #define        DEBUG_PKT       0x0001
89 @@ -353,6 +361,8 @@
90  extern void            k_leave(u_int32, u_int32);
91  extern void            k_init_dvmrp(void);
92  extern void            k_stop_dvmrp(void);
93 +extern void     k_init_plrt(void);
94 +extern void     k_stop_plrt(void);
95  extern void            k_add_vif(vifi_t, struct uvif *);
96  extern void            k_del_vif(vifi_t, struct uvif *);
97  extern void            k_add_rg(u_int32, struct gtable *);
98 diff -ur --exclude='*.o' --exclude=cfparse.c --exclude='*~' mrouted-3.9.5/igmp.c mrouted-3.9.5-pl/igmp.c
99 --- mrouted-3.9.5/igmp.c        2011-03-05 21:45:25.000000000 +0100
100 +++ mrouted-3.9.5-pl/igmp.c     2011-08-29 17:03:24.187961000 +0200
101 @@ -190,8 +190,10 @@
102      if (ip->ip_p == 0) {
103         if (src == 0 || dst == 0)
104             logit(LOG_WARNING, 0, "kernel request not accurate");
105 -       else
106 +       else {
107 +           logit(LOG_DEBUG, 0, "received kernel miss");
108             add_table_entry(src, dst);
109 +    }
110         return;
111      }
112  
113 diff -ur --exclude='*.o' --exclude=cfparse.c --exclude='*~' mrouted-3.9.5/kern.c mrouted-3.9.5-pl/kern.c
114 --- mrouted-3.9.5/kern.c        2011-03-05 21:45:25.000000000 +0100
115 +++ mrouted-3.9.5-pl/kern.c     2011-08-31 15:09:21.457071000 +0200
116 @@ -7,16 +7,26 @@
117   * Leland Stanford Junior University.
118   */
119  
120 +#include <paths.h>
121  #include "defs.h"
122  
123  int curttl = 0;
124  
125 +#ifdef PLANETLAB
126 +
127 +int plrt_socket;
128 +char *plrt_socket_path = _PATH_MROUTED_PLRT;
129 +
130 +#endif
131 +
132  /*
133   * Open/init the multicast routing in the kernel and sets the
134   * MRT_PIM (aka MRT_ASSERT) flag in the kernel.
135   */
136  void k_init_dvmrp(void)
137  {
138 +#ifndef PLANETLAB
139 +
140  #ifdef OLD_KERNEL
141      if (setsockopt(igmp_socket, IPPROTO_IP, MRT_INIT, (char *)NULL, 0) < 0) {
142  #else
143 @@ -24,11 +34,34 @@
144  
145      if (setsockopt(igmp_socket, IPPROTO_IP, MRT_INIT, (char *)&v, sizeof(int)) < 0) {
146  #endif
147 +
148         if (errno == EADDRINUSE)
149             logit(LOG_ERR, 0, "Another multicast routing application is already running.");
150         else
151             logit(LOG_ERR, errno, "Cannot enable multicast routing in kernel");
152      }
153 +
154 +#endif
155 +}
156 +
157 +void k_init_plrt(void)
158 +{
159 +#ifdef PLANETLAB
160 +    /* 
161 +     * Just open a connection to the user-space forwarder
162 +     */
163 +
164 +    if ((plrt_socket = socket(AF_UNIX, SOCK_SEQPACKET, 0)) < 0) 
165 +       logit(LOG_ERR, errno, "PLRT socket");
166 +       
167 +       struct sockaddr_un sun;
168 +       memset(&sun, 0, sizeof(sun));
169 +       sun.sun_family = AF_UNIX;
170 +       strncpy(sun.sun_path, plrt_socket_path, sizeof(sun.sun_path));
171 +       
172 +    if ((connect(plrt_socket, &sun, sizeof(sun))) < 0) 
173 +       logit(LOG_ERR, errno, "PLRT socket connect");
174 +#endif
175  }
176  
177  
178 @@ -38,8 +71,17 @@
179   */
180  void k_stop_dvmrp(void)
181  {
182 +#ifndef PLANETLAB
183      if (setsockopt(igmp_socket, IPPROTO_IP, MRT_DONE, (char *)NULL, 0) < 0)
184         logit(LOG_WARNING, errno, "Cannot disable multicast routing in kernel");
185 +#endif
186 +}
187 +
188 +void k_stop_plrt(void)
189 +{
190 +#ifdef PLANETLAB
191 +    close(plrt_socket);
192 +#endif
193  }
194  
195  
196 @@ -194,11 +236,25 @@
197   */
198  void k_add_vif(vifi_t vifi, struct uvif *v)
199  {
200 -    struct vifctl vc;
201 -
202 -    vc.vifc_vifi = vifi;
203 -    uvif_to_vifctl(&vc, v);
204 -    if (setsockopt(igmp_socket, IPPROTO_IP, MRT_ADD_VIF, (char *)&vc, sizeof(vc)) < 0)
205 +    /* 
206 +     * PlanetLab does application-level forwarding
207 +     */
208 +    struct {
209 +        u_int32 op;
210 +        u_int32 len;
211 +        struct vifctl vc;
212 +    } op;
213 +
214 +    op.vc.vifc_vifi = vifi;
215 +    uvif_to_vifctl(&op.vc, v);
216 +
217 +#ifdef PLANETLAB
218 +    op.op = MRT_ADD_VIF;
219 +    op.len = sizeof(op.vc);
220 +    if (send(plrt_socket, &op, sizeof(op), 0) < 0)
221 +#else
222 +    if (setsockopt(igmp_socket, IPPROTO_IP, MRT_ADD_VIF, (char *)&op.vc, sizeof(op.vc)) < 0)
223 +#endif
224         logit(LOG_ERR, errno, "setsockopt MRT_ADD_VIF on vif %d", vifi);
225  }
226  
227 @@ -214,6 +270,20 @@
228       * we're going to delete.  *BSD systems on the other hand exepect only the index
229       * of that VIF.
230       */
231 +#ifdef PLANETLAB
232 +    struct {
233 +        u_int32 op;
234 +        u_int32 len;
235 +        struct vifctl vc;
236 +    } op;
237 +
238 +    op.vc.vifc_vifi = vifi;
239 +    uvif_to_vifctl(&op.vc, v);
240 +
241 +    op.op = MRT_DEL_VIF;
242 +    op.len = sizeof(op.vc);
243 +    if (send(plrt_socket, &op, sizeof(op), 0) < 0)
244 +#else
245  #ifdef __linux__
246      struct vifctl vc;
247  
248 @@ -224,6 +294,7 @@
249  #else /* *BSD et al. */
250      if (setsockopt(igmp_socket, IPPROTO_IP, MRT_DEL_VIF, (char *)&vifi, sizeof(vifi)) < 0)
251  #endif /* !__linux__ */
252 +#endif /* PLANETLAB */
253      {
254          if (errno == EADDRNOTAVAIL || errno == EINVAL)
255              return;
256 @@ -238,31 +309,57 @@
257   */
258  void k_add_rg(u_int32 origin, struct gtable *g)
259  {
260 -    struct mfcctl mc;
261 +    struct {
262 +        u_int32 op;
263 +        u_int32 len;
264 +        struct mfcctl mc;
265 +    } op;
266 +    
267      vifi_t i;
268  
269  #ifdef DEBUG_MFC
270      md_log(MD_ADD, origin, g->gt_mcastgrp);
271  #endif
272      /* copy table values so that setsockopt can process it */
273 -    mc.mfcc_origin.s_addr = origin;
274 +    op.mc.mfcc_origin.s_addr = origin;
275  #ifdef OLD_KERNEL
276 -    mc.mfcc_originmask.s_addr = 0xffffffff;
277 +    op.mc.mfcc_originmask.s_addr = 0xffffffff;
278  #endif
279 -    mc.mfcc_mcastgrp.s_addr = g->gt_mcastgrp;
280 -    mc.mfcc_parent = g->gt_route ? g->gt_route->rt_parent : NO_VIF;
281 +    op.mc.mfcc_mcastgrp.s_addr = g->gt_mcastgrp;
282 +    op.mc.mfcc_parent = g->gt_route ? g->gt_route->rt_parent : NO_VIF;
283      for (i = 0; i < numvifs; i++)
284 -       mc.mfcc_ttls[i] = g->gt_ttls[i];
285 +       op.mc.mfcc_ttls[i] = g->gt_ttls[i];
286 +
287 +#ifdef PLANETLAB
288 +
289 +       logit(LOG_DEBUG, 0, "setsockopt MRT_ADD_MFC %s-%s %d[%d %d %d %d %d %d]", 
290 +           inet_fmt(origin, s1, sizeof(s1)),
291 +           inet_fmt(g->gt_mcastgrp, s2, sizeof(s2)),
292 +           numvifs,
293 +           op.mc.mfcc_ttls[0], op.mc.mfcc_ttls[1], op.mc.mfcc_ttls[2],
294 +           op.mc.mfcc_ttls[3], op.mc.mfcc_ttls[4], op.mc.mfcc_ttls[5] );
295 +
296 +    /* Send to PlanetLab's user-space MRT daemon */
297 +    op.op = MRT_ADD_MFC;
298 +    op.len = sizeof(op.mc);
299 +    if (send(plrt_socket, &op, sizeof(op), 0) < 0)
300 +
301 +#else /* here if not PLANETLAB */
302  
303      /* write to kernel space */
304      if (setsockopt(igmp_socket, IPPROTO_IP, MRT_ADD_MFC,
305 -                  (char *)&mc, sizeof(mc)) < 0) {
306 +                  (char *)&op.mc, sizeof(op.mc)) < 0) 
307 +   
308 +#endif /* PLANETLAB */
309 +   
310 +    {
311  #ifdef DEBUG_MFC
312         md_log(MD_ADD_FAIL, origin, g->gt_mcastgrp);
313  #endif
314         logit(LOG_WARNING, errno, "setsockopt MRT_ADD_MFC",
315                 inet_fmt(origin, s1, sizeof(s1)), inet_fmt(g->gt_mcastgrp, s2, sizeof(s2)));
316      }
317 +
318  }
319  
320  
321 @@ -271,20 +368,37 @@
322   */
323  int k_del_rg(u_int32 origin, struct gtable *g)
324  {
325 -    struct mfcctl mc;
326 +    struct {
327 +        u_int32 op;
328 +        u_int32 len;
329 +        struct mfcctl mc;
330 +    } op;
331  
332  #ifdef DEBUG_MFC
333      md_log(MD_DEL, origin, g->gt_mcastgrp);
334  #endif
335      /* copy table values so that setsockopt can process it */
336 -    mc.mfcc_origin.s_addr = origin;
337 +    op.mc.mfcc_origin.s_addr = origin;
338  #ifdef OLD_KERNEL
339 -    mc.mfcc_originmask.s_addr = 0xffffffff;
340 +    op.mc.mfcc_originmask.s_addr = 0xffffffff;
341  #endif
342 -    mc.mfcc_mcastgrp.s_addr = g->gt_mcastgrp;
343 +    op.mc.mfcc_mcastgrp.s_addr = g->gt_mcastgrp;
344 +
345 +#ifdef PLANETLAB
346 +
347 +    /* Send to PlanetLab's user-space MRT daemon */
348 +    op.op = MRT_DEL_MFC;
349 +    op.len = sizeof(op.mc);
350 +    if (send(plrt_socket, &op, sizeof(op), 0) < 0)
351 +
352 +#else /* here if not PLANETLAB */
353  
354      /* write to kernel space */
355 -    if (setsockopt(igmp_socket, IPPROTO_IP, MRT_DEL_MFC, (char *)&mc, sizeof(mc)) < 0) {
356 +    if (setsockopt(igmp_socket, IPPROTO_IP, MRT_DEL_MFC, (char *)&op.mc, sizeof(op.mc)) < 0) 
357 +
358 +#endif /* PLANETLAB */
359 +    
360 +    {
361  #ifdef DEBUG_MFC
362         md_log(MD_DEL_FAIL, origin, g->gt_mcastgrp);
363  #endif
364 diff -ur --exclude='*.o' --exclude=cfparse.c --exclude='*~' mrouted-3.9.5/main.c mrouted-3.9.5-pl/main.c
365 --- mrouted-3.9.5/main.c        2011-03-05 21:45:25.000000000 +0100
366 +++ mrouted-3.9.5-pl/main.c     2011-08-30 15:31:01.281814000 +0200
367 @@ -52,9 +52,9 @@
368  time_t mrouted_init_time;
369  
370  #ifdef SNMP
371 -#define NHANDLERS      34
372 +#define NHANDLERS      35
373  #else
374 -#define NHANDLERS      2
375 +#define NHANDLERS      3
376  #endif
377  
378  static struct ihandler {
379 @@ -206,6 +206,9 @@
380      fputs("  -h, --help           Show this help text\n", stderr);
381      fputs("  -p                   Disable pruning.  Deprecated, compatibility option\n", stderr);
382      fputs("  -r, --show-routes    Show state of VIFs and multicast routing tables\n", stderr);
383 +#ifdef PLANETLAB
384 +    fputs("  -F                   Path to the PlanetLab userland forwarder, default /var/run/mcastfwd\n", stderr);
385 +#endif
386      fprintf(stderr, "  -v, --version        Show %s version\n", __progname);
387      fputs("\n", stderr);
388  
389 @@ -258,11 +261,23 @@
390  
391      snprintf(versionstring, sizeof(versionstring), "mrouted version %s", todaysversion);
392  
393 -    while ((ch = getopt_long(argc, argv, "c:d::fhpP::rv", long_options, NULL)) != EOF) {
394 +#ifdef PLANETLAB
395 +#define PLOPTIONS ":F"
396 +#else
397 +#define PLOPTIONS ""
398 +#endif
399 +
400 +    while ((ch = getopt_long(argc, argv, "c:d::fhpP::rv" PLOPTIONS, long_options, NULL)) != EOF) {
401         switch (ch) {
402             case 'c':
403                 configfilename = optarg;
404                 break;
405 +               
406 +#ifdef PLANETLAB
407 +               case 'F':
408 +               plrt_socket_path = optarg;
409 +               break;
410 +#endif
411  
412             case 'd':
413                 if (!optarg)
414 @@ -410,6 +425,8 @@
415      init_ipip();
416      init_routes();
417      init_ktable();
418 +    k_init_plrt();
419 +
420  #ifndef OLD_KERNEL
421      /*
422       * Unfortunately, you can't k_get_version() unless you've
423 @@ -422,6 +439,7 @@
424      k_init_dvmrp();
425      vers = k_get_version();
426      k_stop_dvmrp();
427 +    
428      /*XXX
429       * This function must change whenever the kernel version changes
430       */
431 @@ -466,6 +484,15 @@
432         logit(LOG_ERR, 0, "Descriptor too big");
433      FD_SET(igmp_socket, &readers);
434      nfds = igmp_socket + 1;
435 +    
436 +#ifdef PLANETLAB
437 +    if (plrt_socket >= (int)FD_SETSIZE)
438 +       logit(LOG_ERR, 0, "Descriptor too big");
439 +    FD_SET(plrt_socket, &readers);
440 +    if (plrt_socket >= nfds)
441 +        nfds = plrt_socket + 1;
442 +#endif
443 +
444      for (i = 0; i < nhandlers; i++) {
445         if (ihandlers[i].fd >= (int)FD_SETSIZE)
446             logit(LOG_ERR, 0, "Descriptor too big");
447 @@ -602,6 +629,17 @@
448                 accept_igmp(recvlen);
449             }
450  
451 +#ifdef PLANETLAB
452 +           if (FD_ISSET(plrt_socket, &rfds)) {
453 +               recvlen = recvfrom(plrt_socket, recv_buf, RECV_BUF_SIZE, 0, NULL, &dummy);
454 +               if (recvlen < 0) {
455 +                   if (errno != EINTR) logit(LOG_ERR, errno, "recvfrom");
456 +                   continue;
457 +               }
458 +               accept_igmp(recvlen);
459 +           }
460 +#endif
461 +
462             for (i = 0; i < nhandlers; i++) {
463                 if (FD_ISSET(ihandlers[i].fd, &rfds)) {
464                     (*ihandlers[i].func)(ihandlers[i].fd, &rfds);
465 @@ -808,6 +846,7 @@
466         if (did_final_init)
467             k_stop_dvmrp();
468      }
469 +    k_stop_plrt();
470  }
471  
472  /*
473 diff -ur --exclude='*.o' --exclude=cfparse.c --exclude='*~' mrouted-3.9.5/Makefile mrouted-3.9.5-pl/Makefile
474 --- mrouted-3.9.5/Makefile      2011-03-05 21:45:25.000000000 +0100
475 +++ mrouted-3.9.5-pl/Makefile   2011-08-10 17:18:22.233596000 +0200
476 @@ -43,7 +43,7 @@
477  
478  ## Common
479  CFLAGS        = $(MCAST_INCLUDE) $(SNMPDEF) $(RSRRDEF) $(INCLUDES) $(DEFS) $(USERCOMPILE)
480 -CFLAGS       += -O2 -W -Wall -Werror
481 +CFLAGS       += -O2 -W -Wall
482  #CFLAGS       += -O -g
483  LDLIBS        = $(SNMPLIBDIR) $(SNMPLIBS) $(EXTRA_LIBS)
484  LDFLAGS      += -Wl,-Map,$@.map
485 Only in mrouted-3.9.5-pl: Makefile.bk
486 Only in mrouted-3.9.5-pl: map-mbone
487 Only in mrouted-3.9.5-pl: map-mbone.map
488 Only in mrouted-3.9.5-pl: mrinfo
489 Only in mrouted-3.9.5-pl: mrinfo.map
490 Only in mrouted-3.9.5-pl: mrouted
491 Only in mrouted-3.9.5-pl: mrouted.map
492 Only in mrouted-3.9.5-pl: mtrace
493 Only in mrouted-3.9.5-pl: mtrace.map
494 diff -ur --exclude='*.o' --exclude=cfparse.c --exclude='*~' mrouted-3.9.5/pathnames.h mrouted-3.9.5-pl/pathnames.h
495 --- mrouted-3.9.5/pathnames.h   2011-03-05 21:45:25.000000000 +0100
496 +++ mrouted-3.9.5-pl/pathnames.h        2011-08-29 13:10:27.043684000 +0200
497 @@ -14,5 +14,6 @@
498  #define _PATH_MROUTED_GENID    _PATH_MROUTED_RUNDIR "/mrouted.genid"
499  #define _PATH_MROUTED_DUMP     _PATH_MROUTED_RUNDIR "/mrouted.dump"
500  #define _PATH_MROUTED_CACHE    _PATH_MROUTED_RUNDIR "/mrouted.cache"
501 +#define _PATH_MROUTED_PLRT     _PATH_VARRUN "mcastrt"
502  
503  #endif /* __MROUTED_PATHNAMES_H__ */
504 Only in mrouted-3.9.5-pl: vers.c
505 diff -ur --exclude='*.o' --exclude=cfparse.c --exclude='*~' mrouted-3.9.5/vif.c mrouted-3.9.5-pl/vif.c
506 --- mrouted-3.9.5/vif.c 2011-03-05 21:45:25.000000000 +0100
507 +++ mrouted-3.9.5-pl/vif.c      2011-08-31 19:26:52.955453000 +0200
508 @@ -139,6 +139,7 @@
509      v->uv_lcl_addr     = 0;
510      v->uv_rmt_addr     = 0;
511      v->uv_dst_addr     = t ? 0 : dvmrp_group;
512 +    v->uv_ptp_addr  = 0;
513      v->uv_subnet       = 0;
514      v->uv_subnetmask   = 0;
515      v->uv_subnetbcast  = 0;
516 @@ -379,6 +380,8 @@
517             start_route_updates();
518             update_route(p->pa_subnet, p->pa_subnetmask, 0, 0, vifi, NULL);
519         }
520 +       if (v->uv_ptp_addr)
521 +           update_route(v->uv_ptp_addr, 0xffffffff, 0, 0, vifi, NULL);
522  
523         /*
524          * Until neighbors are discovered, assume responsibility for sending
525 @@ -526,6 +529,8 @@
526                     return(vifi);
527             }
528             else {
529 +               if (src == v->uv_ptp_addr)
530 +                   return(vifi);
531                 if ((src & v->uv_subnetmask) == v->uv_subnet &&
532                     ((v->uv_subnetmask == 0xffffffff) ||
533                      (src != v->uv_subnetbcast)))
534 @@ -1666,6 +1671,10 @@
535                         scaletime(now - v->uv_querier->al_ctime),
536                         scaletime(v->uv_querier->al_timer));
537         }
538 +       if (0 != v->uv_ptp_addr) {
539 +           fprintf(fp, "                     PtP remote: %-18s\n",
540 +                                   inet_fmt(v->uv_ptp_addr, s1, sizeof(s1)));
541 +       }
542         if (v->uv_flags & VIFF_BLASTER)
543             fprintf(fp, "                  blasterbuf size: %dk\n",
544                         v->uv_blasterlen / 1024);
545 diff -ur --exclude='*.o' --exclude=cfparse.c --exclude='*~' mrouted-3.9.5/vif.h mrouted-3.9.5-pl/vif.h
546 --- mrouted-3.9.5/vif.h 2011-03-05 21:45:25.000000000 +0100
547 +++ mrouted-3.9.5-pl/vif.h      2011-08-29 14:35:35.695829000 +0200
548 @@ -109,6 +109,7 @@
549      u_int32         uv_lcl_addr;   /* local address of this vif            */
550      u_int32         uv_rmt_addr;   /* remote end-point addr (tunnels only) */
551      u_int32         uv_dst_addr;   /* destination for DVMRP/PIM messages   */
552 +    u_int32         uv_ptp_addr;   /* remote peer address   (pointopoint only) */
553      u_int32         uv_subnet;     /* subnet number         (phyints only) */
554      u_int32         uv_subnetmask; /* subnet mask           (phyints only) */
555      u_int32         uv_subnetbcast;/* subnet broadcast addr (phyints only) */