Revision 061ab802 proto/ospf/iface.c

View differences:

proto/ospf/iface.c
67 67
  ipsk = sk_new(p->pool);
68 68
  ipsk->type = SK_IP;
69 69
  ipsk->dport = OSPF_PROTO;
70

  
71
#ifdef OSPFv2
70 72
  ipsk->saddr = ifa->iface->addr->ip;
73
#else /* OSPFv3 */
74
  ipsk->saddr = ifa->lladdr;
75
#endif
76

  
71 77
  ipsk->tos = IP_PREC_INTERNET_CONTROL;
72 78
  ipsk->ttl = 1;
73 79
  if (ifa->type == OSPF_IT_VLINK)
......
135 141
	    ifa->dr_sk->type = SK_IP_MC;
136 142
	    ifa->dr_sk->sport = 0;
137 143
	    ifa->dr_sk->dport = OSPF_PROTO;
144

  
145
#ifdef OSPFv2
138 146
	    ifa->dr_sk->saddr = AllDRouters;
147
#else /* OSPFv3 */
148
	    ifa->dr_sk->saddr = ifa->lladdr;
149
#endif
150

  
139 151
	    ifa->dr_sk->daddr = AllDRouters;
140 152
	    ifa->dr_sk->tos = IP_PREC_INTERNET_CONTROL;
141 153
	    ifa->dr_sk->ttl = 1;
......
308 320
  mcsk->type = SK_IP_MC;
309 321
  mcsk->sport = 0;
310 322
  mcsk->dport = OSPF_PROTO;
311
  mcsk->saddr = AllSPFRouters;
323

  
324
#ifdef OSPFv2
325
  mcsk->saddr = AllDRouters;
326
#else /* OSPFv3 */
327
  mcsk->saddr = ifa->lladdr;
328
#endif
329

  
312 330
  mcsk->daddr = AllSPFRouters;
313 331
  mcsk->tos = IP_PREC_INTERNET_CONTROL;
314 332
  mcsk->ttl = 1;

Also available in: Unified diff